diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2020-09-09 13:23:20 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2020-09-09 13:23:20 +0300 |
commit | 8be19842eef0c0186f9294f86f86d78e7f1b2e71 (patch) | |
tree | ca94a3fbba051aa90a591e69cd8222f796967ba6 /internal/gitaly/service/hook/testhelper_test.go | |
parent | b9703797a48c5cff1adf84a152c4024cff9b35ed (diff) |
hook: Pass complete configuration to the hook manager
When instantiating a new hook manager, we currently pass only the hook
configuration to it as that's all we required up to now. But as we're
about to move the setup of Prometheus metrics into the hook manager,
we'll also require configuration of Prometheus buckets.
This commit thus refactors the hook manager to accept the complete
Gitaly configuration as parameter and adjusts any callers.
Diffstat (limited to 'internal/gitaly/service/hook/testhelper_test.go')
-rw-r--r-- | internal/gitaly/service/hook/testhelper_test.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/internal/gitaly/service/hook/testhelper_test.go b/internal/gitaly/service/hook/testhelper_test.go index 0e5ac4381..d0934d5ee 100644 --- a/internal/gitaly/service/hook/testhelper_test.go +++ b/internal/gitaly/service/hook/testhelper_test.go @@ -32,14 +32,14 @@ func newHooksClient(t *testing.T, serverSocketPath string) (gitalypb.HookService return gitalypb.NewHookServiceClient(conn), conn } -func runHooksServer(t *testing.T, hooksCfg config.Hooks) (string, func()) { - return runHooksServerWithAPI(t, gitalyhook.GitlabAPIStub, hooksCfg) +func runHooksServer(t *testing.T, cfg config.Cfg) (string, func()) { + return runHooksServerWithAPI(t, gitalyhook.GitlabAPIStub, cfg) } -func runHooksServerWithAPI(t *testing.T, gitlabAPI gitalyhook.GitlabAPI, hooksCfg config.Hooks) (string, func()) { +func runHooksServerWithAPI(t *testing.T, gitlabAPI gitalyhook.GitlabAPI, cfg config.Cfg) (string, func()) { srv := testhelper.NewServer(t, nil, nil) - gitalypb.RegisterHookServiceServer(srv.GrpcServer(), NewServer(gitalyhook.NewManager(gitlabAPI, hooksCfg))) + gitalypb.RegisterHookServiceServer(srv.GrpcServer(), NewServer(gitalyhook.NewManager(gitlabAPI, cfg))) reflection.Register(srv.GrpcServer()) require.NoError(t, srv.Start()) |