Skip to content

Commit

Permalink
fix: don't call os.Exit() on tests
Browse files Browse the repository at this point in the history
test fails anyway even with exit code 0
  • Loading branch information
adityathebe committed Dec 27, 2024
1 parent f8d901b commit 901238b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/setup/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ func findFileInPath(filename string, depth int) string {
func BeforeSuiteFn(args ...interface{}) context.Context {
ctx, err := SetupDB("test", args...)
if err != nil {
shutdown.ShutdownAndExit(1, fmt.Sprintf("failed to setup db: %v", err))
shutdown.Shutdown()
Expect(err).To(BeNil())
}

DefaultContext = ctx
Expand Down Expand Up @@ -252,7 +253,7 @@ func SetupDB(dbName string, args ...interface{}) (context.Context, error) {
}

func AfterSuiteFn() {
shutdown.ShutdownAndExit(0, "")
shutdown.Shutdown()
}

// NewDB creates a new database from an existing context, and
Expand Down

0 comments on commit 901238b

Please sign in to comment.