mirror of
https://github.com/coder/coder.git
synced 2025-07-03 16:13:58 +00:00
chore: improve postgres test time by removing cleanup (#7522)
We don't need to delete databases on cleanup... and we don't need to always run without a cache either!
This commit is contained in:
@ -46,13 +46,10 @@ func Open() (string, func(), error) {
|
||||
return "", nil, xerrors.Errorf("create db with template: %w", err)
|
||||
}
|
||||
|
||||
deleteDB := func() {
|
||||
ddb, _ := sql.Open("postgres", dbURL)
|
||||
defer ddb.Close()
|
||||
_, _ = ddb.Exec("DROP DATABASE " + dbName)
|
||||
}
|
||||
|
||||
return "postgres://postgres:postgres@127.0.0.1:5432/" + dbName + "?sslmode=disable", deleteDB, nil
|
||||
return "postgres://postgres:postgres@127.0.0.1:5432/" + dbName + "?sslmode=disable", func() {
|
||||
// We don't need to clean anything up here... it's just a database in a container,
|
||||
// so cleaning up the container will clean up the database.
|
||||
}, nil
|
||||
}
|
||||
|
||||
pool, err := dockertest.NewPool("")
|
||||
|
Reference in New Issue
Block a user