Skip to content

Commit

Permalink
avoid errors
Browse files Browse the repository at this point in the history
  • Loading branch information
exekias committed Jan 12, 2024
1 parent c621d98 commit 3b3a08d
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions pkg/testutils/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,17 @@ func SharedTestMain(m *testing.M) {
os.Exit(1)
}

db, err := sql.Open("postgres", tConnStr)
if err != nil {
os.Exit(1)
}

// create handy role for tets
_, err = db.ExecContext(ctx, "CREATE ROLE pgroll")
if err != nil {
os.Exit(1)
}

exitCode := m.Run()

if err := ctr.Terminate(ctx); err != nil {
Expand Down Expand Up @@ -154,12 +165,6 @@ func WithMigratorInSchemaConnectionToContainerWithOptions(t *testing.T, schema s
}
})

// handy role for tets
_, err = db.ExecContext(ctx, "CREATE ROLE pgroll")
if err != nil {
t.Fatal(err)
}

st, err := state.New(ctx, connStr, "pgroll")
if err != nil {
t.Fatal(err)
Expand Down

0 comments on commit 3b3a08d

Please sign in to comment.