Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Steinhardt <psteinhardt@gitlab.com>2021-05-18 19:47:29 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2021-05-19 20:10:48 +0300
commit5c71d9b38ab8151a7496fbd72608204127f9d784 (patch)
treecee23ac7a62f3659145e195dee71c508a85b443c
parent106c9d08cbd18176f14605eebdb50be02d743190 (diff)
remote: Allow passing testserver options
The remote service setup functions do not accept testserver options, which makes it impossible to override a subset of dependencies. Refactor them to accept options.
-rw-r--r--internal/gitaly/service/remote/testhelper_test.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/internal/gitaly/service/remote/testhelper_test.go b/internal/gitaly/service/remote/testhelper_test.go
index bc2bf7fa6..0cffc5261 100644
--- a/internal/gitaly/service/remote/testhelper_test.go
+++ b/internal/gitaly/service/remote/testhelper_test.go
@@ -54,7 +54,7 @@ func TestWithRubySidecar(t *testing.T) {
}
}
-func setupRemoteServiceWithRuby(t *testing.T, cfg config.Cfg, rubySrv *rubyserver.Server) (config.Cfg, *gitalypb.Repository, string, gitalypb.RemoteServiceClient) {
+func setupRemoteServiceWithRuby(t *testing.T, cfg config.Cfg, rubySrv *rubyserver.Server, opts ...testserver.GitalyServerOpt) (config.Cfg, *gitalypb.Repository, string, gitalypb.RemoteServiceClient) {
t.Helper()
repo, repoPath, cleanup := gittest.CloneRepoAtStorage(t, cfg, cfg.Storages[0], t.Name())
@@ -69,7 +69,7 @@ func setupRemoteServiceWithRuby(t *testing.T, cfg config.Cfg, rubySrv *rubyserve
deps.GetCatfileCache(),
deps.GetTxManager(),
))
- })
+ }, opts...)
cfg.SocketPath = addr
client, conn := newRemoteClient(t, addr)
@@ -78,11 +78,11 @@ func setupRemoteServiceWithRuby(t *testing.T, cfg config.Cfg, rubySrv *rubyserve
return cfg, repo, repoPath, client
}
-func setupRemoteService(t *testing.T) (config.Cfg, *gitalypb.Repository, string, gitalypb.RemoteServiceClient) {
+func setupRemoteService(t *testing.T, opts ...testserver.GitalyServerOpt) (config.Cfg, *gitalypb.Repository, string, gitalypb.RemoteServiceClient) {
t.Helper()
cfg := testcfg.Build(t)
- return setupRemoteServiceWithRuby(t, cfg, nil)
+ return setupRemoteServiceWithRuby(t, cfg, nil, opts...)
}
func newRemoteClient(t *testing.T, serverSocketPath string) (gitalypb.RemoteServiceClient, *grpc.ClientConn) {