fix: show only test cases in Test Results#1888
Merged
Merged
Conversation
Copilot-Session: 66d94993-0cc9-4a2f-886b-99a1649e7051
There was a problem hiding this comment.
Pull request overview
This PR updates the built-in JUnit/TestNG result analyzers (and supporting controller logic/tests) so VS Code’s Test Results view only shows method/invocation test cases, avoiding extra suite/class rows caused by assigning task states to container items.
Changes:
- JUnit: enqueue/report only non-suite leaf items from
%TSTTREE, and suppress routine suite/container lifecycle state reporting. - TestNG: enqueue/report method cases without assigning result states to class containers; report runner-level errors on discovered method cases.
- Controller/tests: adjust queuing behavior for delegated runners and add/adjust analyzer unit tests to verify container items don’t get result states.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/suite/TestNGAnalyzer.test.ts | Adds coverage ensuring method results/error reporting doesn’t assign states to class containers. |
| test/suite/JUnitAnalyzer.test.ts | Updates/adds tests to validate leaf-only enqueuing and suppression of suite reporting. |
| src/runners/testngRunner/TestNGRunnerResultAnalyzer.ts | Enqueues method items and avoids propagating state to class containers; targets runner errors to method cases. |
| src/runners/junitRunner/JUnitRunnerResultAnalyzer.ts | Tracks suite-vs-leaf items and suppresses suite lifecycle reporting while keeping failing containers visible. |
| src/runners/baseRunner/RunnerResultAnalyzer.ts | Removes parent aggregation/state propagation helpers (now relying on VS Code parent computation). |
| src/controller/testController.ts | Moves/enables pre-enqueueing only for delegated runners to preserve their existing reporting behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 25c88712-87e4-4104-ad0e-2e8a9c195f7c
Contributor
Author
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 25c88712-87e4-4104-ad0e-2e8a9c195f7c
chagong
approved these changes
Jul 16, 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.


Problem
VS Code's Test Results view flattens every
TestItemthat receives its own task state. The built-in Java runners queued parent containers and explicitly reported class states, so a single Java test could produce separate Class, Method, and Invocation rows.Test Results also builds each leaf result's breadcrumb from its parent
TestItemlabels. Those labels previously included codicon markup such as$(symbol-class), which VS Code rendered as literal text in the breadcrumb instead of as an icon.Change
%TSTTREEidentifies a non-suite leaf.Scope / notes
Validation
npm run compilenpm run lintJUnitAnalyzer,TestNGAnalyzer)npm test: affected tests pass; 10 unrelated tests fail because the installedredhat.javapre-release does not register the legacy Java test delegate commands.