diff --git a/backend/db/db_test.go b/backend/db/db_test.go index 7f74c8f..30eab86 100644 --- a/backend/db/db_test.go +++ b/backend/db/db_test.go @@ -12,9 +12,13 @@ import ( ) func resetEnv() { + host := "localhost" + if h := os.Getenv("TEST_DB_HOST"); h != "" { + host = h + } os.Setenv("POSTGRES_USER", "myuser") os.Setenv("POSTGRES_PASSWORD", "mypassword") - os.Setenv("POSTGRES_HOST", "localhost") + os.Setenv("POSTGRES_HOST", host) os.Setenv("POSTGRES_DB", "crussell_test_db") }