-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Add python-environment's project support for pytest execution #25772
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add python-environment's project support for pytest execution #25772
Conversation
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
No description provided.