testing.go: use COMMENTO_POSTGRES if set
This commit is contained in:
parent
3252c30dd9
commit
73647421fb
@ -61,7 +61,12 @@ func dropTables() error {
|
||||
}
|
||||
|
||||
func setupTestDatabase() error {
|
||||
if os.Getenv("COMMENTO_POSTGRES") != "" {
|
||||
// set it manually because we need to use commento_test, not commento, by mistake
|
||||
os.Setenv("POSTGRES", os.Getenv("COMMENTO_POSTGRES"))
|
||||
} else {
|
||||
os.Setenv("POSTGRES", "postgres://postgres:postgres@0.0.0.0/commento_test?sslmode=disable")
|
||||
}
|
||||
|
||||
if err := connectDB(); err != nil {
|
||||
return err
|
||||
|
Loading…
Reference in New Issue
Block a user