-
Notifications
You must be signed in to change notification settings - Fork 542
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
Surefire 1614 #209
Surefire 1614 #209
Conversation
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.
Looks good.
Cose is cleaner now
+1
} | ||
else | ||
{ | ||
throw new IllegalArgumentException( "Unexpected value of forkTestSet: " + forkTestSet ); | ||
} | ||
|
||
return reporterFactory.close(); |
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.
Why you do not call it in finally
block as before?
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.
Wouldn't it swallow the IllegalArgumentException
?
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.
It's not about exceptions. The factory has to be finally
closed. The code in close must be called always because the code make a 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.
@sormuras
Don't break the meaning and behavior of previous code. The close
is not your problem. The problem was with method scanClasspath
and not the close
method.
@@ -104,22 +104,29 @@ public JUnitPlatformProvider( ProviderParameters parameters ) | |||
public RunResult invoke( Object forkTestSet ) | |||
throws TestSetFailedException, ReporterException | |||
{ | |||
ReporterFactory reporterFactory = parameters.getReporterFactory(); |
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.
All this PR has the same call sequences as before.
I still do not see logical sense for this change because there is no change in call sequences.
What root cause you found?
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.
@sormuras
I found the root cause. It was caused by calling method scanClasspath()
before startCapture
.
Change your commit and use try-finally
in the method invoke
and use the code within finally
block as before.
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.
Good catch!
Know I understand the reason for that strange try/finally. Can we add a comment?
import org.junit.runners.model.InitializationError; | ||
import org.junit.runners.model.TestClass; | ||
|
||
public class CustomRunner extends BlockJUnit4ClassRunner { |
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.
Still not the ASF Maven style.
Why if you type it correctly in src/main/java
, this is another check style.
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.
So we are not running checkstyle on IT cases? Fair. But we can consider adding it.
For the future I mean
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 just copied the sample project files. Did not manually type a character here.
So we are not running checkstyle on IT cases? Fair. But we can consider adding it.
That'd be wonderful! As long as "mvn verify" exits with "0", I'm fine with the format.
Even better: have profile or task that applies the desired formatting automatically via spotless or other formatting tool. For all sources, be it src/main
, src/test
, or src/it
.
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.
If you use IDEA14 ad it is configured properly, just press CTRL+ALT+L and the files are adjusted to ASF style check.
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.
Well (...) never mind.
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.
@sormuras
You have to follow the code style and I guess you want to work in ASF. It's easy!
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.
All I'm saying is that when an almost 2 hour running build doesn't fail due to code formatting issues, everything's fine for me too.
[...] use IDEA14 ad it is configured properly [...]
There are tools that a) format and b) check for style violations. We should use them -- and not rely on personal IDEs, their proper configuration and hope that stars align. If such tools were used you even gain speed when reviewing PRs: a successful build means that all style checks passed. Yeah!
You have to follow the code style
Sure. Still I expect from properly setup projects to notify me about code style violations. A build should not even start to compile stuff when there are code style violations present.
I guess you want to work in ASF
?
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.
@sormuras
Again we have a written code style as rules in ASF Maven. This is still not clear? I am only saying that tools help you to adjust it faster. Otherwise you can do it by your hands but it will be more painful for you. Is it clear now?
@sormuras |
You're welcome. Just work on this branch: https://github.com/apache/maven-surefire/tree/SUREFIRE-1614 |
…ire's STDOUT when using JUnit's Vintage Engine
938d422
to
f517d34
Compare
@Tibor17 What version is this going to be released in? |
@marcphilipp The version is |
Well, projects like Spring Boot are waiting for an official release that includes this fix and they won't recommend using a milestone version to their users. Would it be possible to backport the fix to a 2.x release? |
@marcphilipp |
@marcphilipp |
Thanks for sharing the link to the roadmap! Since an I know from experience that it's hard to commit to dates when you mostly work on a project in your free time but is there a timeline for 3.0? I'm asking because the issue fixed by this PR is one of the main blockers for Spring Boot's adoption of JUnit 5 (see spring-projects/spring-boot#14736 (comment)). |
@marcphilipp
yes, and there will be |
Capture system stream earlier to prevent its corruption.