diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2020-12-15 13:36:36 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2020-12-17 19:22:21 +0300 |
commit | 0d44b47383db235885c80429324ee91cf6da2be8 (patch) | |
tree | 40f1ead60688564d660f91d53968e15419225d10 | |
parent | 3f401b56f81a6dab4adfe6c13b2283b26620ed18 (diff) |
smarthttp: Remove useless hookdir overrides
The smarthttp tests set up several overrides for the hook directory,
which can be helpful to execute a different set of hook binaries which
the caller supplies. In some cases, we set it to the empty value or to
the path of the `ruby/git-hooks` directory. Those aren't required at all
as the empty value is the default, and if the default is in place then
we'll figure out the `ruby/git-hooks` directory on our own.
Remove those overrides to clean up the tests.
-rw-r--r-- | internal/gitaly/service/smarthttp/receive_pack_test.go | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/internal/gitaly/service/smarthttp/receive_pack_test.go b/internal/gitaly/service/smarthttp/receive_pack_test.go index f07249886..740749114 100644 --- a/internal/gitaly/service/smarthttp/receive_pack_test.go +++ b/internal/gitaly/service/smarthttp/receive_pack_test.go @@ -394,11 +394,6 @@ func TestPostReceivePackToHooks(t *testing.T) { }(config.Config) config.Config.GitlabShell.Dir = tempGitlabShellDir - defer func(override string) { - hooks.Override = override - }(hooks.Override) - hooks.Override = "" - repo, testRepoPath, cleanup := testhelper.NewTestRepo(t) defer cleanup() @@ -427,11 +422,6 @@ func TestPostReceivePackToHooks(t *testing.T) { config.Config.Gitlab.URL = serverURL config.Config.Gitlab.SecretFile = filepath.Join(tempGitlabShellDir, ".gitlab_shell_secret") - cwd, err := os.Getwd() - require.NoError(t, err) - hookDir := filepath.Join(cwd, "../../../../ruby", "git-hooks") - hooks.Override = hookDir - stream, err := client.PostReceivePack(ctx) require.NoError(t, err) @@ -483,11 +473,6 @@ func testPostReceiveWithTransactionsViaPraefect(t *testing.T, ctx context.Contex config.Config = cfg }(config.Config) - defer func(override string) { - hooks.Override = override - }(hooks.Override) - hooks.Override = "" - secretToken := "secret token" glID := "key-1234" glRepository := "some_repo" @@ -592,11 +577,6 @@ func TestPostReceiveWithReferenceTransactionHook(t *testing.T) { config.Config.Gitlab.SecretFile = filepath.Join(gitlabShellDir, ".gitlab_shell_secret") testhelper.WriteShellSecretFile(t, gitlabShellDir, "secret123") - defer func(override string) { - hooks.Override = override - }(hooks.Override) - hooks.Override = "" - refTransactionServer.called = 0 client, conn := newSmartHTTPClient(t, "unix://"+gitalySocketPath) |