tebeka / go2xunit

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

Fix issue with tests ending with Fatal (without summary) #42

Closed tamird closed 7 years ago

tamird commented 7 years ago

This can trigger when tests terminate with log.Fatal or os.Exit.

This is an issue report in the form of a PR - currently this kind of failure results in nothing reported from go2xunit :(

@tebeka cc @jordanlewis @raduberinde (ccing because maybe we want to change our log.Fatal to panic at the end instead of os.Exit'ing).

tebeka commented 7 years ago

Thanks! Seems like you forgot to add the test file (this is why tests on travis fail) - can you add it?

tamird commented 7 years ago

Sure, I can add them, but I'd be guessing as to what they should look like - the bug here is that the result of parsing this input is actually empty.

tebeka commented 7 years ago

I don't understand. The test log says:

regression_test.go:47: can't read data/out/xunit/gotest-fatal-nosummary.out.xml - open data/out/xunit/gotest-fatal-nosummary.out.xml

You'll need to add this file (and same in data/out/xunit.net)

If it's an empty file, add an empty file.

tamird commented 7 years ago

@tebeka updated courtesy of @jordanlewis

tebeka commented 7 years ago

Thanks!