mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
This reverts commit 8b125d6c5d.
This commit is contained in:
@@ -13,16 +13,12 @@ import (
|
||||
"github.com/coder/coder/coderd/database/postgres"
|
||||
)
|
||||
|
||||
func UsingRealDatabase() bool {
|
||||
return os.Getenv("DB") != ""
|
||||
}
|
||||
|
||||
func NewDB(t *testing.T) (database.Store, database.Pubsub) {
|
||||
t.Helper()
|
||||
|
||||
db := dbfake.New()
|
||||
pubsub := database.NewPubsubInMemory()
|
||||
if UsingRealDatabase() {
|
||||
if os.Getenv("DB") != "" {
|
||||
connectionURL := os.Getenv("CODER_PG_CONNECTION_URL")
|
||||
if connectionURL == "" {
|
||||
var (
|
||||
|
||||
Reference in New Issue
Block a user