mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: remove references to dbtestutil.WillUsePostgres (#20436)
Addresses https://github.com/coder/internal/issues/758. This PR only cleans up dead code, it makes no changes to test logic.
This commit is contained in:
@@ -23,13 +23,6 @@ import (
|
||||
"github.com/coder/coder/v2/testutil"
|
||||
)
|
||||
|
||||
// WillUsePostgres returns true if a call to NewDB() will return a real, postgres-backed Store and Pubsub.
|
||||
// TODO(hugodutka): since we removed the in-memory database, this is always true,
|
||||
// and we need to remove this function. https://github.com/coder/internal/issues/758
|
||||
func WillUsePostgres() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
type options struct {
|
||||
fixedTimezone string
|
||||
dumpOnFailure bool
|
||||
@@ -75,10 +68,6 @@ func withReturnSQLDB(f func(*sql.DB)) Option {
|
||||
func NewDBWithSQLDB(t testing.TB, opts ...Option) (database.Store, pubsub.Pubsub, *sql.DB) {
|
||||
t.Helper()
|
||||
|
||||
if !WillUsePostgres() {
|
||||
t.Fatal("cannot use NewDBWithSQLDB without PostgreSQL, consider adding `if !dbtestutil.WillUsePostgres() { t.Skip() }` to this test")
|
||||
}
|
||||
|
||||
var sqlDB *sql.DB
|
||||
opts = append(opts, withReturnSQLDB(func(db *sql.DB) {
|
||||
sqlDB = db
|
||||
|
||||
Reference in New Issue
Block a user