Skip to content

fix: improve test coverage filter quickpick readability#306562

Merged
connor4312 merged 2 commits intomicrosoft:mainfrom
yogeshwaran-c:fix/coverage-filter-quickpick-readability
Apr 3, 2026
Merged

fix: improve test coverage filter quickpick readability#306562
connor4312 merged 2 commits intomicrosoft:mainfrom
yogeshwaran-c:fix/coverage-filter-quickpick-readability

Conversation

@yogeshwaran-c
Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

Polish / Bug fix

What is the current behavior?

The test coverage filter quickpick (used to filter coverage to a specific test) displays test items with the full ancestry chain as a flat string in the label field:

Suite › Subsuite › TestName

This makes it hard to scan when there are many tests with long ancestry paths. Additionally, the "All tests" option is confusing because it includes code executed during global initialization (e.g. comments, setup code), not just test functions.

Closes #229920
Closes #235347

What is the new behavior?

  1. Test name first, ancestry as description: The quickpick now shows the test name as the primary label and the ancestor chain as the description, matching the convention used by the file picker:

    TestName    Suite › Subsuite
    

    This makes it much easier to scan for specific tests.

  2. Rename "All tests" to "Entire run": As suggested by @connor4312 in Confusion on 'Filter Coverage To Test' #235347, this clarifies that the unfiltered view includes all code executed during the run (including global initialization), not just test function bodies.

Additional context

Both changes apply to the two places where the coverage filter quickpick is shown:

  • FilterCoverageToTestInEditor (editor title bar filter)
  • TestCoverageChangePerTestFilterAction (coverage view toolbar filter)

The getLabelForItem function now returns { label, description? } instead of a flat string, and callers spread the result into quickpick items.

Show the test name as the primary label and the ancestor path as the
description in the coverage filter quickpick, matching the file picker
convention. Also rename 'All tests' to 'Entire run' to clarify that
the unfiltered view includes code executed during global initialization,
not just test functions.

Closes microsoft#229920
Closes microsoft#235347
connor4312
connor4312 previously approved these changes Mar 31, 2026
Copy link
Copy Markdown
Member

@connor4312 connor4312 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@connor4312 connor4312 enabled auto-merge (squash) March 31, 2026 15:11
roblourens
roblourens previously approved these changes Mar 31, 2026
Yoyokrazy
Yoyokrazy previously approved these changes Mar 31, 2026
@connor4312
Copy link
Copy Markdown
Member

@yogeshwaran-c there is a compile error

[hygiene                  ] src/vs/workbench/contrib/testing/browser/codeCoverageDisplayUtils.ts(88,45): Unexpected unicode character: "›" (charCode: 8250). To suppress, use // allow-any-unicode-next-line
[hygiene                  ] 

you can use the \u syntax in strings to represent this

Fixes hygiene check failure by replacing the literal › character with
its \u203A escape sequence.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
auto-merge was automatically disabled April 3, 2026 06:50

Head branch was pushed to by a user without write access

@yogeshwaran-c yogeshwaran-c dismissed stale reviews from Yoyokrazy, roblourens, and connor4312 via 085f2a8 April 3, 2026 06:50
@yogeshwaran-c
Copy link
Copy Markdown
Contributor Author

Fixed the hygiene check — replaced the literal (U+203A) with \u203A escape syntax. Thanks for catching that!

@connor4312 connor4312 enabled auto-merge (squash) April 3, 2026 13:18
@connor4312 connor4312 merged commit cc5d7c8 into microsoft:main Apr 3, 2026
22 of 35 checks passed
@vs-code-engineering vs-code-engineering bot added this to the 1.115.0 milestone Apr 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Confusion on 'Filter Coverage To Test' Test: filter file to test could be more readable

5 participants