Skip to content
This repository has been archived by the owner on Jan 10, 2022. It is now read-only.

Commit

Permalink
minor fixes in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeyglazyrindev committed Nov 8, 2021
1 parent a58e3ed commit 40adefb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,12 @@ func RunTests(t *testing.T, currentsuite suite.TestingSuite) {
uadminDatabase := core.NewUadminDatabase()
uadminDatabase.Adapter.SetTimeZone(uadminDatabase.Db, "UTC")
core.UadminTestDatabase = uadminDatabase
upCommand := MigrateCommand{}
upCommand.Proceed("up", make([]string, 0))
reflect.ValueOf(currentsuite).MethodByName("StoreDatabase").Call([]reflect.Value{reflect.ValueOf(uadminDatabase)})
if setupTestSuite, ok := currentsuite.(suite.SetupTestSuite); ok {
setupTestSuite.SetupTest()
}
upCommand := MigrateCommand{}
upCommand.Proceed("up", make([]string, 0))
if beforeTestSuite, ok := currentsuite.(suite.BeforeTest); ok {
beforeTestSuite.BeforeTest(methodFinder.Elem().Name(), method.Name)
}
Expand Down Expand Up @@ -197,6 +197,9 @@ func RunTests(t *testing.T, currentsuite suite.TestingSuite) {
core.UadminTestDatabase = uadminDatabase
uadminDatabase.Adapter.SetIsolationLevelForTests(uadminDatabase.Db)
uadminDatabase.Adapter.SetTimeZone(uadminDatabase.Db, "UTC")
if setupTestSuite, ok := currentsuite.(suite.SetupTestSuite); ok {
setupTestSuite.SetupTest()
}
upCommand := MigrateCommand{}
upCommand.Proceed("up", make([]string, 0))
uadminDatabase.Db.Transaction(func(tx *gorm.DB) error {
Expand Down

0 comments on commit 40adefb

Please sign in to comment.