gotestyourself / gotestsum

'go test' runner with output optimized for humans, JUnit XML for CI integration, and a summary of the test results.
Apache License 2.0
2.03k stars 119 forks source link

Don't treat debug messages as errors #336

Closed Pawka closed 1 year ago

Pawka commented 1 year ago

Teaching gotestsum to recognize Golang cache debug output. When gocachehash=1 or gocachetest=1 debug options are enabled, output is sent to stderr. gotestum treats unrecognised stderr messages as errors what makes test suite run marked as failed.

Example of testing gotestsum repository without this PR. Each debug info line is treated as error:

$ GODEBUG=gocachehash=1,gocachetest=1 ./gotestsum
...
DONE 183 tests, 2 skipped, 13819 errors in 0.726s

After fixing the issue:

$ GODEBUG=gocachehash=1,gocachetest=1 ./gotestsum
...
DONE 183 tests, 2 skipped in 0.523s
Pawka commented 1 year ago

Thanks for merge! Sorry for not picking this up earlier - I was a bit distracted other things (summer, etc.).