-
Notifications
You must be signed in to change notification settings - Fork 26
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
Remove shaded JUnit platform #82
Conversation
e058bc3
to
3d68697
Compare
This is not as straight forward as it first appears. Currently, if the junit-5 plugin is added as a dependency for pitest in a maven project, it will work without having to explicitly any other depencies to pitest (e.g jupiter). Without the shaded platform it will fail with a runtime error. Unfortunately, I can't remember the details of why jupiter gets picked up from the classpath automatically but platform doesn't. Would need some digging before this could be merged. |
3d68697
to
82ac4b0
Compare
Hm, ok, this sounds strange. |
No, I did test with Gradle and there it works perfectly fine. But by this you completely ignore the dependencies those plugins might need which is why you currently need to shade the platform launcher dependency which effectively is the only external dependency. Jupiter is found because it is part of the test classpath which is added to the Minion classpath completely. I see four (at least) possible ways to mitigate the need for the shading:
|
I took the approach 4: hcoles/pitest#1209 |
To function correctly with the SUT version of JUnit 5, the shading needs to be removed and the junit platform dependency needs to be changed to a provided dependency. The maven and gradle plugins then need to be updated to autoadd junit-platform-launcher in the same manner that surefire does. The maven part of this will be released in pitest 1.14.0. I'm not sure how easy/difficuly this will be for gradle, but the dependency can be added manually until the functionality is available. |
82ac4b0
to
dbc7a86
Compare
As discussed in szpak/gradle-pitest-plugin#337 I adapted the commit message and added a compatibility note to PIT 1.14.0 to the readme, so I guess this PR should now be fine for 1.2.0? |
It is present as dependency anyway and even if not it makes no sense to depend on
this module without platform being present already anywy and shading it without relocation easily leads to conflicts.