1
0
Fork 0
forked from forgejo/forgejo

fail test when log.Error is called

except for some specific messages (to make the test pass for now)
This commit is contained in:
oliverpool 2024-03-14 14:45:41 +01:00
parent af0bb6e68a
commit e43c6cd9df
5 changed files with 206 additions and 35 deletions

View file

@ -145,7 +145,10 @@ func TestMain(m *testing.M) {
// Instead, "No tests were found", last nonsense log is "According to the configuration, subsequent logs will not be printed to the console"
exitCode := m.Run()
testlogger.WriterCloser.Reset()
if err := testlogger.WriterCloser.Reset(); err != nil {
fmt.Printf("testlogger.WriterCloser.Reset: %v\n", err)
os.Exit(1)
}
if err = util.RemoveAll(setting.Indexer.IssuePath); err != nil {
fmt.Printf("util.RemoveAll: %v\n", err)