go2xunit icon indicating copy to clipboard operation
go2xunit copied to clipboard

Support printing a summary

Open ansel1 opened this issue 9 years ago • 3 comments

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).

ansel1 avatar Sep 16 '16 21:09 ansel1

Interesting idea. Some comments about it:

  1. Since you use tee all the original output is in test.out which you can grep for FAIL
  2. Since go2xunit prints to stdout by default (so it can be piped to other programs) it means the summary will make the output XML invalid
  3. We might print the report to stderr, but stderr is usually save to errors and some programs fail when there's some data in stderr

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

tebeka avatar Sep 17 '16 08:09 tebeka

  1. Yup, true. Might try that. 2 & 3. I was thinking it would only be a valid flag is used with -output

ansel1 avatar Sep 23 '16 19:09 ansel1

I rather keep go2xunit simple. Closing this one.

tebeka avatar Sep 24 '16 08:09 tebeka