diff options
Diffstat (limited to 'models/migrations/base/tests.go')
-rw-r--r-- | models/migrations/base/tests.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/models/migrations/base/tests.go b/models/migrations/base/tests.go index 08eded7fdc..dd99a1eda2 100644 --- a/models/migrations/base/tests.go +++ b/models/migrations/base/tests.go @@ -24,6 +24,8 @@ import ( "xorm.io/xorm" ) +// FIXME: this file shouldn't be in a normal package, it should only be compiled for tests + // PrepareTestEnv prepares the test environment and reset the database. The skip parameter should usually be 0. // Provide models to be sync'd with the database - in particular any models you expect fixtures to be loaded from. // @@ -110,7 +112,7 @@ func PrepareTestEnv(t *testing.T, skip int, syncModels ...interface{}) (*xorm.En } func MainTest(m *testing.M) { - log.Register("test", testlogger.NewTestLogger) + log.RegisterEventWriter("test", testlogger.NewTestLoggerWriter) giteaRoot := base.SetupGiteaRoot() if giteaRoot == "" { @@ -154,7 +156,7 @@ func MainTest(m *testing.M) { os.Exit(1) } setting.LoadDBSetting() - setting.InitLogs(true) + setting.InitLoggersForTest() exitStatus := m.Run() |