introduce back go-junit-report for parsing go test output #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Stacked on please-build#81
The test output from
go_test
is currently quite hard to read and also can be inaccurate.For example, given this test file:
we get the following output:
There are 4 assertions which fail, however 8 assertion failures are shown. All 4 expected assertions are output under
Standard error
header and then an assertion failure is also output for each failing test / subtest. However, the assertion failures under eachFailure: in XXX
header are not the correct failures. Instead, the failure fromTest/Subtest2
is output each time.I can see that
go-junit-report
v0.9.0
(technically a couple of commits after this tag) was introduced to the Please repo in 2020 and then reverted due to it not being able to handle more complex input (thought-machine/please#995). This PR introduces it back, now that the tool seems to have matured a bit. Betweenv0.9.0
andv2.0.0
, 81 test cases have been added and it seems to pass the eye test on the above test file:Now, only 4 assertion failures are output and each one is under the correct
Failure: in XXX
heading.The version that i've added to this repo is my fork where i've set the message attribute of the
<skipped>
node correctly so that the reason is output correctly by Please (without this change, the skipped test output looks likeReason: Skipped
vsReason: external_test.go:32: Failing on Alpine currently
). I've made a PR to upstream this: jstemmer/go-junit-report#158.I'm happy to throw any other test files you can think of at
go-junit-report
to make sure it handles them properly 🙏