Skip to content

test: cover registered package manager lifecycles - #1704

Merged
Eduardo Villalpando Mello (edvilme) merged 24 commits into
mainfrom
package-manager-integration-coverage
Aug 17, 2026
Merged

test: cover registered package manager lifecycles#1704
Eduardo Villalpando Mello (edvilme) merged 24 commits into
mainfrom
package-manager-integration-coverage

Conversation

@edvilme

Copy link
Copy Markdown
Contributor

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.

  • drives one stateful install/list/direct-package/uninstall lifecycle per active profile
  • uses unique disposable projects and manager-owned disposable environments
  • exercises the live registered manager instances through a runtime-gated integration-test bridge
  • guards registry completeness so every registered package-manager ID has an active fixture or explicit deferral
  • covers normal Pip execution and Conda when their runtime prerequisites are available
  • records an uncached baseline instead of assuming a newly created environment is empty
  • restores workspace-scoped configuration from inspect() snapshots and performs guarded failure-safe cleanup
  • defers Poetry pending a Poetry-owned project/lockfile lifecycle
  • defers uv-backed Pip because changing the machine-scoped selection reliably within one extension host was not stable on main, while available-version lookup would also introduce uv tool run pip network seeding
  • pins the disposable integration-test user profile to normal Pip execution

Validation

  • npm run compile
  • npm run compile-tests
  • npm run lint
  • npm run unittest
  • targeted packageManagement.integration.test.js: 3 passing, 2 prerequisite skips locally
    • Pip skipped because quick create selected Python 3.15.0 alpha, whose bundled Pip metadata is incomplete
    • Conda skipped because Conda is not installed
  • reviewer specialist: clean, no Critical or Important findings

The active Pip and Conda fixtures require package-index/network access when their runtime prerequisites are present.

Fixes #1701

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 6b2fe9b5-38ea-442f-b07a-b6c71134d480

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 PackageManager implementations, 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.

Comment thread src/test/integration/packageManagement.integration.test.ts Outdated
Comment thread src/test/integration/packageManagement.integration.test.ts Outdated
Comment thread src/test/integration/packageManagement.integration.test.ts Outdated
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 6b2fe9b5-38ea-442f-b07a-b6c71134d480

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

  • addPythonProject is a synchronous (void-returning) API, so await here is redundant and can confuse readers (and may be flagged by @typescript-eslint/await-thenable if enabled).
        await api.addPythonProject(project);

@edvilme
Eduardo Villalpando Mello (edvilme) force-pushed the package-manager-integration-coverage branch from 6966031 to 31d186d Compare August 12, 2026 20:46
Eduardo Villalpando Mello (edvilme) added a commit that referenced this pull request Aug 12, 2026
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
@StellaHuang95

Stella Huang (StellaHuang95) commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

🔒 Automated review in progress — Stella Huang (@StellaHuang95) is auto-reviewing this PR.

Comment thread src/test/integration/packageManager.integration.test.ts
Comment thread src/test/integration/packageManager.integration.test.ts Outdated
@StellaHuang95

This comment has been minimized.

Comment thread src/test/integration/packageManager.integration.test.ts
@rchiodo Rich Chiodo (rchiodo) added the review-auto:changes-requested Automated review: posted blocking findings to address. label Aug 17, 2026
Comment thread src/test/integration/packageManager.integration.test.ts
Comment thread src/api.ts
Comment thread src/managers/conda/condaPackageManager.ts

@eleanorjboyd Eleanor Boyd (eleanorjboyd) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Production/API findings 1–3 from my review. Tests were reviewed by inspection but not executed.

written by my agent

Comment thread src/test/integration/packageManager.integration.test.ts Outdated
Comment thread src/managers/builtin/pipPackageManager.ts Outdated
Comment thread src/managers/conda/condaPackageManager.ts
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 3fd1a810-6840-4ac9-ac33-c8a9fda4bfc4
Comment thread src/managers/conda/condaPackageManager.ts
Comment thread examples/sample1/src/api.ts
Comment thread src/test/integration/packageManager.integration.test.ts Outdated
Comment thread src/test/integration/packageManager.integration.test.ts
Comment thread src/test/integration/packageManager.integration.test.ts
Comment thread src/test/integration/packageManager.integration.test.ts
Comment thread src/test/integration/packageManager.integration.test.ts
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
@rchiodo

Copy link
Copy Markdown
Contributor

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
@rchiodo

Copy link
Copy Markdown
Contributor

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

@rchiodo Rich Chiodo (rchiodo) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved via Review Center.

@rchiodo Rich Chiodo (rchiodo) added review-auto:approved Automated review: no blocking findings (approval posted). and removed review-auto:changes-requested Automated review: posted blocking findings to address. labels Aug 17, 2026
@edvilme
Eduardo Villalpando Mello (edvilme) merged commit c3cb023 into main Aug 17, 2026
34 checks passed
@edvilme
Eduardo Villalpando Mello (edvilme) deleted the package-manager-integration-coverage branch August 17, 2026 23:37
if (directPackageNames !== undefined) {
assert.ok(directPackageNames.includes(packageName), 'Installed package was not reported as direct');
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 });

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@rchiodo Rich Chiodo (rchiodo) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved via Review Center.

Eduardo Villalpando Mello (edvilme) added a commit that referenced this pull request Aug 18, 2026
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-package debt Code quality issues review-auto:approved Automated review: no blocking findings (approval posted).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add package-manager integration lifecycle coverage

5 participants