jstemmer / go-junit-report

Convert Go test output to JUnit XML
MIT License
764 stars 222 forks source link

Include test output and stdout in test failures #83

Closed liggitt closed 5 years ago

liggitt commented 5 years ago

Scraped test output from tests run with go1.11.1 was ending at the --- FAIL line, and was not including the actual error/info output

The existing code that assumes tab-prefixed indented output does not work with go1.11.1. This PR accumulates appropriately indented lines into the current test's output.

Adds a test with mixtures of single- and multi-line stdout and test output, with normal and subtests, based on running go test -v on https://gist.github.com/liggitt/09a021ccec988b19917e0c2d60a18ee9 with go1.11.1

liggitt commented 5 years ago

xref https://github.com/kubernetes/test-infra/issues/10539

dims commented 5 years ago

@jstemmer post holiday ping :) we need this for better capturing logs for some tricky bugs like this one

jstemmer commented 5 years ago

@dims thanks for the ping! Will take a look at all PR's within the next couple of days.

jhg03a commented 5 years ago

Tested this with my fork and it seems to fix my issues.

dims commented 5 years ago

Thanks for the confirmation @jhg03a

jstemmer commented 5 years ago

Looks great, thanks for fixing this!