Skip to content

Commit 866d3d9

Browse files
committed
fatal if returnsqldb and no postgres
1 parent 8abb2ae commit 866d3d9

File tree

1 file changed

+3
-0
lines changed
  • coderd/database/dbtestutil

1 file changed

+3
-0
lines changed

coderd/database/dbtestutil/db.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ func NewDB(t testing.TB, opts ...Option) (database.Store, pubsub.Pubsub) {
6363
for _, opt := range opts {
6464
opt(&o)
6565
}
66+
if o.returnSQLDB && !WillUsePostgres() {
67+
t.Fatalf("cannot use WithReturnSQLDB without PostgreSQL, consider adding `if !dbtestutil.WillUsePostgres() { t.Skip() }` to this test")
68+
}
6669

6770
db := dbfake.New()
6871
ps := pubsub.NewInMemory()

0 commit comments

Comments
 (0)