Don't keep running SetEngine in migration_test (#12860)

There's no need to keep repeatedly running SetEngine in migration_test,
as NewEngine calls it anyway.

Signed-off-by: Andrew Thornton <art27@cantab.net>
tokarchuk/v1.17
zeripath 4 years ago committed by GitHub
parent 81ed47c29d
commit 0d14c2fb93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      integrations/migration-test/migration_test.go

@ -252,16 +252,11 @@ func doMigrationTest(t *testing.T, version string) {
}
setting.NewXORMLogService(false)
err := models.SetEngine()
assert.NoError(t, err)
err = models.NewEngine(context.Background(), wrappedMigrate)
err := models.NewEngine(context.Background(), wrappedMigrate)
assert.NoError(t, err)
currentEngine.Close()
err = models.SetEngine()
assert.NoError(t, err)
beans, _ := models.NamesToBean()
err = models.NewEngine(context.Background(), func(x *xorm.Engine) error {
@ -272,9 +267,6 @@ func doMigrationTest(t *testing.T, version string) {
currentEngine.Close()
// We do this a second time to ensure that there is not a problem with retained indices
err = models.SetEngine()
assert.NoError(t, err)
err = models.NewEngine(context.Background(), func(x *xorm.Engine) error {
currentEngine = x
return migrations.RecreateTables(beans...)(x)

Loading…
Cancel
Save