Listen for added workspace folders to also testing.activateLegacyWorkspace() them#26012
Open
vaclavHala wants to merge 2 commits into
Open
Listen for added workspace folders to also testing.activateLegacyWorkspace() them#26012vaclavHala wants to merge 2 commits into
vaclavHala wants to merge 2 commits into
Conversation
added 2 commits
June 19, 2026 16:43
…space() them so testing works there
There was a problem hiding this comment.
Pull request overview
This PR addresses #26011 by ensuring legacy testing adapters are initialized for workspace folders that are added after the Python extension has already activated, so test discovery works without requiring a VS Code restart.
Changes:
- In legacy mode, register a
onDidChangeWorkspaceFolderslistener and callactivateLegacyWorkspace()for newly added folders. - Add a unit test covering discovery in a workspace folder added post-activation.
Show a summary per file
| File | Description |
|---|---|
| src/client/testing/testController/controller.ts | Hooks workspace-folder additions in legacy mode to initialize per-workspace legacy test adapters. |
| src/test/testing/testController/controller.unit.test.ts | Adds coverage to ensure discovery works for folders added after activation. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 2
- Review effort level: Low
Comment on lines
+241
to
+247
| this.disposables.push( | ||
| this.workspaceService.onDidChangeWorkspaceFolders((evt) => { | ||
| evt.added.forEach((workspace) => { | ||
| this.activateLegacyWorkspace(workspace); | ||
| }); | ||
| }), | ||
| ); |
Comment on lines
+229
to
+230
| const onDidChangeWorkspaceFolders = new vscode.EventEmitter<vscode.WorkspaceFoldersChangeEvent>(); | ||
| const fakeDiscoveryAdapter = sandbox.stub().resolves(undefined); |
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.
Fixes #26011