Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Steinhardt <psteinhardt@gitlab.com>2020-11-12 15:09:36 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2020-11-17 10:07:45 +0300
commit169ca21e6d52d6e6548a6d8e51d11021fff6a246 (patch)
treec330082a3f0374b9294a958c58daa115e375da70 /internal/helper/repo_test.go
parent3d2d90b0b58d9fea04f26eee3ca402e5fdb919f7 (diff)
testhelper: Have Configure() return cleanup function
During tests we're accumulating quite some global data, some of which is hard to clean up separately. As we don't have any shared global test directory in which we can put all generated test data, they're thus all over `/tmp` and never get cleaned up. As a result, after a few runs the temporary directory will be cluttered by thousands of files and directories generated by our test suite. This commit is a preparation for such a global unified test directory, which is going to be set up by `testhelper.Configure()`. In order to assure it'll get cleaned up, we add a (still empty) cleanup function and adjust all callers to invoke it. This function will at a later point be used to delete the temporary test directory.
Diffstat (limited to 'internal/helper/repo_test.go')
-rw-r--r--internal/helper/repo_test.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/internal/helper/repo_test.go b/internal/helper/repo_test.go
index 17e2496bf..9cd28c874 100644
--- a/internal/helper/repo_test.go
+++ b/internal/helper/repo_test.go
@@ -18,7 +18,8 @@ func TestMain(m *testing.M) {
func testMain(m *testing.M) int {
defer testhelper.MustHaveNoChildProcess()
- testhelper.Configure()
+ cleanup := testhelper.Configure()
+ defer cleanup()
return m.Run()
}