diff options
author | Will Chandler <wchandler@gitlab.com> | 2023-08-29 18:44:53 +0300 |
---|---|---|
committer | Will Chandler <wchandler@gitlab.com> | 2023-08-30 16:39:23 +0300 |
commit | 4eed7c1ce988552463a16fa118181cb2d8cb5e9e (patch) | |
tree | 88caf294701ead11200bc833f60b616b2f7a9961 /internal/cgroups | |
parent | 8148ba7c49b07175592cc61f0c5ae33613985a1e (diff) |
Move TestMain into testhelper_test.go
Our style guide states that the `TestMain` function should be placed in
a file named `testhelper_test.go` for consistency's sake. A number of
packages were placing the test in a standard test file.
In cases where `TestMain` was the only function in that file rename it
to `testhelper_test.go`. If there were other functions, relocate
`TestMain` into a new `testhelper_test.go` file.
Diffstat (limited to 'internal/cgroups')
-rw-r--r-- | internal/cgroups/cgroups_linux_test.go | 4 | ||||
-rw-r--r-- | internal/cgroups/testhelper_test.go | 13 |
2 files changed, 13 insertions, 4 deletions
diff --git a/internal/cgroups/cgroups_linux_test.go b/internal/cgroups/cgroups_linux_test.go index 028d4bcd7..9abcf8cb4 100644 --- a/internal/cgroups/cgroups_linux_test.go +++ b/internal/cgroups/cgroups_linux_test.go @@ -10,10 +10,6 @@ import ( "gitlab.com/gitlab-org/gitaly/v16/internal/testhelper" ) -func TestMain(m *testing.M) { - testhelper.Run(m) -} - func TestNewManager(t *testing.T) { require.IsType(t, &NoopManager{}, NewManager(cgroups.Config{}, testhelper.NewDiscardingLogEntry(t), 1)) } diff --git a/internal/cgroups/testhelper_test.go b/internal/cgroups/testhelper_test.go new file mode 100644 index 000000000..5f594195a --- /dev/null +++ b/internal/cgroups/testhelper_test.go @@ -0,0 +1,13 @@ +//go:build linux + +package cgroups + +import ( + "testing" + + "gitlab.com/gitlab-org/gitaly/v16/internal/testhelper" +) + +func TestMain(m *testing.M) { + testhelper.Run(m) +} |