test: cover registered package manager lifecycles - #1704
test: cover registered package manager lifecycles#1704Eduardo Villalpando Mello (edvilme) merged 24 commits into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 6b2fe9b5-38ea-442f-b07a-b6c71134d480
There was a problem hiding this comment.
Pull request overview
Adds a package-manager-centric integration baseline to exercise install/list/direct-deps/uninstall lifecycles against the live registered package manager instances, establishing behavioral coverage ahead of the package-manager command refactor work.
Changes:
- Adds a fixture registry describing active/deferred package managers and their expected capabilities.
- Reworks the integration test to drive a disposable project + disposable environment lifecycle per active profile, with registry completeness guards and prerequisite-based skips.
- Adds an integration-test-only API bridge (env-gated) to expose the live registered
PackageManagerimplementations, and pins the integration test user profile to normal pip execution (python-envs.alwaysUseUv=false).
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/test/integration/packageManagerFixtures.ts | Introduces fixture definitions for registered package managers, capabilities, and per-manager profiles (active vs deferred). |
| src/test/integration/packageManagement.integration.test.ts | Implements the fixture-driven integration lifecycle tests and registry completeness checks, plus robust cleanup and prerequisite skips. |
| src/internal.api.ts | Adds a registeredManager getter on InternalPackageManager to expose the wrapped live implementation for tests. |
| src/extension.ts | Env-gated integration-test bridge that exposes registered package managers via the exported API object. |
| .vscode-test.mjs | Seeds integration test user settings to force python-envs.alwaysUseUv=false for consistent pip execution during integration runs. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 6b2fe9b5-38ea-442f-b07a-b6c71134d480
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.
Suppressed comments (1)
src/test/integration/packageManagement.integration.test.ts:150
addPythonProjectis a synchronous (void-returning) API, soawaithere is redundant and can confuse readers (and may be flagged by@typescript-eslint/await-thenableif enabled).
await api.addPythonProject(project);
This reverts commit 596583f.
6966031 to
31d186d
Compare
Package manager coverage is being developed separately in PR #1704. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 6b2fe9b5-38ea-442f-b07a-b6c71134d480
…ration-coverage # Conflicts: # api/CHANGELOG.md # api/package-lock.json # api/package.json # src/features/pythonApi.ts
|
🔒 Automated review in progress — Stella Huang (@StellaHuang95) is auto-reviewing this PR. |
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3fd1a810-6840-4ac9-ac33-c8a9fda4bfc4
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3fd1a810-6840-4ac9-ac33-c8a9fda4bfc4
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3fd1a810-6840-4ac9-ac33-c8a9fda4bfc4
|
The new integration baseline can skip real environment creation and available-version failures, and it does not establish a pre-install package baseline. These gaps can mask regressions and invalidate the lifecycle assertions. |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3fd1a810-6840-4ac9-ac33-c8a9fda4bfc4
|
The new integration baseline can skip active-manager failures and does not establish the claimed lifecycle coverage before mutating environments. These gaps can hide regressions in environment creation and package-manager operations. |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3fd1a810-6840-4ac9-ac33-c8a9fda4bfc4
Rich Chiodo (rchiodo)
left a comment
There was a problem hiding this comment.
Approved via Review Center.
| if (directPackageNames !== undefined) { | ||
| assert.ok(directPackageNames.includes(packageName), 'Installed package was not reported as direct'); | ||
| } | ||
|
|
There was a problem hiding this comment.
Warning · Non-blocking recommendation
When requests is already installed, both mutation calls are skipped and the lifecycle passes without testing install or uninstall. Select a package absent from the baseline, or skip/fail this fixture explicitly so a passing run always proves both transitions.
| }); | ||
|
|
||
| test(`${profile.name} Package Manager should list available package versions`, async function () { | ||
| const packages = await api.getPackages(environment!, { skipCache: true }); |
There was a problem hiding this comment.
Warning · Non-blocking recommendation
Missing Pip metadata makes supportsVersionLookup return false, potentially converting a package-list parsing regression into a passing skip. Require the Pip package/version to be present, and skip only when its parsed version is concretely below 21.2.
Rich Chiodo (rchiodo)
left a comment
There was a problem hiding this comment.
Approved via Review Center.
Preserve package manager command-class adoption while integrating the lifecycle and headless behavior from PR #1704. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: edcaaa35-9a42-4351-98fa-55bcf8f1968e
Summary
Adds a package-manager-centric integration baseline that intentionally precedes and de-risks #1686, so the package-manager command refactor is exercised against behavior established on
main.inspect()snapshots and performs guarded failure-safe cleanupmain, while available-version lookup would also introduceuv tool run pipnetwork seedingValidation
npm run compilenpm run compile-testsnpm run lintnpm run unittestpackageManagement.integration.test.js: 3 passing, 2 prerequisite skips locallyThe active Pip and Conda fixtures require package-index/network access when their runtime prerequisites are present.
Fixes #1701