[Tracking] Defer JUnit 5/6 dispatch fix to upstream JDT (do not merge)#1867
Closed
wenytang-ms wants to merge 0 commit into
Closed
[Tracking] Defer JUnit 5/6 dispatch fix to upstream JDT (do not merge)#1867wenytang-ms wants to merge 0 commit into
wenytang-ms wants to merge 0 commit into
Conversation
9c35a88 to
1428b05
Compare
1428b05 to
5e99273
Compare
There was a problem hiding this comment.
Pull request overview
This PR fixes incorrect dispatch to the JUnit 6 runner by requiring confirmation that JUnit Platform 6.x APIs are actually resolvable on the project classpath, preventing runtime NoClassDefFoundError when only JUnit Platform 1.x “fat jars” are present.
Changes:
- Adds a small set of JUnit Platform 6.0-only “marker” types and checks their resolvability via
IJavaProject.findType. - Updates JUnit 5 vs JUnit 6 runner selection logic to fall back to JUnit 5 when Platform 6 markers are not present.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
8e7b492 to
b84d217
Compare
b84d217 to
46c7835
Compare
Contributor
Author
|
Branch has been reset to Summary of the call:
Next steps tracked on #1866 — that issue stays open until we verify the fix against a vscode-java release that ships JDT 4.40+. |
This was referenced Jun 2, 2026
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.
Decision
The dispatch regression introduced in #1820 (
TestKindProvidercallingCoreTestSearchEngine.hasJUnit6TestAnnotationfirst, which misfires on JUnit Platform 1.x fat jars) is being fixed upstream in Eclipse JDT, not in this repository. Rather than carrying a parallel sentinel-class workaround here, we will rely on the upstream fix flowing down through the normal release chain.Upstream fixes (already merged)
@Testableto@Test/@TestTemplate/@ClassTemplateand correct the JUnit 5 major-version baseline (1→5).junit-platform-console-standalone-*.jar, read the bundled Jupiter engine version fromEngine-Version-junit-jupiterinstead of the platform'sSpecification-Version.Together these correct
CoreTestSearchEngine.hasJUnit5/6TestAnnotationfor the fat-jar shape reported in #1866 and redhat-developer/vscode-java#4396.Release chain
Eclipse 4.40 release (~Jun 2026) → JDT-LS picks up new JDT jars (target points to 4.40-I-builds, rolling) → vscode-java bumps bundled JDT-LS server → user updates vscode-java extensionWhy we chose to wait
TestKindProvideris intentionally a thin wrapper overCoreTestSearchEngine; keeping it that way avoids version-detection logic in two places.junit-platform-console-standaloneare affected; the upstream fix covers the actual user-visible shape.Closure criteria
This PR / branch will be closed once:
If new reports surface that are not covered by the upstream fix (e.g. third-party fat jars without
Engine-Version-junit-jupiterin the manifest), we will revisit and re-introduce a targeted workaround at that time.Related