2019-10-18 20:03:10 +01:00
|
|
|
// Copyright (C) 2019 Storj Labs, Inc.
|
|
|
|
// See LICENSE for copying information.
|
|
|
|
|
|
|
|
package satellitedbtest
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/zeebo/errs"
|
|
|
|
|
2019-11-14 19:46:15 +00:00
|
|
|
"storj.io/storj/private/dbutil/pgutil/pgtest"
|
2019-10-18 20:03:10 +01:00
|
|
|
)
|
|
|
|
|
2019-11-11 15:05:21 +00:00
|
|
|
// PostgresDefined returns an error when the --postgres-test-db or STORJ_POSTGRES_TEST is not set for tests.
|
|
|
|
func PostgresDefined() error {
|
|
|
|
if *pgtest.ConnStr == "" {
|
|
|
|
return errs.New("flag --postgres-test-db or environment variable STORJ_POSTGRES_TEST not defined for PostgreSQL test database")
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|