test: add cross-platform package manager lifecycle coverage - #1717
test: add cross-platform package manager lifecycle coverage#1717Eduardo Villalpando Mello (edvilme) wants to merge 22 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
|
The public package-version lookup API now rejects where it previously resolved undefined, creating a breaking consumer contract change. |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: edcaaa35-9a42-4351-98fa-55bcf8f1968e
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 15 changed files in this pull request and generated no new comments.
Suppressed comments (2)
src/test/integration/environmentFixture.ts:379
- If process-tree termination rejects, or if the force timer fires before
close, this promise settles while the original child may still be running. Fixture setup then entersdispose()and can start provider/root deletion against that active process. Keep the fixture in a pending-cleanup state until child exit is confirmed (similar to the API-removal guard) instead of allowing direct cleanup after an unconfirmed kill.
void terminateProcessTree(child).catch((error) => {
finish(new Error(`${timeoutError.message}\nFailed to terminate process tree: ${toError(error).message}`));
});
forceTimer = setTimeout(() => finish(timeoutError), 10_000);
src/test/managers/builtin/pipPackageManager.unit.test.ts:133
- This fixture still hardcodes a POSIX absolute path. On Windows,
Uri.file('/path/to/environment')produces a drive-relative path, so the unit test no longer exercises the same path shape as production. Build the URI from__dirname, as the shared conformance fixture does.
environmentPath: Uri.file('/path/to/environment'),
Eleanor Boyd (eleanorjboyd)
left a comment
There was a problem hiding this comment.
No approval-blocking issues found. The headless package operations suppress progress/error UI while preserving operational failures, and the integration cleanup uses randomized ownership markers plus strict path-containment checks before destructive removal. I also confirmed that both PR and push CI enable the network lifecycle coverage.
Non-blocking follow-up: additional focused cleanup tests for ownership mismatch, out-of-root prefixes, partial setup, and removal timeout would strengthen the fixture coverage.
Written by an AI agent on behalf of Eleanor.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: eb5f0ccb-cc13-4185-af62-e49f660c239a
Follow-up to #1704.
Summary
PackageVersionLookupNotSupportedError. Supported profiles require a defined, non-empty result, while command, network, and parsing failures propagate.Validation