diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2022-07-20 15:40:11 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2022-07-22 14:38:39 +0300 |
commit | 7b2d59bcdd9ebab3344c43d85564f0633f99956e (patch) | |
tree | 4afda4f7103ee2752db369191ce72d1e89994490 | |
parent | 063f11e725f64cfc5d09f5504c5240f06fedeabd (diff) |
testserver: Make the gRPC server accessible to outside callers
Make the gRPC server accessible to outside callers so that they can for
example register additional listeners for the server.
-rw-r--r-- | internal/testhelper/testserver/gitaly.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/internal/testhelper/testserver/gitaly.go b/internal/testhelper/testserver/gitaly.go index 2e8df3a60..1d90fabfe 100644 --- a/internal/testhelper/testserver/gitaly.go +++ b/internal/testhelper/testserver/gitaly.go @@ -54,6 +54,7 @@ func StartGitalyServer(t testing.TB, cfg config.Cfg, rubyServer *rubyserver.Serv if !testhelper.IsPraefectEnabled() || disablePraefect { return GitalyServer{ + Server: gitalySrv, shutdown: gitalySrv.Stop, address: gitalyAddr, } @@ -61,6 +62,7 @@ func StartGitalyServer(t testing.TB, cfg config.Cfg, rubyServer *rubyserver.Serv praefectServer := runPraefectProxy(t, cfg, gitalyAddr) return GitalyServer{ + Server: gitalySrv, shutdown: func() { praefectServer.Shutdown() gitalySrv.Stop() @@ -106,6 +108,7 @@ func runPraefectProxy(t testing.TB, gitalyCfg config.Cfg, gitalyAddr string) Pra // GitalyServer is a helper that carries additional info and // functionality about gitaly (+praefect) server. type GitalyServer struct { + Server *grpc.Server shutdown func() address string } |