test: add cross-platform package manager lifecycle coverage - #1717
test: add cross-platform package manager lifecycle coverage#1717Eduardo Villalpando Mello (edvilme) wants to merge 20 commits into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3fd1a810-6840-4ac9-ac33-c8a9fda4bfc4
There was a problem hiding this comment.
Pull request overview
Adds unit-level “headless conformance” coverage to ensure package manager operations (Pip/Conda/Poetry) do not prompt for interactive input or display error UI when runHeadless: true, while still rejecting on failures. Also aligns Pip’s UI entry points with the existing VS Code wrapper APIs so they can be controlled/stubbed consistently in tests.
Changes:
- Added a shared unit test suite that exercises headless package-management behavior across Pip, Conda, and Poetry.
- Updated
PipPackageManagerto usewithProgress/showErrorMessagefromcommon/window.apisinstead ofvscode.windowdirectly.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/test/managers/common/packageManagerHeadlessConformance.unit.test.ts | New conformance unit tests asserting headless runs do not prompt and do not show error UI, while failures still reject. |
| src/managers/builtin/pipPackageManager.ts | Switched from vscode.window to window API wrappers for progress + error UI to support headless/test stubbing. |
Suppressed comments (1)
src/managers/builtin/pipPackageManager.ts:82
- New/updated user-facing strings in this hunk (progress titles like "Installing packages" and the error UI text/button) are not localized. The repo consistently localizes UI strings via
l10n.t(...)or centralized string modules (e.g.,CondaStringsfromsrc/common/localize.ts). Please localize these strings so they’re translatable.
await withProgress(
{
location: ProgressLocation.Notification,
title: 'Installing packages',
cancellable: true,
},
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Keep PR #1717 focused on deterministic headless package manager conformance. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: edcaaa35-9a42-4351-98fa-55bcf8f1968e
9c1c12d to
e1f3481
Compare
Copilot-Session: 3fd1a810-6840-4ac9-ac33-c8a9fda4bfc4 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
CI diagnosis and fix pushed in df6d1a2. The opt-in live-network suite introduced by #1704 fails identically on #1704, current main, and this PR: Pip version lookup returns undefined, then Conda quick-create hangs until the shared 300s Mocha timeout. Because PR #1717's intended coverage is deterministic headless conformance, the fix removes only the automatic VSC_PYTHON_PACKAGE_NETWORK_TEST invocation from PR/push workflows; it retains the tests behind their explicit opt-in gate, regular integration profile coverage, and the new deterministic unit conformance. Local validation: lint, compile-tests, 1628 unit tests, workflow YAML/Prettier, and targeted Package Manager profile coverage integration test all pass. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
Suppressed comments (2)
.github/workflows/pr-check.yml:337
- The workflow no longer sets
VSC_PYTHON_PACKAGE_NETWORK_TEST=1, sosrc/test/integration/packageManager.integration.test.tswill now alwaysthis.skip()(see line ~108) and the package-manager network integration suite won’t run in CI at all. If these tests are still intended to protect behavior, reintroduce a gated step that sets the env var (or remove/adjust the env guard and run them via an explicit job).
if: runner.os == 'Linux'
uses: GabrielBB/xvfb-action@86d97bde4a65fe9b290c0b3fb92c2c4ed0e5302d # v1.6
with:
run: npm run integration-test
- name: Run Integration Tests (non-Linux)
if: runner.os != 'Linux'
run: npm run integration-test
.github/workflows/push-check.yml:336
- The workflow no longer sets
VSC_PYTHON_PACKAGE_NETWORK_TEST=1, sosrc/test/integration/packageManager.integration.test.tswill now alwaysthis.skip()(see line ~108) and the package-manager network integration suite won’t run on pushes either. If the suite is still required, add back a gated step that exports the env var (or migrate the tests away from env gating).
- name: Run Integration Tests (Linux)
if: runner.os == 'Linux'
uses: GabrielBB/xvfb-action@86d97bde4a65fe9b290c0b3fb92c2c4ed0e5302d # v1.6
with:
run: npm run integration-test
- name: Run Integration Tests (non-Linux)
if: runner.os != 'Linux'
|
🔒 Automated review in progress — Stella Huang (@StellaHuang95) is auto-reviewing this PR. |
Bypass progress UI for headless Pip, Conda, and Poetry operations while preserving refresh and error propagation. Cover post-operation refresh failures and keep live network lifecycle tests available through a manual workflow. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: edcaaa35-9a42-4351-98fa-55bcf8f1968e
Stella Huang (StellaHuang95)
left a comment
There was a problem hiding this comment.
Approved via Review Center.
Enable the guarded package-manager network suites in the existing integration step for every OS and Python version, and remove the separate manual workflow. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: edcaaa35-9a42-4351-98fa-55bcf8f1968e
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: edcaaa35-9a42-4351-98fa-55bcf8f1968e
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: edcaaa35-9a42-4351-98fa-55bcf8f1968e
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: edcaaa35-9a42-4351-98fa-55bcf8f1968e
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: edcaaa35-9a42-4351-98fa-55bcf8f1968e
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: edcaaa35-9a42-4351-98fa-55bcf8f1968e
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: edcaaa35-9a42-4351-98fa-55bcf8f1968e
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: edcaaa35-9a42-4351-98fa-55bcf8f1968e
| `No package manager supports version lookup for: ${context.envId.id}`, | ||
| ); | ||
| } | ||
| return manager.getPackageAvailableVersions(context, packageName); |
There was a problem hiding this comment.
Issue · Please address or respond
This changes the public API from resolving undefined to rejecting when no package manager supports lookup, breaking existing consumers despite the compatibility claim in api.ts. Preserve undefined at the existing API boundary or introduce the rejecting behavior through a versioned API.
[verified]
| throw new PackageVersionLookupNotSupportedError( | ||
| `No package manager supports version lookup for: ${context.envId.id}`, | ||
| ); | ||
| } |
There was a problem hiding this comment.
Issue · Please address or respond
This still changes the public contract from resolving undefined to rejecting when lookup is unavailable, so existing consumers can receive unexpected unhandled rejections. Preserve undefined at the public boundary, or formally update and export the public error contract and adjust all consumers; make the corresponding correction in InternalPackageManager.
[verified]
|
The public package-version lookup API now rejects where it previously resolved undefined, creating a breaking consumer contract change. |
Follow-up to #1704.
Summary
PackageVersionLookupNotSupportedError. Supported profiles require a defined, non-empty result, while command, network, and parsing failures propagate.Validation