diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2022-12-21 10:27:08 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2023-01-09 10:07:41 +0300 |
commit | 1fd56444ffb8ce065b3f9b62670bb048b7a11919 (patch) | |
tree | ca37a46958b30ac2d8aa014f0d4ee5d1abec79c1 /internal/gitaly/server/auth_test.go | |
parent | 23277d0552961087bd259f9b469d79a94c859e13 (diff) |
gitaly/server: Make function to construct servers a receiver
While we already have the server factory type to construct Gitaly
servers, the actual logic is in a non-receiver function. Refactor the
code so that `New()` is a receiver function of the factory.
Diffstat (limited to 'internal/gitaly/server/auth_test.go')
-rw-r--r-- | internal/gitaly/server/auth_test.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/internal/gitaly/server/auth_test.go b/internal/gitaly/server/auth_test.go index aa8e64f50..b0322c6f6 100644 --- a/internal/gitaly/server/auth_test.go +++ b/internal/gitaly/server/auth_test.go @@ -206,7 +206,7 @@ func runServer(t *testing.T, cfg config.Cfg) string { limitHandler := limithandler.New(cfg, limithandler.LimitConcurrencyByRepo, limithandler.WithConcurrencyLimiters) updaterWithHooks := updateref.NewUpdaterWithHooks(cfg, locator, hookManager, gitCmdFactory, catfileCache) - srv, err := New(false, cfg, testhelper.NewDiscardingLogEntry(t), registry, diskCache, []*limithandler.LimiterMiddleware{limitHandler}) + srv, err := NewGitalyServerFactory(cfg, testhelper.NewDiscardingLogEntry(t), registry, diskCache, []*limithandler.LimiterMiddleware{limitHandler}).New(false) require.NoError(t, err) setup.RegisterAll(srv, &service.Dependencies{ @@ -241,14 +241,13 @@ func runSecureServer(t *testing.T, cfg config.Cfg) string { conns := client.NewPool() t.Cleanup(func() { conns.Close() }) - srv, err := New( - true, + srv, err := NewGitalyServerFactory( cfg, testhelper.NewDiscardingLogEntry(t), backchannel.NewRegistry(), cache.New(cfg, config.NewLocator(cfg)), []*limithandler.LimiterMiddleware{limithandler.New(cfg, limithandler.LimitConcurrencyByRepo, limithandler.WithConcurrencyLimiters)}, - ) + ).New(true) require.NoError(t, err) healthpb.RegisterHealthServer(srv, health.NewServer()) |