diff options
author | zeripath <art27@cantab.net> | 2019-11-25 23:21:37 +0000 |
---|---|---|
committer | Lauris BH <lauris@nix.lv> | 2019-11-26 01:21:37 +0200 |
commit | 055f6d229672524e3933940f95aa28939d94961a (patch) | |
tree | 72d1d427ce694517b70b6b751e35fdf6d5874428 /integrations/migration-test | |
parent | f5bd0884d2adea8ef7ba1bbd9dacb240d7c6b0f7 (diff) | |
download | gitea-055f6d229672524e3933940f95aa28939d94961a.tar.gz gitea-055f6d229672524e3933940f95aa28939d94961a.zip |
Fix "data race" in testlogger (#9159)
* Fix data race in testlogger
* Update git_helper_for_declarative_test.go
Diffstat (limited to 'integrations/migration-test')
-rw-r--r-- | integrations/migration-test/migration_test.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/integrations/migration-test/migration_test.go b/integrations/migration-test/migration_test.go index 8dc366dc3f..4fe36dc021 100644 --- a/integrations/migration-test/migration_test.go +++ b/integrations/migration-test/migration_test.go @@ -29,8 +29,8 @@ import ( var currentEngine *xorm.Engine -func initMigrationTest(t *testing.T) { - integrations.PrintCurrentTest(t, 2) +func initMigrationTest(t *testing.T) func() { + deferFn := integrations.PrintCurrentTest(t, 2) giteaRoot := base.SetupGiteaRoot() if giteaRoot == "" { integrations.Printf("Environment variable $GITEA_ROOT not set\n") @@ -56,6 +56,7 @@ func initMigrationTest(t *testing.T) { setting.CheckLFSVersion() setting.InitDBConfig() setting.NewLogServices(true) + return deferFn } func availableVersions() ([]string, error) { @@ -209,7 +210,7 @@ func wrappedMigrate(x *xorm.Engine) error { } func doMigrationTest(t *testing.T, version string) { - integrations.PrintCurrentTest(t) + defer integrations.PrintCurrentTest(t)() integrations.Printf("Performing migration test for %s version: %s\n", setting.Database.Type, version) if !restoreOldDB(t, version) { return @@ -225,7 +226,7 @@ func doMigrationTest(t *testing.T, version string) { } func TestMigrations(t *testing.T) { - initMigrationTest(t) + defer initMigrationTest(t)() dialect := setting.Database.Type versions, err := availableVersions() |