Repository navigation
chore: remove unused npm test fixtures - #180933
Conversation
Retire uncalled fixture paths and their orphaned assertion module. Preserve the remaining npm-view callback semantics and all existing testcase files. Co-authored-by: vincentkoc <[email protected]>
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesRemoves unused npm fixture exports and their orphaned assertion module, then inlines the remaining metadata mock. Review scores
ProductKind: Test only · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR is a useful, focused cleanup with no actionable correctness findings; maintainer authorship also rules out automatic closure. Priority: P3 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherShared test utilities supply synthetic npm command results to plugin, hook, installer, and update tests; this change preserves the active consumers without changing production execution. flowchart LR
A[Installer tests] --> B[Shared npm fixtures]
B --> C[Mock command callback]
C --> D[Synthetic command result]
D --> E[Installer production owner]
E --> F[Existing assertions]
Technical reviewBest possible solution: Land the focused removal through the normal exact-head CI gates while retaining the existing installer suites. Do we have a high-confidence way to reproduce the issue? There is no reported production bug; source inspection confirms the removed fixture exports are unused and the active mock has preserved consumers. Is this the best way to solve the issue? This is the smallest complete cleanup: remove unreachable helpers and inline their sole surviving shared branch without replacing them with new machinery. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 47c1380a2a89. Provenance checked
TestingProof path: unit tests only. SecurityNone. EvidenceWhat I checked:
PR surfaceTests -97. Total -97 across 2 files. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 22, 2026, 3:44 PM ET / 19:44 UTC. |
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
Retire uncalled fixture paths and their orphaned assertion module. Preserve the remaining npm-view callback semantics and all existing testcase files. Co-authored-by: vincentkoc <[email protected]>
Related: #171994
What Problem This Solves
Package-install tests retain uncalled fixture paths and an assertion module whose last callers were retired.
User Impact
No user-visible change, configuration change, migration, or required action. No test case or executed assertion is removed.
Why This Change Was Made
Retire the unused npm-pack mock and install-assertion wrapper, their unique dependencies, and the now-unreachable assertion module. Inline the remaining npm-view mock into its existing owner instead of retaining a single-caller view/pack abstraction. This removes 97 net test-support lines across two files, with zero production changes or new helpers/options.
The view mock retains its async two-argument callback, command guard before metadata access, invocation-time metadata reads, exact error and JSON/property order, defaults, closure isolation, and implicit undefined return. The shared command-result constructor, failure cases, and integrity assertion are byte-identical. The last hook callers disappeared in
04a0bdfa025d23ae4831207b549d62c2c5a0094b; existing install/pack script-suppression assertions remain at their owning boundaries.Evidence
git diff --check. Fresh independent P0–P2 review completed with no findings.Hosted CI qualification
The original exact-head CI attempt failed: 67 terminal jobs, 36 successful / 29 skipped / 2 failed, totaling 6,684 cumulative job-seconds (not billing or a performance comparison). The failed leaf is
checks-node-changed-2; the other failed job is its downstream combined gate.Its three failures are existing update-CLI expectations: automatic service-Node refresh, nvm recovery, and the target-schema runtime-refusal reason. The same cases and signatures were observed on ancestral scheduled main in the Node-runtime job and the target-schema job. That checkout (
827aae9c0bf17f8f27b6db0447a68ba9e3e5b42d) is an ancestor of the actual tested base (9395f44dccb97c38cec985c0a480daabc43878d9). The tested merge's ordered parents and full tree were reconstructed and verified.The refusal producer, failed tests, runtime mocks, engine policy and lockfile are unchanged by this PR. The shared npm helper module does change, but its consumed
createCommandResultconstructor is byte-identical and pure; the changed view mock is not used by these cases. Earlier-main package-version and version-resolver drift was inspected; the failed scenarios use explicit target/engine fixtures. Historical grouping/cache settings differ, so this is ancestral execution plus scoped source attribution, not a claimed exact-base replay.The automatic failure table remains unknown because the newer scheduled-main run has no matching job name. This qualification uses the matching individual cases instead; neither the table nor the failed CI is relabeled green. An existing expectation repair is tracked separately in #180939; no duplicate fix or CI rerun was started here. The native inherited-failure route must still verify current writer authority, exact head, review, security, complete job accounting, and the retained recovery history.
This is offline preservation proof using synthetic package fixtures and mocked npm execution. No real package installation, operator Gateway, external account, device, or paid-provider run was performed or claimed. Hosted CI remains failed as documented above; native inherited-CI admission and independent review/security gates remain required.
Focused command and remaining failures
pnpm test src/plugins/install.npm-spec.test.ts src/hooks/install.test.ts src/infra/install-source-utils.test.ts --maxWorkers=1 pnpm deadcode:dependencies pnpm deadcode:unused-files pnpm deadcode:exportsBaseline:
1e56117f00f5858e025bdc7f4f396c7567ab32ee. Test runs used separate temporary roots and filesystem module caches.Each dead-code command returned exit 1 on both trees. Existing production unused exports/types and the unrelated unused
scripts/perf/doctor-metadata-retention.tsremain unresolved. Complete normalized findings are identical except for removingexpectInstallUsesIgnoreScriptsandmockNpmPackMetadataResultfrom the full-tree unused-export report. No failed result is represented as passing.Contributor credit: @vincentkoc.
Work sessions
Original session