You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Summary
Adopts the package manager command classes introduced in #1621 across
Pip/UV, Conda, and Poetry while preserving existing behavior and error
contracts.
## Changes
- Replaces existing command construction and execution paths with the
new command classes.
- Uses JSON unconditionally for machine-readable commands when the
installed tool supports it, including all required flags.
- Uses a dedicated text parser for Pip 21.2-25.0; Pip 25.1+ always uses
`pip index versions --json`.
- Preserves operation-specific timeout behavior: install/uninstall
mutations are unbounded, while list/direct-list operations retain
30-second timeouts.
- Propagates malformed version output as an operational failure rather
than treating it as a successful empty result.
- Keeps destructive environment removal confirmation bypass explicit
through `runHeadless`.
## Relationship
- Targets `main` directly and includes the changes merged in #1717.
- Replaces #1678, whose base branch could not be changed after GitHub
registered it as part of a stack.
- Deterministic command argument and parser tests are intentionally
included here so the adopted implementations are covered in the same PR.
The superseded network-dependent roundtrip test was removed in favor of
the controlled package-manager integration fixtures.
## Testing
- `npm run lint`
- `npm run compile-tests`
- `npm run unittest` (1,855 passing, 6 pending)
- Focused package-manager command, selection, timeout, parsing, and
removal-confirmation tests
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot-Session: 3f16397e-0917-4efb-8d75-566c71ebf9ba
Copilot-Session: 6b2fe9b5-38ea-442f-b07a-b6c71134d480
Copilot-Session: edcaaa35-9a42-4351-98fa-55bcf8f1968e
Copilot-Session: 5aba47cf-0b43-48b9-bc22-75e625da70e8
Copy file name to clipboardExpand all lines: .github/instructions/testing-workflow.instructions.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -603,6 +603,7 @@ envConfig.inspect
603
603
- Create shared mock helpers (e.g., `createMockLogOutputChannel()`) instead of duplicating mock setup across multiple test files (1)
604
604
- Use `sinon.useFakeTimers()` with `clock.tickAsync()` instead of `await new Promise(resolve => setTimeout(resolve, ms))` for debounce/timeout handling - eliminates flakiness and speeds up tests significantly (1)
605
605
- Always compile tests (`npm run compile-tests`) before running them after adding new test cases - test counts will be wrong if running against stale compiled output (1)
606
+
-**Delete stale compiled test output after removing a test source file**: `compile-tests` does not remove the corresponding file under `out/`, so local unit or integration runs may execute a deleted test until that artifact is cleaned (1)
606
607
- Never create "documentation tests" that just `assert.ok(true)` — if mocking limitations prevent testing, either test a different layer that IS mockable, or skip the test entirely with a clear explanation (1)
607
608
- When stubbing vscode APIs in tests via wrapper modules (e.g., `workspaceApis`), the production code must also use those wrappers — sinon cannot stub properties directly on the vscode namespace like `workspace.workspaceFolders`, so both production and test code must reference the same stubbable wrapper functions (4)
608
609
-**Before writing tests**, check if the function under test calls VS Code APIs directly (e.g., `commands.executeCommand`, `window.createTreeView`, `workspace.getConfiguration`). If so, FIRST update the production code to use wrapper functions from `src/common/*.apis.ts` (create the wrapper if it doesn't exist), THEN write tests that stub those wrappers. This prevents CI failures where sinon cannot stub the vscode namespace (4)
@@ -611,3 +612,4 @@ envConfig.inspect
611
612
-**No retries for masking flakiness**: Mocha `retries` should not be used to mask test flakiness. If a test is flaky, fix the root cause. Retries hide real issues and slow down CI (1)
612
613
-**pet binary is required for environment manager registration**: The smoke/E2E/integration tests require the `pet` binary from `microsoft/python-environment-tools` to be built and placed in `python-env-tools/bin/`. Without it, `waitForApiReady()` will timeout because managers never register. CI must build pet from source using `cargo build --release --package pet` (2)
613
614
-**Check exact project registration with `getPythonProjects()`**: `getPythonProject(uri)` can return a containing parent project, so it cannot prove that a nested project was registered or unregistered (1)
615
+
-**Use controlled fixture providers for package lifecycle integration tests**: Discovering an existing Conda environment does not guarantee API quick-create can succeed. Use `createEnvironmentFixture()` so creation prerequisites and cleanup are deterministic (1)
0 commit comments