Support printing a summary
We use go2xunit on our teamcity server. We do something like:
go test -v | tee test.out
go2xunit -input test.out -output test.xml -fail
Works great, except that we have lots of tests, and with the -v flag, go test's output is very verbose. If a test fails, you need to open up the output or the xml file and search for the failure cases. Would be nice if go2xunit supported a flag to print out a summary of the failed test cases to stdout, something like out test runners in other languages print out a summary of results (n tests run, n succeeded, n failed, etc, the format varies by language and test framework).
Interesting idea. Some comments about it:
- Since you use
teeall the original output is intest.outwhich you can grep forFAIL - Since
go2xunitprints to stdout by default (so it can be piped to other programs) it means the summary will make the output XML invalid - We might print the report to
stderr, butstderris usually save to errors and some programs fail when there's some data instderr
I'll think on how to make this happen. But IMO the best approach will be to add a step and grep FAIL test.out
- Yup, true. Might try that. 2 & 3. I was thinking it would only be a valid flag is used with -output
I rather keep go2xunit simple. Closing this one.