mirror of
https://gitlab.com/commento/commento.git
synced 2025-06-30 11:06:37 -04:00
testing.go: use COMMENTO_POSTGRES if set
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user