Bump JUnit Platform to 6.0.3 for JUnit 6 unified versioning#114
Open
clara-deadline wants to merge 1 commit intopitest:masterfrom
Open
Bump JUnit Platform to 6.0.3 for JUnit 6 unified versioning#114clara-deadline wants to merge 1 commit intopitest:masterfrom
clara-deadline wants to merge 1 commit intopitest:masterfrom
Conversation
JUnit 6.0.0 shipped with unified versioning — all artifacts (Platform, Jupiter, Vintage) now share the same 6.0.x version number. What was previously junit-platform-engine:1.9.2 is now junit-platform-engine:6.0.3. Spring Boot 4.0.5 ships JUnit Platform 6.0.3 via its BOM. Projects on Spring Boot 4 cannot use the current pitest-junit5-plugin because the platform version mismatch causes the coverage analysis phase to find 0% coverage and run 0 tests per mutation (see issue pitest#113). Changes: - junit.platform.version: 1.9.2 -> 6.0.3 - junit.version: 5.9.2 -> 6.0.3 (unified versioning) - maven.compiler.source/target: 1.8 -> 17 (JUnit 6 requires Java 17+) The JUnit Platform Launcher API (Launcher, LauncherFactory, DiscoverySelectors, TestExecutionListener, etc.) used by this plugin is unchanged between Platform 1.9.2 and 6.0.3 — JUnit 6 is a re-versioning with cleanup, not a rewrite. Note: test dependencies (Cucumber 5.0.0, Spock 2.3) may need bumping to versions that support JUnit Platform 6.x. This PR focuses on the core compile-time change; test dep updates can follow. Fixes pitest#113
Contributor
|
Thanks for the PR. It looks like this PR may have been created using an LLM. Can you please confirm
Please also provide a link to a minimal project that demonstrates the problem. Thanks Henry |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
JUnit 6.0.0 shipped with unified versioning — all artifacts (Platform, Jupiter, Vintage) now share the same
6.0.xversion. Spring Boot 4.0.5 shipsjunit-platform-launcher:6.0.3via its BOM.Projects on Spring Boot 4 get 0% coverage and 0 tests per mutation because the plugin's shaded JUnit Platform classes (1.9.2) don't match the 6.0.3 runtime on the classpath.
Detailed reproduction in #113.
Changes
junit.platform.versionjunit.versionmaven.compiler.source/targetWhy this should work
The JUnit Platform Launcher API used by this plugin (
Launcher,LauncherFactory,DiscoverySelectors,TestExecutionListener,TestIdentifier,TagFilter,MethodSource, etc.) is unchanged between Platform 1.9.2 and 6.0.3. JUnit 6 is a re-versioning with cleanup (Java 17+ baseline, JSpecify annotations, removed JUnit 4 runner bridge), not a rewrite.The five source files in
src/main/java(386 total lines) compile cleanly against Platform 6.0.3 with zero source changes.Known gaps
Impact
This unblocks mutation testing for every project on Spring Boot 4+, which is the current GA release. Without this fix, PIT cannot be used with Spring Boot 4.
Fixes #113
Workaround for users waiting for this to merge
If you need pitest working now on Spring Boot 4 + JUnit 6, you can unblock yourself with three changes in your
build.gradle.kts:pitestconfiguration (launch classpath) so PIT sees the same JUnit Platform version as your test runtime.javaLauncheron thePitestTask, since JUnit 6 requires Java 17+ and your project may already be on 25.The key insight is that
pitest(...)dependencies go on PIT's own classpath (the forked JVM that discovers and runs tests), which is separate from your project'stestImplementationclasspath. Without these, PIT launches with the plugin's shaded Platform 1.9.2, which cannot load JUnit 6 test classes.