Skip to content

feat(testing): show running badge on Activity Bar while tests are running#292257

Merged
connor4312 merged 3 commits intomicrosoft:mainfrom
murataslan1:feat/testing-running-badge
Feb 19, 2026
Merged

feat(testing): show running badge on Activity Bar while tests are running#292257
connor4312 merged 3 commits intomicrosoft:mainfrom
murataslan1:feat/testing-running-badge

Conversation

@murataslan1
Copy link
Contributor

Summary

Shows a spinning loading indicator badge on the Testing icon in the Activity Bar when tests are actively running.

Before

No visual indication on the Activity Bar icon when tests are running - you had to look at the Testing view to see if tests were in progress.

After

A spinning loading badge appears on the Testing Activity Bar icon while tests are running, providing immediate visual feedback.

Changes

  • Added isRunning parameter to renderActivityBadge function
  • Show spinningLoading icon badge when tests are running (highest priority)
  • Badge priority: Running > Count (failed/passed/skipped) > Continuous testing

Use Case

This is particularly useful when:

  • Continuous testing is enabled and you want to know when triggered tests have completed
  • Running tests after a Git pull
  • Running long test suites in the background

Fixes #201982

Made with Cursor

…ning

Shows a spinning loading indicator badge on the Testing icon in the
Activity Bar when tests are actively running. This provides visual
feedback at a glance to know when test runs have started and completed.

The badge priority is:
1. Running tests (spinning icon) - highest priority
2. Count badge (failed/passed/skipped)
3. Continuous testing indicator

Fixes microsoft#201982

Co-authored-by: Cursor <cursoragent@cursor.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds an Activity Bar badge to indicate when tests are actively running, so users can see test execution status without opening the Testing view.

Changes:

  • Extends ResultSummaryView.renderActivityBadge with an isRunning parameter.
  • Shows a spinningLoading icon badge on the Testing Activity Bar icon while tests are running.
  • Preserves existing badge precedence for counts and continuous testing when not running.

Comment on lines +639 to +643
if (this.lastBadge instanceof IconBadge && this.lastBadge.icon === spinningLoading) {
return;
}

this.lastBadge = new IconBadge(spinningLoading, () => localize('testingRunningBadge', 'Tests are running'));
Copy link

Copilot AI Feb 2, 2026

Choose a reason for hiding this comment

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

The early-return cache (return when lastBadge matches) can prevent re-applying the badge after badgeDisposable.clear() is called in the "no results" branch. For example, if results are cleared and then tests start again, lastBadge may still be spinningLoading (or the same NumberBadge value) and this will return without calling activityService.showViewActivity, leaving the Activity Bar without a badge. Consider including badgeDisposable.value (or a separate boolean) in the cache condition, or resetting lastBadge when clearing the badge, so the badge is always re-shown after a clear/dispose.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch! Fixed in 2e5b848 — I've added this.badgeDisposable.value to the early-return cache check in all three badge branches. This ensures that if badgeDisposable.clear() is called (e.g. in the no-results branch), the badge will be properly re-applied when tests start again, even if lastBadge still references the same badge type.

@murataslan1
Copy link
Contributor Author

Ready for review. Shows spinning badge on Testing Activity Bar icon while tests are running.

Include badgeDisposable.value in the early-return cache check so that
badges are properly re-applied after results are cleared (e.g. when
badgeDisposable.clear() is called in the no-results branch) and tests
start again.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
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) February 17, 2026 18:54
@vs-code-engineering vs-code-engineering bot added this to the February 2026 milestone Feb 17, 2026
@murataslan1
Copy link
Contributor Author

Pushed an empty commit to retrigger CI after a transient 403 rate-limit failure in Compile & Hygiene. Current workflow runs are in action_required state for this fork commit and need maintainer approval to proceed.

@connor4312 connor4312 merged commit 75c92f0 into microsoft:main Feb 19, 2026
17 checks passed
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.

Testing: show clock badge on Activity Bar icon when tests are running

5 participants