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:28:28 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2020-11-17 10:07:45 +0300
commit3d2d90b0b58d9fea04f26eee3ca402e5fdb919f7 (patch)
tree91877812d33c18edf5ce8c389ca9640bf069618c /internal/git2go
parente8fb9cd8975f62ab91dd015c8eafaf98b71c8067 (diff)
tests: Unify test setup
There's been some proliferation in our test's main functions. Naturally enough, this causes some of them to not work correctly, e.g. because they use `defer` in the `TestMain` function, which is not getting executed if `os.Exit` is called. Unify existing setup functions to follow the same pattern, which is that `TestMain()` calls out to `testMain()`.
Diffstat (limited to 'internal/git2go')
-rw-r--r--internal/git2go/commit_test.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/internal/git2go/commit_test.go b/internal/git2go/commit_test.go
index 6a1eea7a0..7bba3aa31 100644
--- a/internal/git2go/commit_test.go
+++ b/internal/git2go/commit_test.go
@@ -19,9 +19,14 @@ import (
)
func TestMain(m *testing.M) {
+ os.Exit(testMain(m))
+}
+
+func testMain(m *testing.M) int {
+ defer testhelper.MustHaveNoChildProcess()
testhelper.Configure()
testhelper.ConfigureGitalyGit2Go()
- os.Exit(m.Run())
+ return m.Run()
}
type commit struct {