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

Surefire 1614 #209

Merged
merged 1 commit into from
Dec 14, 2018
Merged

Surefire 1614 #209

merged 1 commit into from
Dec 14, 2018

Conversation

sormuras
Copy link
Contributor

Capture system stream earlier to prevent its corruption.

Copy link
Contributor

@eolivelli eolivelli left a 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();
Copy link
Contributor

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?

Copy link
Contributor Author

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?

Copy link
Contributor

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.

Copy link
Contributor

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();
Copy link
Contributor

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?

Copy link
Contributor

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.

Copy link
Contributor

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 {
Copy link
Contributor

@Tibor17 Tibor17 Dec 12, 2018

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.

Copy link
Contributor

@eolivelli eolivelli Dec 13, 2018

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

Copy link
Contributor Author

@sormuras sormuras Dec 13, 2018

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.

Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well (...) never mind.

Copy link
Contributor

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!

Copy link
Contributor Author

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

?

Copy link
Contributor

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?

@Tibor17
Copy link
Contributor

Tibor17 commented Dec 13, 2018

@sormuras
Pls make me committer in your PR and I will finish the code style and squash it. Thx.

@sormuras
Copy link
Contributor Author

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
@asfgit asfgit merged commit f517d34 into master Dec 14, 2018
@asfgit asfgit deleted the SUREFIRE-1614 branch December 14, 2018 22:43
@marcphilipp
Copy link
Contributor

@Tibor17 What version is this going to be released in?

@Tibor17
Copy link
Contributor

Tibor17 commented Dec 15, 2018

@marcphilipp The version is 3.0.0-M3. It does not make sense to wait for final version. The version is stable enough for JUnit5 project and the issue like this which print an annoying Warning do not break the build because it's a warning. We of course missed out the features display name and logs isolation in parallel execution because we do not have resources to complete it. We have got one more committer these days, so I hope that he helps us a bit.

@marcphilipp
Copy link
Contributor

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?

@Tibor17
Copy link
Contributor

Tibor17 commented Dec 15, 2018

@marcphilipp
This was explained few times already.
These release candidates are stable and there is no risk to use them by Spring.
There should not be fear that it is 50% of functionality. The plugins contain everything as before.
It is a set of three plugins which are related to Maven API 3.0 which was completed in M1 and the next work was split in several release candidates.
The version 3.0 is a big chance to make such a change which cannot be done in maintenance of 2.x.
The roadmap is on the frontpage and the final release will remove deprecated configuration parameters but I do not think that it is a problem for users to change POM. Meanwhile we will change internal API and impl and since some teams rely on the API it cannot be done after 3.0. I hope this explained all.

@Tibor17
Copy link
Contributor

Tibor17 commented Dec 15, 2018

@marcphilipp
Copy link
Contributor

Thanks for sharing the link to the roadmap! Since an M typically stands for "milestone" and not "release candidate", it wasn't clear to me that you consider these ready for production use. If they are indeed stable, why not make them official releases?

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)).

@Tibor17
Copy link
Contributor

Tibor17 commented Dec 15, 2018

@marcphilipp
I told you again why. If I could I would already do it.

the issue fixed by this PR is one of the main blockers for Spring Boot's

yes, and there will be 3.0.0-M3 for this PR. But this is not a bug in this PR. It is only a removal of warning which does not affect behavior. If somebody is talking about corrupted stream, it is usually caused by e.g. Karaf and Arquillian which use or used STDOUT and STDIN streams and broke Surefire's communication channel. Our plan is to break the compatibility and change the way how two JVMs communicate. Therefore it can be done on the change from last version 2.x (2.22.1) to 3.x. But because there is so much work like this change and more, one release candidate is not enough to cut.
For normal users it represents no change of course. For those who maybe have their own Providers it would be a disaster to change something like that between 3.0 and 3.1 let's say. Therefore everything has to be done in 3.0 and these milestones of work from the backlog.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants