tebeka / go2xunit

Convert "go test" output to xunit compatible (used in Jenkins/Hudson)
MIT License
162 stars 46 forks source link

Support gotest runners (like bazel) that don't print a per-suite summary #34

Closed benley closed 8 years ago

benley commented 8 years ago

Bazel's golang test runner uses the normal golang testing runner, but not the actual go test command. Thus, it doesn't include a final test summary line, and go2xunit wasn't able to parse the output without this tweak. Since the xml output would normally end up with a blank name property in this scenario, I've added a -suite-name-prefix commandline option that could be used to supply the missing context.

For what it's worth, my first approach was adding a script wrapper around Bazel's test executions and leaving go2xunit unmodified. I did get that working, but it ended requiring a fairly gross hack. Adding these features to go2xunit was delightfully simple in comparison.

tebeka commented 8 years ago

Thanks! Will look at it shortly.

tebeka commented 8 years ago

Can you please add an input example? (see data directory)

benley commented 8 years ago

Yep! I'll add an example to data, probably tonight or tomorrow morning.