Skip to content

Stabilize interpreter selection integration tests by asserting on interpreter path, not envId#1571

Merged
edvilme merged 4 commits into
mainfrom
copilot/fix-environment-test-failure
Jun 10, 2026
Merged

Stabilize interpreter selection integration tests by asserting on interpreter path, not envId#1571
edvilme merged 4 commits into
mainfrom
copilot/fix-environment-test-failure

Conversation

Copilot AI commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

interpreterSelection.integration.test.ts was asserting equality on envId.id across setEnvironment → getEnvironment flows. That ID is intentionally non-stable after persistence (manager may re-register with a suffixed opaque ID), which caused CI failures despite selecting the same interpreter.

  • Root cause

    • Tests treated envId.id as a stable identity across persistence round-trips.
    • For these flows, stable identity is the interpreter executable path (environmentPath.fsPath).
  • Changes in this PR

    • Replaced envId.id equality assertions with environmentPath.fsPath equality in all affected integration tests:
      • setEnvironment persists selection
      • Project selection is independent of global (global + project assertions)
      • Change event includes old and new values
      • File inherits project environment
      • Setting same environment is idempotent
    • Updated assertion message text where needed to reflect path-based interpreter identity.
  • Scope

    • Test-only change in src/test/integration/interpreterSelection.integration.test.ts.
    • No production/runtime behavior changes.
assert.strictEqual(
    retrieved.environmentPath.fsPath,
    envToSet.environmentPath.fsPath,
    'Retrieved environment should point to the same interpreter as the one set',
);

Copilot AI changed the title [WIP] Fix integration test for environment persistence Stabilize interpreter selection integration tests by asserting on interpreter path, not envId Jun 9, 2026
Copilot AI requested a review from edvilme June 9, 2026 18:55
@edvilme edvilme marked this pull request as ready for review June 9, 2026 18:56
@edvilme edvilme added debt Code quality issues bug Issue identified by VS Code Team member as probable bug labels Jun 9, 2026
@edvilme edvilme enabled auto-merge (squash) June 9, 2026 23:34
@edvilme edvilme merged commit 34c9e53 into main Jun 10, 2026
78 of 84 checks passed
@edvilme edvilme deleted the copilot/fix-environment-test-failure branch June 10, 2026 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Issue identified by VS Code Team member as probable bug debt Code quality issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants