diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2020-11-12 16:34:30 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2020-11-17 10:07:45 +0300 |
commit | 8a1827994ee35afc7b49a62e714546b111711fb2 (patch) | |
tree | d12c77c2c2fccc19c2a5876606a87d28a5a941b2 /client | |
parent | 879806b1d636854b2bada4ef26109412aec019a5 (diff) |
testhelper: Move temporary Gitaly socket into global test directory
The function `testhelper.GetTemporaryGitalySocketFileName()` generates a
new filename which can then be used for the Gitaly socket. Currently,
it's always using `/tmp` as the directory where those sockets are
generated. As they typically don't get cleaned up after tests, it thus
clutters that directory quite quickly. This commit instead moves them
into the global temporary test directory.
Diffstat (limited to 'client')
-rw-r--r-- | client/client_test.go | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/client/client_test.go b/client/client_test.go new file mode 100644 index 000000000..d8433b65e --- /dev/null +++ b/client/client_test.go @@ -0,0 +1,19 @@ +package client + +import ( + "os" + "testing" + + "gitlab.com/gitlab-org/gitaly/internal/testhelper" +) + +func TestMain(m *testing.M) { + os.Exit(testMain(m)) +} + +func testMain(m *testing.M) int { + defer testhelper.MustHaveNoChildProcess() + cleanup := testhelper.Configure() + defer cleanup() + return m.Run() +} |