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

161: Fix JUnit 5 and Surefire issues. #169

Merged
merged 2 commits into from
Jan 27, 2019
Merged

161: Fix JUnit 5 and Surefire issues. #169

merged 2 commits into from
Jan 27, 2019

Conversation

michael-simons
Copy link
Contributor

@michael-simons michael-simons commented Jan 26, 2019

Surefire from version 2.22.0 brings its own JUnit 5 platform provider.
The previous setup was incomplete and missed the engine as dependency of
surefire.

Your test coverage was zero as no test has been run.

The fix was easy: Just use at least surefire 2.22.1 (will work on JDK
11, too) and remove all the manual declaration of JUnit 5 platform,
launcher and runner.

In addition I'd recommend here to get rid of JUnit 4 as well, so nobody
adds an old JUnit 4 test by coincidence.

Also bump JUnit to the most recent version.


This change is Reviewable

Surefire from version 2.22.0 brings its own JUnit 5 platform provider.
The previous setup was incomplete and missed the engine as dependency of
surefire.

Your test coverage was zero as no test has been run.

The fix was easy: Just use at least surefire 2.22.1 (will work on JDK
11, too) and remove all the manual declaration of JUnit 5 platform,
launcher and runner.

In addition I'd recommend here to get rid of JUnit 4 as well, so nobody
adds an old JUnit 4 test by coincidence.

Also bump JUnit to the most recent version.
@teobais
Copy link
Member

teobais commented Jan 26, 2019

Many thanks for this one, @michael-simons !

To begin with, a bit of background: the reason of keeping the junit-4-compatible-dependencies was to have a smooth migration to JUnit5 (end goal was to indeed get rid of them as well as the junit4 dependency - previously all of our tests were written in junit4).

On topic, what you mentioned sounds pretty cool (and I'll conduct some research while it builds). Unfortunately, though, I cannot test it locally, since I'm on a Mac and the issue only appeared on windows.

@keilw could you check this locally as well (irrespectively of Codacy's outcome)?

@michael-simons
Copy link
Contributor Author

I've added one more commit. I think it's better to specify the surefire plugin not in a profile but on main level. Otherwise tests will only run in base-jar profile.

@michael-simons
Copy link
Contributor Author

Builds with JDK 11 on Windows 7, actually without the changes as well.

I would guess that due to the fact that in the default profile no version of surefire is specified, Maven takes the latest one in it's default repo and that is by chance one on @keilw machine that doesn't include a version compatible with JUnit 5.

ohne titel

@keilw keilw merged commit 695fa05 into unitsofmeasurement:master Jan 27, 2019
@teobais teobais mentioned this pull request Jan 30, 2019
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

3 participants