fix: tests
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
a92741f802
commit
8f516e74e9
|
@ -20,8 +20,7 @@ const (
|
|||
)
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
goose.SetBaseFS(os.DirFS("../../migrations"))
|
||||
goose.SetLogger(goose.NopLogger())
|
||||
setUpGoose()
|
||||
|
||||
_, isDBDSNPresent := os.LookupEnv(envDBDSN)
|
||||
_, isRedisConnectionStringPresent := os.LookupEnv(envRedisConnectionString)
|
||||
|
@ -64,6 +63,14 @@ func TestMain(m *testing.M) {
|
|||
os.Exit(code)
|
||||
}
|
||||
|
||||
func setUpGoose() {
|
||||
goose.SetBaseFS(os.DirFS("../../migrations"))
|
||||
goose.SetLogger(goose.NopLogger())
|
||||
if err := goose.SetDialect("postgres"); err != nil {
|
||||
log.Fatalf("goose - couldn't set dialect: %s", err)
|
||||
}
|
||||
}
|
||||
|
||||
func newPostgres(pool *dockertest.Pool) (*dockertest.Resource, *url.URL) {
|
||||
q := url.Values{}
|
||||
q.Add("sslmode", "disable")
|
||||
|
|
|
@ -52,7 +52,7 @@ func newBunDB(tb testing.TB) *bun.DB {
|
|||
func runMigrations(tb testing.TB, db *sql.DB) {
|
||||
tb.Helper()
|
||||
|
||||
require.NoError(tb, goose.Up(db, ""))
|
||||
require.NoError(tb, goose.Up(db, "."))
|
||||
}
|
||||
|
||||
type bunfixture struct {
|
||||
|
|
Loading…
Reference in New Issue