Skip to content

test(pm): run package manager tests offline and drop vt_workspace duplicates - #3171

Merged
fengmk2 merged 4 commits into
voidzero-dev:mainfrom
liangmiQwQ:test/pm-cli-test-mocks
Oct 21, 2026
Merged

fengmk2 merged 4 commits into
voidzero-dev:mainfrom
liangmiQwQ:test/pm-cli-test-mocks

Conversation

@liangmiQwQ

Copy link
Copy Markdown
Collaborator

About 20 package-manager tests in vp_pm_cli downloaded pnpm, yarn and dist-tags from registry.npmjs.org into a VP_HOME shared across runs. They needed the network, and a stale shared cache could make them fail.

This PR moves them offline:

  • Detection tests assert the detected manager directly, or build against a local mock registry with pre-seeded installs.
  • Download, integrity-hash, shim and pnpm 12 native tests serve fixture tarballs whose digests the tests compute. They assert exact values, cache reuse and mismatch details.
  • The pnpm shim test now runs pnpm.cmd on Windows instead of being skipped there.

It also removes 18 tests that only exercised vt_workspace root finding, which comes from the vite-task dependency. It keeps the two contracts this crate relies on: pnpm-workspace.yaml wins over package.json workspaces for detection, and an invalid package.json is an error.

The crate's test run drops from about 44–61s to about 24s, with no network access.

🤖 Generated with Claude Code

These tests exercised vt_workspace::find_package_root and find_workspace_root,
which come from the vite-task git dependency. Keep the two contracts this crate
relies on: pnpm-workspace.yaml wins over package.json workspaces for detection,
and an invalid package.json is an error rather than no selection.
About 20 tests fetched pnpm, yarn, and dist-tags from registry.npmjs.org
through a VP_HOME shared across runs, so they needed the network and could
fail on a stale cache. Detection tests now check the detected manager
directly, or build against a mock registry with pre-seeded installs.
Download, hash, shim, and pnpm 12 native tests serve fixture tarballs whose
digests the tests compute.
@liangmiQwQ

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-21T13:22:47.821605Z 1554ada Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: 1554ada293

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@liangmiQwQ
liangmiQwQ marked this pull request as ready for review October 21, 2026 13:24
@liangmiQwQ
liangmiQwQ requested a review from fengmk2 October 21, 2026 13:24
@fengmk2 fengmk2 self-assigned this Oct 21, 2026
@fengmk2

fengmk2 commented Oct 21, 2026

Copy link
Copy Markdown
Member

Need to fix conflicts first.

@liangmiQwQ

Copy link
Copy Markdown
Collaborator Author

fixed!

@fengmk2
fengmk2 merged commit e1483e7 into voidzero-dev:main Oct 21, 2026
101 of 103 checks passed
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.

2 participants