diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2022-07-20 15:40:42 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2022-07-22 14:38:39 +0300 |
commit | 539b09030b8b764a77786c025652b8ebf660c296 (patch) | |
tree | 7d8c5d94f453d49b3d279d234eddd36645fc3c30 | |
parent | 7b2d59bcdd9ebab3344c43d85564f0633f99956e (diff) |
ssh: Add helper to start an SSH server and return its GitalyServer
The testhelper to start the gRPC server for the ssh service is only
exposing the socket address of the server. Add a new function that
returns the `GitalyServer` to make it accessible to tests.
-rw-r--r-- | internal/gitaly/service/ssh/testhelper_test.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/internal/gitaly/service/ssh/testhelper_test.go b/internal/gitaly/service/ssh/testhelper_test.go index 407c6dbe4..a23087122 100644 --- a/internal/gitaly/service/ssh/testhelper_test.go +++ b/internal/gitaly/service/ssh/testhelper_test.go @@ -25,7 +25,11 @@ func runSSHServer(t *testing.T, cfg config.Cfg, serverOpts ...testserver.GitalyS } func runSSHServerWithOptions(t *testing.T, cfg config.Cfg, opts []ServerOpt, serverOpts ...testserver.GitalyServerOpt) string { - return testserver.RunGitalyServer(t, cfg, nil, func(srv *grpc.Server, deps *service.Dependencies) { + return startSSHServerWithOptions(t, cfg, opts, serverOpts...).Address() +} + +func startSSHServerWithOptions(t *testing.T, cfg config.Cfg, opts []ServerOpt, serverOpts ...testserver.GitalyServerOpt) testserver.GitalyServer { + return testserver.StartGitalyServer(t, cfg, nil, func(srv *grpc.Server, deps *service.Dependencies) { gitalypb.RegisterSSHServiceServer(srv, NewServer( deps.GetLocator(), deps.GetGitCmdFactory(), |