Skip to content

Commit 5ccbfd2

Browse files
committed
start postgres before running the test
1 parent a39761f commit 5ccbfd2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

chaos_tests/chaos_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,14 @@ func TestMain(m *testing.M) {
6060
}
6161
testCLIPath = absPath
6262

63+
// Start postgres
64+
startPostgresCmd := exec.Command(cliPath, "postgres", "start")
65+
startOutput, startErr := startPostgresCmd.CombinedOutput()
66+
if startErr != nil {
67+
fmt.Fprintf(os.Stderr, "Failed to start postgres: %s\n", string(startOutput))
68+
os.Exit(1)
69+
}
70+
6371
// Run tests
6472
code := m.Run()
6573

0 commit comments

Comments
 (0)