From 95eb302d265f1f4c987a5d392092b262dde1afae Mon Sep 17 00:00:00 2001 From: Jan Bader Date: Tue, 5 Apr 2022 19:56:35 +0000 Subject: [PATCH] Build real connection before using txdb --- server/main_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/main_test.go b/server/main_test.go index 8d6da44..de190b7 100644 --- a/server/main_test.go +++ b/server/main_test.go @@ -25,6 +25,10 @@ func TestMain(t *testing.T) { SessionSecret: "random string for JWT authorization", } + _, err := postgres.Connect("pgx", cfg.DatabaseConnection) + if err != nil { + log.Fatalf("Failed connecting to DB: %v", err) + } queries, err := postgres.Connect("pgtx", cfg.DatabaseConnection) if err != nil { log.Fatalf("Failed connecting to DB: %v", err)