jstemmer / go-junit-report

Convert Go test output to JUnit XML
MIT License
776 stars 224 forks source link

Packages that panic/fail before running any test are not reported #52

Closed devnev closed 7 years ago

devnev commented 7 years ago

If a package has tests but fails in an init(), the package in the report has no indication of this failure.

In case of a panic in an init(), the output will look like:

panic: the description of the panic here

goroutine 1 [running]:
panic(....)
   /usr/local/go/src/runtime/panic.go:500....
...more stack frames...
...more goroutines...
FAIL  package/name 0.01s
rmmh commented 7 years ago

Can you link to an example full output text, perhaps on https://gist.github.com?

devnev commented 7 years ago

https://gist.github.com/devnev/874da08d59c26d9e33a82fd13acd15d2

jstemmer commented 7 years ago

Thanks for the example, this was indeed not captured and reported. It looks like another failure on the package level (similar to a build failure), but there's nothing preceding it that would indicate what package it belongs to so we'll have to buffer the output until we encounter a package result. Would #53 work for your case?

devnev commented 7 years ago

LGTM.