mirror of
https://gitcode.com/gitea/gitea.git
synced 2025-06-05 12:06:41 +08:00
Fix "data race" in testlogger (#9159)
* Fix data race in testlogger * Update git_helper_for_declarative_test.go
This commit is contained in:
@ -173,19 +173,20 @@ func initIntegrationTest() {
|
||||
routers.GlobalInit()
|
||||
}
|
||||
|
||||
func prepareTestEnv(t testing.TB, skip ...int) {
|
||||
func prepareTestEnv(t testing.TB, skip ...int) func() {
|
||||
t.Helper()
|
||||
ourSkip := 2
|
||||
if len(skip) > 0 {
|
||||
ourSkip += skip[0]
|
||||
}
|
||||
PrintCurrentTest(t, ourSkip)
|
||||
deferFn := PrintCurrentTest(t, ourSkip)
|
||||
assert.NoError(t, models.LoadFixtures())
|
||||
assert.NoError(t, os.RemoveAll(setting.RepoRootPath))
|
||||
assert.NoError(t, os.RemoveAll(models.LocalCopyPath()))
|
||||
|
||||
assert.NoError(t, com.CopyDir(path.Join(filepath.Dir(setting.AppPath), "integrations/gitea-repositories-meta"),
|
||||
setting.RepoRootPath))
|
||||
return deferFn
|
||||
}
|
||||
|
||||
type TestSession struct {
|
||||
|
Reference in New Issue
Block a user