Skip to content

Commit

Permalink
fix: sporadically failing RLS test
Browse files Browse the repository at this point in the history
The entire test suite is ran with RLS enabled.
One of the tests (migration dependency test) ran the migration that disabled
RLS.
  • Loading branch information
adityathebe committed Jan 7, 2025
1 parent 0554747 commit 6e026dc
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tests/migration_dependency_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,22 @@ import (
"github.com/flanksource/duty/migrate"
)

var _ = Describe("migration dependency", Ordered, func() {
var _ = Describe("migration dependency", Ordered, Serial, func() {
var connString string

BeforeAll(func() {
connString = DefaultContext.Value("db_url").(string)
})

AfterAll(func() {
sqlDB, err := DefaultContext.DB().DB()
Expect(err).To(BeNil())

// we re-enable RLS
err = migrate.RunMigrations(sqlDB, api.Config{ConnectionString: connString, EnableRLS: true})
Expect(err).To(BeNil())
})

It("should have no executable scripts", func() {
db, err := DefaultContext.DB().DB()
Expect(err).To(BeNil())
Expand Down

0 comments on commit 6e026dc

Please sign in to comment.