-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Conversation
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 |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
2b40e05
to
780c18c
Compare
Ha, just stumbled across this: lampepfl/dotty-feature-requests#32. How prescient. |
Examples of this in action (near the bottom of each log):
Fixes #10787