Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR addresses #1828 by improving how JUnit runner output is mapped back to VS Code TestItems when executing JUnit 5 @Suite tests (from junit-platform-suite), so suite containers can be identified correctly and have their status reflected in the Test Explorer.
Changes:
- Extend JUnit 5 unique-id parsing to recognize
engine:junit-platform-suiteand thesuite:segment. - Add a JUnit 5
@Suitesample class and corresponding Maven dependency in the junit test project. - Add a unit test intended to cover
@Suiteexecution output handling.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/test-projects/junit/src/test/java/junit5/suite/MyTestSuite.java | Adds a JUnit 5 @Suite fixture for reproduction/coverage. |
| test/test-projects/junit/pom.xml | Adds junit-platform-suite dependency for suite engine support in test project. |
| test/suite/JUnitAnalyzer.test.ts | Adds a new test case targeting suite runner output handling. |
| src/runners/junitRunner/JUnitRunnerResultAnalyzer.ts | Updates test id extraction to handle junit-platform-suite / suite: unique-id segments. |
| src/constants.ts | Adds JUnitTestPart.SUITE constant used by the analyzer. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
chagong
approved these changes
Mar 5, 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.
#1828
However, getTestId() only recognizes engine:junit5, engine:junit-jupiter, and engine:jqwik, causing Suite's uniqueId to be incorrectly routed to getTestIdForNonJunit5Method(), resulting in an incorrect test ID being parsed → triggeredTestsMapping failed to match → testItem is undefined → all UI updates are silently discarded.
Two files were modified, with three changes:
constants.ts:76— Added the constantSUITE = 'suite:'toJUnitTestPartJUnitRunnerResultAnalyzer.ts:194— Addedengine:junit-platform-suiteidentification togetTestId()JUnitRunnerResultAnalyzer.ts:224— Handled thesuite:part ingetTestIdForJunit5Method(), using the suite name as theclassNamewhenclass:is not specified (this will override any subsequentclass:entries to ensure correct subtest IDs).Also add unit test case for this fix.