Add python-environment's project support for pytest execution#25772
Merged
eleanorjboyd merged 11 commits intomicrosoft:test-project-supportfrom Feb 9, 2026
Merged
Conversation
eleanorjboyd
commented
Feb 6, 2026
src/client/testing/testController/common/projectTestExecution.ts
Outdated
Show resolved
Hide resolved
src/client/testing/testController/common/projectTestExecution.ts
Outdated
Show resolved
Hide resolved
src/test/testing/testController/pytest/pytestExecutionAdapter.unit.test.ts
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
This PR adds project-aware pytest execution support to the test controller flow by wiring Python Environments “projects” into execution/debugging, and introducing shared helpers + unit tests to validate the new behavior in multi-project workspaces.
Changes:
- Add project-based test execution orchestration (
executeTestsForProjects, grouping test items by owning project, per-project execution). - Pass project context into pytest execution and debugging (env var
PROJECT_ROOT_PATH,LaunchOptions.project, project-derived Python path/session naming). - Add centralized test mocks and new/updated unit tests covering project execution and debug-session lifecycle handling.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/client/testing/testController/common/projectTestExecution.ts | New project-based execution utilities (grouping, project lookup, coverage callback setup). |
| src/client/testing/testController/controller.ts | Routes pytest runs through project-based execution when projects are registered. |
| src/client/testing/testController/pytest/pytestExecutionAdapter.ts | Sets project execution environment (PROJECT_ROOT_PATH) and passes project into debug launch options; uses project environment when available. |
| src/client/testing/testController/unittest/testExecutionAdapter.ts | Updates execution adapter signature and adds logging around new parameters. |
| src/client/testing/common/debugLauncher.ts | Supports concurrent debug sessions via a per-launch marker; uses project name/python path when available. |
| src/client/testing/common/types.ts | Extends LaunchOptions to include optional project metadata. |
| src/test/testing/testController/testMocks.ts | Adds reusable mocks for project adapters, dependencies, and test items. |
| src/test/testing/testController/pytest/pytestExecutionAdapter.unit.test.ts | Adds unit tests validating project env var + debug launch options behavior for pytest. |
| src/test/testing/testController/common/projectTestExecution.unit.test.ts | Adds comprehensive unit tests for grouping, project resolution, execution orchestration, and coverage callback behavior. |
| src/test/testing/common/debugLauncher.unit.test.ts | Updates and adds tests for multi-session debug lifecycle tracking and project-specific config naming. |
src/client/testing/testController/common/projectTestExecution.ts
Outdated
Show resolved
Hide resolved
src/client/testing/testController/common/projectTestExecution.ts
Outdated
Show resolved
Hide resolved
src/client/testing/testController/pytest/pytestExecutionAdapter.ts
Outdated
Show resolved
Hide resolved
src/client/testing/testController/common/projectTestExecution.ts
Outdated
Show resolved
Hide resolved
3b87651
into
microsoft:test-project-support
78 of 82 checks passed
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.
No description provided.