Skip to content

Conversation

Copy link

Copilot AI commented Dec 12, 2025

fixes #22783 and #21865

The python.configureTests command was registered after multiple async operations during extension activation, creating a race condition where users could invoke the command before it was registered.

Changes

  • Extract command registration: Created standalone registerTestCommands() function in testing/main.ts containing all test command handlers (Tests_Configure, Tests_CopilotSetup, CopyTestId)

  • Register synchronously before first await: Moved unitTestsRegisterTypes() and registerTestCommands() to extension.ts immediately after initializeStandard(), before experimentService.activate()

  • Remove duplicate registrations: Cleaned up original registration in UnitTestManagementService.activate() and activateLegacy()

Copilot AI and others added 2 commits December 12, 2025 18:04
- Extract command registration logic from UnitTestManagementService into standalone registerTestCommands function
- Call registerTestCommands synchronously in activateLegacy before async operations
- This ensures commands are available immediately when extension activates, preventing "command not found" errors

Co-authored-by: eleanorjboyd <26030610+eleanorjboyd@users.noreply.github.com>
…vation

- Register test services (unitTestsRegisterTypes) before any async operations in extension.ts
- Register test commands immediately after service registration, before experimentService.activate()
- Remove duplicate registrations from extensionActivation.ts activateLegacy()
- This ensures commands are available synchronously when extension activates

Co-authored-by: eleanorjboyd <26030610+eleanorjboyd@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix issue with test command not registering on extension activation Register test commands before first await to prevent activation race condition Dec 12, 2025
Copilot AI requested a review from eleanorjboyd December 12, 2025 18:12
@eleanorjboyd eleanorjboyd marked this pull request as ready for review December 12, 2025 21:44
@eleanorjboyd eleanorjboyd added debt Covers everything internal: CI, testing, refactoring of the codebase, etc. skip tests Updates to tests unnecessary labels Dec 12, 2025
@eleanorjboyd eleanorjboyd enabled auto-merge (squash) December 12, 2025 21:46
@vs-code-engineering vs-code-engineering bot added this to the December / January 2026 milestone Dec 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

debt Covers everything internal: CI, testing, refactoring of the codebase, etc. skip tests Updates to tests unnecessary

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python: Configure Tests command not found

2 participants