1
0
Fork 0
forked from forgejo/forgejo

[TESTS] prevent overriding testlogger when calling mainApp

(cherry picked from commit 5785ae72c7)
This commit is contained in:
oliverpool 2024-03-27 22:02:51 +01:00 committed by Earl Warren
parent c01935e9d0
commit 966faddee4
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
5 changed files with 75 additions and 63 deletions

View file

@ -128,6 +128,11 @@ func (w *testLoggerWriterCloser) recordError(msg string) {
err = w.errs[len(w.errs)-1]
}
if len(w.t) > 0 {
// format error message to easily add it to the ignore list
msg = fmt.Sprintf("// %s\n\t`%s`,", w.t[len(w.t)-1].Name(), msg)
}
err = errors.Join(err, errors.New(msg))
if len(w.errs) > 0 {