Skip to content

Commit d9b7c8e

Browse files
refactor: some minor tweaks
* add new line when printing * inline `runTestSuite` logic Signed-off-by: Blake Pettersson <[email protected]>
1 parent 9d601cc commit d9b7c8e

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

internal/testhelpers/suite.go

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ func TestMain(m *testing.M) {
2525
envDefaultValue("ARGOCD_VERSION", "v3.0.0")
2626

2727
if os.Getenv("USE_TESTCONTAINERS") == "true" {
28-
SetupTestSuite(m)
28+
os.Exit(runTestSuite(m))
2929
} else {
3030
os.Exit(m.Run())
3131
}
3232
}
3333

3434
func envDefaultValue(envvar, defaultValue string) {
3535
if v := os.Getenv(envvar); v == "" {
36-
fmt.Printf("%s not set; using %s as default value", envvar, defaultValue)
36+
fmt.Printf("environment variable %s not set; using %s as default value\n", envvar, defaultValue)
3737
_ = os.Setenv(envvar, defaultValue)
3838
}
3939
}
@@ -43,12 +43,6 @@ const (
4343
DefaultTestTimeout = 15 * time.Minute
4444
)
4545

46-
// SetupTestSuite sets up a shared test environment for all acceptance tests
47-
func SetupTestSuite(m *testing.M) {
48-
code := runTestSuite(m)
49-
os.Exit(code)
50-
}
51-
5246
func runTestSuite(m *testing.M) int {
5347
ctx, cancel := context.WithTimeout(context.Background(), DefaultTestTimeout)
5448
defer cancel()

0 commit comments

Comments
 (0)