Skip to content

Commit

Permalink
Merge branch 'main' into update-block-test
Browse files Browse the repository at this point in the history
  • Loading branch information
rianhughes committed Apr 12, 2024
2 parents b858597 + ec1e9e8 commit 8e71c19
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions account/account_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,14 @@ var (
func TestMain(m *testing.M) {
flag.StringVar(&testEnv, "env", "mock", "set the test environment")
flag.Parse()
if err := godotenv.Load(fmt.Sprintf(".env.%s", testEnv), ".env"); err != nil {
panic(fmt.Sprint("Failed to load env for ", testEnv))
if testEnv == "mock" {
return
}
base = os.Getenv("INTEGRATION_BASE")
if base == "" && testEnv != "mock" {
panic(fmt.Sprint("Failed to set INTEGRATION_BASE for ", testEnv))
if base == "" {
if err := godotenv.Load(fmt.Sprintf(".env.%s", testEnv)); err != nil {
panic(fmt.Sprintf("Failed to load .env.%s, err: %s", testEnv, err))
}
}
os.Exit(m.Run())
}
Expand Down

0 comments on commit 8e71c19

Please sign in to comment.