Skip to content

Add inline-script environment creation tests (PEP 723 PR 5/16 - tests) - #2

Closed
StellaHuang95 wants to merge 1 commit into
pep723-pr5-create-happy-pathfrom
pep723-pr5-tests
Closed

Add inline-script environment creation tests (PEP 723 PR 5/16 - tests)#2
StellaHuang95 wants to merge 1 commit into
pep723-pr5-create-happy-pathfrom
pep723-pr5-tests

Conversation

@StellaHuang95

@StellaHuang95 StellaHuang95 commented Jul 23, 2026

Copy link
Copy Markdown
Owner

What this PR adds

New suites:

  • lockfile.apis.unit.test.ts — 9 tests: contention, retain/fail-fast, orphaned and compromised locks, and timeout.
  • venvUtils.createWithProgress.unit.test.ts — 3 tests for trackUvEnvironment and pkgInstallationCancelled.
  • helpers.cancellation.unit.test.ts — 4 tests for runProcess cancellation safety.
  • virtualEnvironment.unit.test.ts — 2 tests for getVenvPythonPath on Windows and POSIX.

Expanded / updated suites:

  • inlineScriptEnvManager.unit.test.ts — 40 tests across scope/metadata validation, base-interpreter selection, cache creation, cache reuse, transaction rollback, and events/disposal.
  • inlineScriptCacheLayout.unit.test.ts, inlineScriptCacheKey.unit.test.ts, inlineScriptInterpreter.unit.test.ts — cover the new/changed layout, cache-key, and interpreter-selection helpers.
  • inlineScriptMain.unit.test.ts — updated for the new registerInlineScriptFeatures signature.

With both PRs applied, npm run unittest reports 1487 passing, 0 failing, 5 pending.

Merge order

Merge microsoft#1651 first. After it lands in main, this PR can be retargeted to main with no change to its diff (still tests only).

Unit tests for the inline-script environment creation path: cache key, cache layout, interpreter selection, cross-process lockfile, venv python path, process cancellation, createWithProgress options, and the InlineScriptEnvManager create/reuse flow.

Based on the implementation branch so this PR shows only the test changes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 39dcc6a3-0fbd-4f36-9d0f-68677de49c27
@StellaHuang95
StellaHuang95 deleted the pep723-pr5-tests branch July 23, 2026 23:34
StellaHuang95 added a commit that referenced this pull request Aug 25, 2026
…-key preservation

Reduce this PR's net diff versus its merge-base to only three logical changes:

- #3 atomic canonical lock retirement on release (src/common/lockfile.apis.ts)
- #6 serialized persistent-state clears (src/common/persistentState.ts)
- #7 generic Clear Cache preserves the inline association key
  (constants.ts, envCommands.ts, extension.ts, and an import-only change in
  the inline-script envManager)

Revert the other seven changes to the merge-base content:
- #1 root-generation nonce, #2 root/entry admission decoupling,
  #9 create-counting order (inline-script envManager)
- #4/#5 reclaim-side lock retirement + generation-specific inspection
  (keep only the minimal release-side companions inspect/reclaim need to
  stay correct: .release-* recognition and ENOENT-on-readdir tolerance)
- #8 workspace-root protection (settingHelpers)
- #10 typed ClearCacheNotSupported (envManagers, NotSupportedError)

Also revert the associated test changes for the removed items, keeping the
new persistentState suite (#6), the new Clear Environment Caches suite (#7),
and the release-side lock-retirement tests (#3).

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
StellaHuang95 added a commit that referenced this pull request Aug 26, 2026
…-key preservation

Reduce this PR's net diff versus its merge-base to only three logical changes:

- #3 atomic canonical lock retirement on release (src/common/lockfile.apis.ts)
- #6 serialized persistent-state clears (src/common/persistentState.ts)
- #7 generic Clear Cache preserves the inline association key
  (constants.ts, envCommands.ts, extension.ts, and an import-only change in
  the inline-script envManager)

Revert the other seven changes to the merge-base content:
- #1 root-generation nonce, #2 root/entry admission decoupling,
  #9 create-counting order (inline-script envManager)
- #4/#5 reclaim-side lock retirement + generation-specific inspection
  (keep only the minimal release-side companions inspect/reclaim need to
  stay correct: .release-* recognition and ENOENT-on-readdir tolerance)
- #8 workspace-root protection (settingHelpers)
- #10 typed ClearCacheNotSupported (envManagers, NotSupportedError)

Also revert the associated test changes for the removed items, keeping the
new persistentState suite (#6), the new Clear Environment Caches suite (#7),
and the release-side lock-retirement tests (#3).

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant