Repository navigation
test(pnpm): isolate the metadata cache per test - #12628
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughIn ChangesTest Cache Isolation
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Suggested labels
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
PR Summary by Qodotest(pnpm): isolate pnpm metadata cache per test Description
Diagram
High-Level Assessment
Files changed (1)
|
Code Review by Qodo
1. Cache dir targets source
|
|
Code review by qodo was updated up to the latest commit 931b8ce |
The e2e test harness gave each test its own store dir but left the package-metadata cache at pnpm's shared default location. The mock registry serves fixture packuments without cache-control headers, so once one test cached a packument, a later test that changed that package's dist-tag via addDistTag could resolve a stale version from the shared cache. Set pnpm_config_cache_dir next to the per-test project dir so the metadata cache is isolated too.
931b8ce to
c12dd3e
Compare
|
Code review by qodo was updated up to the latest commit c12dd3e |
1 similar comment
|
Code review by qodo was updated up to the latest commit c12dd3e |
Summary
The pnpm CLI e2e test harness gave each test its own store dir but left the package-metadata cache at pnpm's shared default location. The mock registry (
pnpr) serves fixture packuments withoutcache-controlheaders, so once one test caused a packument to be cached, a later test in the same run that changed that package's dist-tag viaaddDistTagcould resolve a stale version from the shared cache.This surfaced as a reliable failure in
test/install/preferLockedPeerContexts.ts: it pins@pnpm.e2e/peer-c'slatesttag to1.0.0, but when co-scheduled with a sibling that resolvespeer-c(e.g.test/list.tsinstalling@pnpm.e2e/abc), the cached packument still reported the defaultlatest(2.0.0, out of^1.0.0range), so pnpm fell back to the highest in-range version1.0.1instead of the pinned1.0.0.Setting
pnpm_config_cache_dirnext to the per-test project dir isolates the metadata cache the same way the store already is, so a dist-tag change is always reflected.Reproduced locally (
jest --runTestsByPath test/list.ts test/install/preferLockedPeerContexts.tsfails before, passes after) and confirmedtest/install/minimumReleaseAge.ts(which asserts a cache-file location via apnpm-workspace.yamlcacheDir) still passes — the new env default flows through the existingfallback()so manifest-set /--config.cache-dirvalues continue to win.Squash Commit Body
Checklist
pacquet/port needed.Written by an agent (Claude Code, claude-opus-4-8).
Summary by CodeRabbit