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

Fix #10787: List failed projects at community build test completion #10794

Merged
merged 1 commit into from
Dec 15, 2020

Conversation

griggt
Copy link
Contributor

@griggt griggt commented Dec 15, 2020

public void testRunFinished(Result result) throws Exception {
super.testRunFinished(result);
if (result.getFailureCount() > 0) {
Thread.sleep(500); // pause to give sbt log buffers some time to flush
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that still needed if you output with System.out instead of System.err ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was seeing interspersed and/or too early output without it, no matter which file handle I chose. It's a bit hacky, but I don't think there's a way here to route the output via the sbt logger?

sbt/junit-interface has some functionality in current master (option --summary=2) that might also work to solve this issue, but there doesn't seem to have been a release since 0.11 over 6 years ago.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, I think we should try to push for a new release of junit-interface.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sbt/junit-interface#94. Meanwhile this PR is already a great improvement even if we have to rely on some hacks so I'd be happy to get it in.
Another approach we might to explore would be using the github annotation API to get info from failed tests reported back in the github UI, there's some github actions to do this based on the XML reports that JUnit generates but I haven't tried them: https://github.com/marketplace/actions/junit-report-to-annotations, https://github.com/marketplace/actions/junit-report

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The annotation API is an interesting avenue for exploration; I'll take a look and see how we might make use of it, not just in regards to the community build but for all the JUnit tests. But that will likely take time and experimentation and this PR provides a quick (albeit hacky) fix in the interim.

@griggt griggt marked this pull request as ready for review December 15, 2020 02:16
@griggt griggt requested a review from smarter December 15, 2020 02:24
@griggt
Copy link
Contributor Author

griggt commented Dec 15, 2020

Ha, just stumbled across this: lampepfl/dotty-feature-requests#32. How prescient.

@smarter smarter merged commit c4b1e36 into scala:master Dec 15, 2020
@griggt griggt deleted the cb-failure-summary branch December 15, 2020 18:00
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.

Community Build test should say which tests failed
2 participants