Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mitigate test2json bug causing missing test output #102

Merged
merged 3 commits into from
Apr 21, 2020

Conversation

dnephin
Copy link
Member

@dnephin dnephin commented Apr 19, 2020

See golang/go#29755, which may be fixed by golang/go#34419 if that is merged. Even if that fix makes it into go1.15 there will be plenty of projects still running earlier versions of Go, so a workaround may be useful for another year or more.

Related to #64, #66

If a test fails, and there is no test output (other than framing), then print all the test output for the entire test case.

This won't fix the issue if the test which failed had some output, but well behaved tests generally shouldn't non-failure message output, so hopefully this case is rare.

@dnephin
Copy link
Member Author

dnephin commented Apr 19, 2020

The problem with this workaround is that any failed subtest will cause the root test to print all the output for all subtests in the summary.

I think it's going to require another check for the root test case to only add the extra files if none of the subtests have failed.

@dnephin dnephin changed the title Workaround test2json bug causing missing test output mitigate test2json bug causing missing test output Apr 20, 2020
@dnephin
Copy link
Member Author

dnephin commented Apr 20, 2020

I think I have resolved the above issue by including the changes from #104 and adding a subTestFailed field to TestCase.

Previously the summary would filter out all messages which include
a '--- FAIL' or '--- SKIP'. With this change only the framing
message for the test case will be removed.

This change is in preparation for working around the test2json
output misattribution bug, which will result in the summary
including the output for all subtests in some cases.

After that bug is fixed, and the workaround is removed, it may still
be valuable to be more strict about this filtering.
See golang/go#29755.

If a test fails, and there is no test output (other than framing), then
print all the test output for the entire test case.

This won't fix the issue if the test which failed had some output, but
well behaved tests generally shouldn't non-failure message output, so
hopefully this case is rare.
@dnephin dnephin merged commit 32e482f into gotestyourself:master Apr 21, 2020
@dnephin dnephin deleted the print-missing-output branch April 21, 2020 01:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant