Repository navigation
Conversation
|
Too many files changed for review (124 files, 100 file limit). Bypass the limit by tagging |
|
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 (6)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughThe PR consolidates Pacquet CLI end-to-end tests into one Cargo test binary. It registers suite modules in ChangesUnified Pacquet CLI test suite
Estimated code review effort: 5 (Critical) | ~120 minutes Possibly related issues
Possibly related PRs
Suggested labels: Suggested reviewers: ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 Qodoperf(cli): Build pacquet-cli end-to-end tests as a single suite target
AI Description
Diagram
High-Level Assessment
Files changed (124)
|
Code Review by Qodo
1. main.rs doc uses previously
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
There was a problem hiding this comment.
Actionable comments posted: 4
Note
Due to the large number of review comments, Critical, Major severity comments were prioritized as inline comments.
🟡 Minor comments (19)
pnpm/crates/cli/tests/suite/deploy.rs-496-499 (1)
496-499: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winConfirm the intended path on Line 498.
deploy_diris alreadyworkspace/legacy-deploy-no-lockfile. Line 498 therefore checksworkspace/legacy-deploy-no-lockfile/legacy-deploy-no-lockfile/node_modules. If the goal is to prove that deploy does not nest a second directory of the same name, the assertion is correct but the doubled segment is easy to misread. If the goal is something else, the assertion passes for the wrong reason and proves nothing.State the intent in the assertion message either way.
🐛 Proposed clarification
let deploy_dir = workspace.join("legacy-deploy-no-lockfile"); assert!(deploy_dir.join("node_modules/lib").exists()); - assert!(!deploy_dir.join("legacy-deploy-no-lockfile/node_modules").exists()); + assert!( + !deploy_dir.join("legacy-deploy-no-lockfile/node_modules").exists(), + "deploy must install at the target root, not in a nested directory of the same name", + ); assert!(!deploy_dir.join("pnpm-lock.yaml").exists());🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pnpm/crates/cli/tests/suite/deploy.rs` around lines 496 - 499, Clarify the intent of the second node_modules assertion in the deploy test by adding an explicit assertion message to the check involving deploy_dir.join("legacy-deploy-no-lockfile/node_modules"). Preserve the existing path and assertion behavior while making clear that it verifies no nested duplicate deploy directory is created.pnpm/crates/cli/tests/suite/cat_file.rs-79-89 (1)
79-89: 🔒 Security & Privacy | 🟡 Minor | ⚡ Quick winMake the path-traversal test assert the security property, not one specific error string.
The payload decodes to 16 bytes, not a 64-byte sha512 digest. The comment on line 87 states the command may fail either as "not found" or as an invalid decode, but the assertion accepts only
"File not found in store". If the CLI adds a digest-length check, this test fails while the security property still holds. The test also proves only that an error occurred, not that no path outside the store was read.Accept either failure reason, and assert that the store boundary was not crossed.
🔒️ Proposed change
#[test] fn should_prevent_path_traversal() { - let CommandTempCwd { mut pacquet, root: _root, .. } = + let CommandTempCwd { mut pacquet, root: _root, .. } = CommandTempCwd::init().add_mocked_registry(); // A crafted base64 payload that decodes to bytes resembling a path traversal like "../../etc/passwd". // "Li4vLi4vZXRjL3Bhc3N3ZA==" is base64 for "../../etc/passwd" let output = pacquet.arg("cat-file").arg("sha512-Li4vLi4vZXRjL3Bhc3N3ZA==").assert().failure(); let stderr = String::from_utf8_lossy(&output.get_output().stderr); - // It should fail to find the file (or decode as invalid depending on length), but it must NOT escape the store. - assert!(stderr.contains("File not found in store")); + // The decoded bytes are not a valid digest, so either rejection is correct. + // What must hold is that no path outside the store is read. + assert!( + stderr.contains("File not found in store") || stderr.contains("Invalid hash format"), + "unexpected failure reason: {stderr}", + ); + assert!(!stderr.contains("passwd"), "the traversal path must not be opened: {stderr}"); }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pnpm/crates/cli/tests/suite/cat_file.rs` around lines 79 - 89, Update should_prevent_path_traversal to accept either the existing “File not found in store” failure or an invalid digest/decode failure, while asserting the command remains unsuccessful. Add an assertion that the crafted traversal payload does not read or expose content outside the store, preserving the test’s focus on enforcing the store boundary rather than one exact error message.pnpm/crates/cli/tests/suite/restart.rs-110-125 (1)
110-125: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winThe Windows rationale comment contradicts the
#[cfg(unix)]gate.Lines 116-118 explain that the log path travels as a script argument so that "a Windows path's backslashes would be swallowed as string escapes" is avoided. Under
#[cfg(unix)]at Line 111 the test never compiles on Windows, so that precaution has no effect and the comment describes a situation the test cannot reach.The script body here uses
node, not a POSIX shell builtin, so the gate may be unnecessary. Either remove#[cfg(unix)]so the Windows-safe argument passing is actually exercised, or remove the Windows rationale from the comment.As per coding guidelines: comments "should describe current behavior rather than historical implementation details."
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pnpm/crates/cli/tests/suite/restart.rs` around lines 110 - 125, The restart_passes_args_to_scripts test’s Windows-path rationale conflicts with its #[cfg(unix)] gate. Remove the unnecessary Unix-only gate so the argument-passing behavior is exercised on Windows, while preserving the existing script construction and path-as-argument behavior.Source: Coding guidelines
pnpm/crates/cli/tests/suite/run_recursive.rs-112-143 (1)
112-143: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick winThe concurrency probe has a 1-second budget, which can flake under CI load.
Each script polls for its peer's marker at most 100 times with
sleep 0.01, so the total wait is about 1 second plus loop overhead. The test then runstest -f ../<peer>.started, which fails the script if the peer has not started. Under a loaded CI runner, spawning the secondshprocess can take longer than 1 second even when the runner is correctly parallel. The test then fails for a scheduling reason, not for a behavior regression.Raise the attempt count so the budget is several seconds. The test still fails fast when execution is genuinely serial, because a serial runner never writes the peer marker and the loop always exhausts.
🔧 Proposed fix to widen the wait budget
"build": format!( "touch ../{name}.started; \ attempts=0; \ - while [ ! -f ../{peer}.started ] && [ \"$attempts\" -lt 100 ]; do \ + while [ ! -f ../{peer}.started ] && [ \"$attempts\" -lt 1000 ]; do \ sleep 0.01; attempts=$((attempts + 1)); \ done; \ test -f ../{peer}.started" ),🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pnpm/crates/cli/tests/suite/run_recursive.rs` around lines 112 - 143, Increase the polling attempt limit in the waits_for_peer build-script closure from 100 to a several-second budget while keeping the 0.01-second sleep and existing marker validation unchanged. This should tolerate CI scheduling delays without changing the test’s failure behavior for genuinely serial execution.pnpm/crates/cli/tests/suite/repo.rs-18-32 (1)
18-32: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winKeep separate diagnostics for missing manifest and missing repository field.
repo_fails_without_package_jsonandrepo_fails_without_repository_fieldcurrently assert the sameERR_PNPM_NO_REPO_URLoutput, but a missing importer manifest is modeled elsewhere asERR_PNPM_NO_IMPORTER_MANIFEST_FOUND. Keep the two cases separate so this suite does not lock in an intentional parity divergence for missingpackage.json.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pnpm/crates/cli/tests/suite/repo.rs` around lines 18 - 32, The repo_fails_without_package_json test should assert the missing-manifest diagnostic ERR_PNPM_NO_IMPORTER_MANIFEST_FOUND instead of the missing-repository-field ERR_PNPM_NO_REPO_URL message. Keep repo_fails_without_repository_field asserting the repository-field error so the two scenarios retain distinct diagnostics.Source: Learnings
pnpm/crates/cli/tests/suite/login.rs-32-38 (1)
32-38: 🔒 Security & Privacy | 🟡 Minor | ⚡ Quick winPin
HOMEas well asXDG_CONFIG_HOME.Lines 33 and 87 set only
XDG_CONFIG_HOME.pnpm/crates/cli/tests/suite/logout.rslines 26-27 and 49-50 set bothXDG_CONFIG_HOMEandHOMEfor the same config-directory resolution. If the resolver falls back to$HOMEon any platform, or if a later change adds that fallback, theselogintests write auth credentials into the developer's real home directory. SetHOMEtoroot.path()here too.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pnpm/crates/cli/tests/suite/login.rs` around lines 32 - 38, Update the login test command setup at both config-directory environment assignments to set HOME to root.path() alongside XDG_CONFIG_HOME, matching the isolation used by the logout tests and preventing credentials from reaching the developer’s home directory.pnpm/crates/cli/tests/suite/link.rs-328-332 (1)
328-332: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winUse the junction-aware symlink helper for Windows compatibility.
NodeModuleLinker::linkcan create directory junctions on Windows, andfs::symlink_metadata(...).file_type().is_symlink()does not accept those. Importpacquet_testing_utils::fs::is_symlink_or_junctioninpnpm/crates/cli/tests/suite/link.rsand assertis_symlink_or_junction(&linked).expect("inspect link")instead.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pnpm/crates/cli/tests/suite/link.rs` around lines 328 - 332, Update the link assertion in the test to import and use pacquet_testing_utils::fs::is_symlink_or_junction, calling it with linked and expecting successful inspection, instead of checking file_type().is_symlink() via symlink_metadata. Preserve the existing failure message.Source: Path instructions
pnpm/crates/cli/tests/suite/fetch.rs-161-174 (1)
161-174: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winMake the GVS fixture assertion fail early.
After writing the workspace YAML, assert that the replaced content differs from the original string before running
fetch. A no-op write currently still callsfetch, then the test can fail later with a message pointing at the fetch behavior instead of the fixture change.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pnpm/crates/cli/tests/suite/fetch.rs` around lines 161 - 174, Update the workspace YAML setup around yaml_path so it retains the original content, verifies the replacement changed it, and only then writes the modified YAML. Make this assertion occur before pacquet_at(...).with_arg("fetch"), so a missing enableGlobalVirtualStore fixture change fails immediately.pnpm/crates/cli/tests/suite/install_runtimes.rs-306-330 (1)
306-330: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winAssert the resolved Node version; the test currently proves only that the install exits 0.
explicit_node_version_takes_priority_over_the_manifest_runtimesetsnodeVersion: 20.0.0and a conflictingdevEngines.runtimeof^22.0.0, then only calls.assert().success(). Nothing checks which version won. If precedence regressed and the manifest runtime^22.0.0were selected,engineStrict: truewithengines.node: "<21"would be the only thing that could fail the install — andonFail: ignoremay suppress that path. The test then passes for the wrong reason.Add an assertion on the observable outcome, for example the resolved runtime recorded in
pnpm-lock.yamlor the absence of anynode@runtime:^22entry.💚 Suggested assertion
command(&workspace).with_arg("install").assert().success(); + let lockfile = fs::read_to_string(workspace.join("pnpm-lock.yaml")).unwrap(); + assert!( + !lockfile.contains("node@runtime:"), + "the explicit nodeVersion must win over the devEngines runtime:\n{lockfile}", + ); }Replace the assertion with the exact artifact that records the chosen version if the lockfile is not the right place.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pnpm/crates/cli/tests/suite/install_runtimes.rs` around lines 306 - 330, Strengthen explicit_node_version_takes_priority_over_the_manifest_runtime by asserting the selected Node 20.0.0 runtime in the observable install artifact, such as the corresponding pnpm-lock.yaml entry. Ensure the test also verifies that the conflicting node@runtime:^22.0.0 runtime is not selected, rather than relying only on command success.Source: Path instructions
pnpm/crates/cli/tests/suite/list.rs-787-791 (1)
787-791: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winUse
enable_gvs_in_workspace_yamlfor the global-virtual-store toggle.
list.rshas its ownString::replace(...)branch without checking that the fixture changed. IfenableGlobalVirtualStore: falseis missing, the install runs without GVS and the later path assertions no longer cover the intended case. Callcrate::_utils::enable_gvs_in_workspace_yaml(&workspace, "privateHoistPattern: '*'\n")instead, or add the same assert to the inline replacement.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pnpm/crates/cli/tests/suite/list.rs` around lines 787 - 791, The workspace YAML update in the list test should use the shared enable_gvs_in_workspace_yaml helper instead of the unchecked String::replace branch. Replace the inline read/replace/write logic with crate::_utils::enable_gvs_in_workspace_yaml(&workspace, "privateHoistPattern: '*'\n") so the fixture change is validated before running the GVS assertions.Source: Path instructions
pnpm/crates/cli/tests/suite/global.rs-1-3 (1)
1-3: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winCorrect the module doc: no
update -gtest exists here.The module doc lists
update -gamong the covered commands. This file contains tests foradd -g,remove -g,list -g, andoutdated -gonly.📝 Proposed doc fix
//! End-to-end tests for global package management (`add -g`, `remove -g`, -//! `update -g`, `list -g`). The happy paths need the mocked registry and +//! `list -g`, `outdated -g`). The happy paths need the mocked registry and //! create real symlinks / bin shims, so they are Unix-gated.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pnpm/crates/cli/tests/suite/global.rs` around lines 1 - 3, Update the module-level documentation in the global test module to remove “update -g” and list the commands actually covered: add -g, remove -g, list -g, and outdated -g.pnpm/crates/cli/tests/suite/global.rs-10-14 (1)
10-14: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick winGate the Path imports for non-Unix global tests.
This module has
#[cfg(unix)]tests that usePath/PathBuf, butglobal_list_empty()andglobal_add_pnpm_is_rejected()are not Unix-gated and do not use either type. On--all-targets, the Cargo Windows target is built in CI, so gated imports in a non-gated module can triggerunused_importsunder-D warnings. Gate these imports under#[cfg(unix)]unless these functions also need to run on Windows.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pnpm/crates/cli/tests/suite/global.rs` around lines 10 - 14, Gate the Path and PathBuf imports in the global test module with cfg(unix), while keeping fs and Command available to the non-Unix tests global_list_empty() and global_add_pnpm_is_rejected().pnpm/crates/cli/tests/suite/package_manager_check.rs-548-556 (1)
548-556: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick winClear Windows home/profile env vars in the package manager check helper.
package_manager_check.rsruns under the Windows CI matrix, butrun()does not clearUSERPROFILEorAPPDATA; Windows reads.npmrcfrom those locations rather thanHOME. Add the same env isolation used for the store-path test so these assertions cannot depend on the runner/user profile.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pnpm/crates/cli/tests/suite/package_manager_check.rs` around lines 548 - 556, The run helper must isolate Windows profile-based configuration as well as HOME and XDG_CONFIG_HOME. Update run to clear or override USERPROFILE and APPDATA using the same environment isolation approach as the store-path test, while preserving any values explicitly configured by the test.pnpm/crates/cli/tests/suite/self_update.rs-6-9 (1)
6-9: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winUpdate the cross-reference to the new suite layout.
The comment points at
tests/with.rs. This PR moves that file totests/suite/with.rs.✏️ Proposed fix
-//! the mock registry doesn't serve `pnpm` / `@pnpm/exe` (see `tests/with.rs` -//! for the same limitation), so the command is expected to fail at the +//! the mock registry doesn't serve `pnpm` / `@pnpm/exe` (see +//! `tests/suite/with.rs` for the same limitation), so the command is expected to fail at the🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pnpm/crates/cli/tests/suite/self_update.rs` around lines 6 - 9, Update the cross-reference in the self-update test comment to point from tests/with.rs to tests/suite/with.rs, leaving the surrounding explanation unchanged.pnpm/crates/cli/tests/suite/search.rs-45-50 (1)
45-50: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
unreachable_registrycan race with another listener on the same port.The function binds an ephemeral port, records it, then drops the listener. The port is free from that moment. Any other process on the machine, including a
mockitoserver started by a concurrent test in this suite, can bind the same port beforefails_on_a_network_failuresends its request. The test then gets a real HTTP response and theNetwork request failedassertion fails.Use a port that never accepts a connection.
star_tests.rsandunstar_tests.rsalready usehttp://127.0.0.1:9/(the discard port) for the same purpose.🐛 Proposed fix
-fn unreachable_registry() -> String { - let listener = TcpListener::bind("127.0.0.1:0").expect("bind a probe socket"); - let port = listener.local_addr().expect("read the probe socket address").port(); - drop(listener); - format!("http://127.0.0.1:{port}/") -} +/// Port 9 (discard) never accepts a TCP connection on loopback, so the +/// request fails deterministically instead of racing a freed ephemeral port. +fn unreachable_registry() -> String { + "http://127.0.0.1:9/".to_string() +}Remove the now-unused
std::net::TcpListenerimport.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pnpm/crates/cli/tests/suite/search.rs` around lines 45 - 50, Update unreachable_registry to return the fixed discard-port URL http://127.0.0.1:9/ instead of binding and releasing an ephemeral TcpListener, ensuring the target cannot be claimed by another test. Remove the now-unused TcpListener import.pnpm/crates/cli/tests/suite/sbom.rs-6-39 (1)
6-39: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winReport the fixture path when the fixture directory is missing.
copy_fixtureresolves either the local fixture or the siblingpnpm11fixture tree; failures fromfs::read_dir(&fixture_dir).expect(...)currently do not tell test failures which path was tried. Includefixture_dir.display()in the panic message when the directory cannot be read.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pnpm/crates/cli/tests/suite/sbom.rs` around lines 6 - 39, Update copy_fixture so the fs::read_dir(&fixture_dir) failure message includes fixture_dir.display(), identifying the resolved fixture path that could not be read while preserving the existing panic behavior.pnpm/crates/cli/tests/suite/why.rs-133-151 (1)
133-151: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
why_depth_limits_outputdoes not prove that--depthlimits output.The test computes
output_fullandoutput_depth1, then asserts only that each output contains expected entries. It never asserts thatdepth1_stdoutomits something present infull_stdout. The test passes even if--depth 1is ignored entirely. The test also never asserts that either command succeeded.Add a negative assertion for the content that depth 1 must exclude, and assert both exit statuses.
♻️ Proposed strengthening
let full_stdout = String::from_utf8_lossy(&output_full.stdout); let depth1_stdout = String::from_utf8_lossy(&output_depth1.stdout); + assert!(output_full.status.success(), "why should succeed: {full_stdout}"); + assert!(output_depth1.status.success(), "why --depth 1 should succeed: {depth1_stdout}"); assert!(full_stdout.contains("test-why"), "full output shows project: {full_stdout}"); assert!(depth1_stdout.contains(DEP), "depth=1 output still shows the target: {depth1_stdout}"); assert!(depth1_stdout.contains(PKG), "depth=1 output shows direct parent: {depth1_stdout}"); + assert!( + !depth1_stdout.contains("test-why"), + "depth=1 must cut the importer beyond the direct parent: {depth1_stdout}", + );Confirm the expected depth-1 boundary against the command implementation before adopting the negative assertion.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pnpm/crates/cli/tests/suite/why.rs` around lines 133 - 151, Strengthen why_depth_limits_output by asserting both why command invocations succeed, then compare the outputs to verify depth 1 excludes content that appears in the unrestricted output. Confirm the command’s depth-1 boundary and use an entry that should be omitted at that depth, while retaining the existing assertions for the target and direct parent.Source: Path instructions
pnpm/crates/cli/tests/suite/undeprecate.rs-76-84 (1)
76-84: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick winPin a registry for the validation-only failure tests.
fails_when_package_is_not_providedandfails_when_message_is_providedpassregistry: None, and the workspace fromCommandTempCwd::init()contains no.npmrc. The CLI therefore resolves the default public registry. Both tests pass today only because argument validation runs before any request. If validation ever moves after config or network setup, these tests issue an outbound request to the public registry from CI.The rest of this cohort already pins an unreachable registry for validation-only failures, for example
http://localhost:4873/inpnpm/crates/cli/tests/suite/stage.rsat Lines 316 and 326. Apply the same pattern here.🛡️ Proposed change
- let output = run_undeprecate(&workspace, &auth_file, None, &[]); + let output = + run_undeprecate(&workspace, &auth_file, Some("http://localhost:4873/"), &[]);- let output = run_undeprecate(&workspace, &auth_file, None, &["foo", "extra-message"]); + let output = run_undeprecate( + &workspace, + &auth_file, + Some("http://localhost:4873/"), + &["foo", "extra-message"], + );Also applies to: 107-115
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pnpm/crates/cli/tests/suite/undeprecate.rs` around lines 76 - 84, Update the validation-only tests fails_when_package_is_not_provided and fails_when_message_is_provided to pass an unreachable localhost registry, such as http://localhost:4873/, instead of None when calling run_undeprecate. Keep their existing assertions and validation scenarios unchanged.pnpm/crates/cli/tests/suite/undeprecate.rs-15-19 (1)
15-19: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winMove the duplicated
empty_auth_filehelper into the shared suite utilities. Eight test modules define the same helper by name and content; add a single public definition topnpm/crates/cli/tests/suite/_utils/mod.rsand replace the local definitions in the affected modules.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pnpm/crates/cli/tests/suite/undeprecate.rs` around lines 15 - 19, The duplicated empty_auth_file helper should be centralized in the shared suite utilities. Add one public empty_auth_file definition to pnpm/crates/cli/tests/suite/_utils/mod.rs, then remove the local definitions and use the shared helper in pnpm/crates/cli/tests/suite/undeprecate.rs lines 15-19 and pnpm/crates/cli/tests/suite/team.rs lines 14-18; apply the same replacement to the other six affected test modules.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pnpm/crates/cli/tests/suite/outdated.rs`:
- Around line 55-56: Update the workspace-manifest setup in the outdated test
cases to read the existing pnpm-workspace.yaml, append the packages
configuration, and write it back instead of replacing it. Apply this to each
fs::write call identified in the diff, reusing the existing helper pattern and
preserving the storeDir and cacheDir entries created by add_mocked_registry().
In `@pnpm/crates/cli/tests/suite/publish.rs`:
- Line 270: Update the publish tests in pnpm/crates/cli/tests/suite/publish.rs
at lines 270-270, 301-301, and 322-322: retain each registry mock, configure it
with an expectation of exactly one request, and call its assert method after the
corresponding command assertion. Ensure the rejection mock verifies the failing
publish reached the registry, while the JSON-success and reporter-suppression
mocks each verify one upload request.
In `@pnpm/crates/cli/tests/suite/update_changeset.rs`:
- Around line 372-387: The test
update_changeset_supports_a_package_outside_a_workspace must preserve the
fixture’s isolated store and cache configuration. Replace only the
workspace-defining settings in pnpm-workspace.yaml, or rewrite the file while
retaining storeDir, cacheDir, and enableGlobalVirtualStore: false, instead of
removing the entire YAML before running install.
In `@pnpm/crates/cli/tests/suite/version.rs`:
- Around line 115-120: Update pacquet_recursive_version to use the shared
test_command helper with the temp root from CommandTempCwd::init() before
changing directories and invoking pnpm version, rather than constructing an
independent Command. Preserve pacquet_version’s version argument handling and
remove the duplicated unisolated command setup.
---
Minor comments:
In `@pnpm/crates/cli/tests/suite/cat_file.rs`:
- Around line 79-89: Update should_prevent_path_traversal to accept either the
existing “File not found in store” failure or an invalid digest/decode failure,
while asserting the command remains unsuccessful. Add an assertion that the
crafted traversal payload does not read or expose content outside the store,
preserving the test’s focus on enforcing the store boundary rather than one
exact error message.
In `@pnpm/crates/cli/tests/suite/deploy.rs`:
- Around line 496-499: Clarify the intent of the second node_modules assertion
in the deploy test by adding an explicit assertion message to the check
involving deploy_dir.join("legacy-deploy-no-lockfile/node_modules"). Preserve
the existing path and assertion behavior while making clear that it verifies no
nested duplicate deploy directory is created.
In `@pnpm/crates/cli/tests/suite/fetch.rs`:
- Around line 161-174: Update the workspace YAML setup around yaml_path so it
retains the original content, verifies the replacement changed it, and only then
writes the modified YAML. Make this assertion occur before
pacquet_at(...).with_arg("fetch"), so a missing enableGlobalVirtualStore fixture
change fails immediately.
In `@pnpm/crates/cli/tests/suite/global.rs`:
- Around line 1-3: Update the module-level documentation in the global test
module to remove “update -g” and list the commands actually covered: add -g,
remove -g, list -g, and outdated -g.
- Around line 10-14: Gate the Path and PathBuf imports in the global test module
with cfg(unix), while keeping fs and Command available to the non-Unix tests
global_list_empty() and global_add_pnpm_is_rejected().
In `@pnpm/crates/cli/tests/suite/install_runtimes.rs`:
- Around line 306-330: Strengthen
explicit_node_version_takes_priority_over_the_manifest_runtime by asserting the
selected Node 20.0.0 runtime in the observable install artifact, such as the
corresponding pnpm-lock.yaml entry. Ensure the test also verifies that the
conflicting node@runtime:^22.0.0 runtime is not selected, rather than relying
only on command success.
In `@pnpm/crates/cli/tests/suite/link.rs`:
- Around line 328-332: Update the link assertion in the test to import and use
pacquet_testing_utils::fs::is_symlink_or_junction, calling it with linked and
expecting successful inspection, instead of checking file_type().is_symlink()
via symlink_metadata. Preserve the existing failure message.
In `@pnpm/crates/cli/tests/suite/list.rs`:
- Around line 787-791: The workspace YAML update in the list test should use the
shared enable_gvs_in_workspace_yaml helper instead of the unchecked
String::replace branch. Replace the inline read/replace/write logic with
crate::_utils::enable_gvs_in_workspace_yaml(&workspace, "privateHoistPattern:
'*'\n") so the fixture change is validated before running the GVS assertions.
In `@pnpm/crates/cli/tests/suite/login.rs`:
- Around line 32-38: Update the login test command setup at both
config-directory environment assignments to set HOME to root.path() alongside
XDG_CONFIG_HOME, matching the isolation used by the logout tests and preventing
credentials from reaching the developer’s home directory.
In `@pnpm/crates/cli/tests/suite/package_manager_check.rs`:
- Around line 548-556: The run helper must isolate Windows profile-based
configuration as well as HOME and XDG_CONFIG_HOME. Update run to clear or
override USERPROFILE and APPDATA using the same environment isolation approach
as the store-path test, while preserving any values explicitly configured by the
test.
In `@pnpm/crates/cli/tests/suite/repo.rs`:
- Around line 18-32: The repo_fails_without_package_json test should assert the
missing-manifest diagnostic ERR_PNPM_NO_IMPORTER_MANIFEST_FOUND instead of the
missing-repository-field ERR_PNPM_NO_REPO_URL message. Keep
repo_fails_without_repository_field asserting the repository-field error so the
two scenarios retain distinct diagnostics.
In `@pnpm/crates/cli/tests/suite/restart.rs`:
- Around line 110-125: The restart_passes_args_to_scripts test’s Windows-path
rationale conflicts with its #[cfg(unix)] gate. Remove the unnecessary Unix-only
gate so the argument-passing behavior is exercised on Windows, while preserving
the existing script construction and path-as-argument behavior.
In `@pnpm/crates/cli/tests/suite/run_recursive.rs`:
- Around line 112-143: Increase the polling attempt limit in the waits_for_peer
build-script closure from 100 to a several-second budget while keeping the
0.01-second sleep and existing marker validation unchanged. This should tolerate
CI scheduling delays without changing the test’s failure behavior for genuinely
serial execution.
In `@pnpm/crates/cli/tests/suite/sbom.rs`:
- Around line 6-39: Update copy_fixture so the fs::read_dir(&fixture_dir)
failure message includes fixture_dir.display(), identifying the resolved fixture
path that could not be read while preserving the existing panic behavior.
In `@pnpm/crates/cli/tests/suite/search.rs`:
- Around line 45-50: Update unreachable_registry to return the fixed
discard-port URL http://127.0.0.1:9/ instead of binding and releasing an
ephemeral TcpListener, ensuring the target cannot be claimed by another test.
Remove the now-unused TcpListener import.
In `@pnpm/crates/cli/tests/suite/self_update.rs`:
- Around line 6-9: Update the cross-reference in the self-update test comment to
point from tests/with.rs to tests/suite/with.rs, leaving the surrounding
explanation unchanged.
In `@pnpm/crates/cli/tests/suite/undeprecate.rs`:
- Around line 76-84: Update the validation-only tests
fails_when_package_is_not_provided and fails_when_message_is_provided to pass an
unreachable localhost registry, such as http://localhost:4873/, instead of None
when calling run_undeprecate. Keep their existing assertions and validation
scenarios unchanged.
- Around line 15-19: The duplicated empty_auth_file helper should be centralized
in the shared suite utilities. Add one public empty_auth_file definition to
pnpm/crates/cli/tests/suite/_utils/mod.rs, then remove the local definitions and
use the shared helper in pnpm/crates/cli/tests/suite/undeprecate.rs lines 15-19
and pnpm/crates/cli/tests/suite/team.rs lines 14-18; apply the same replacement
to the other six affected test modules.
In `@pnpm/crates/cli/tests/suite/why.rs`:
- Around line 133-151: Strengthen why_depth_limits_output by asserting both why
command invocations succeed, then compare the outputs to verify depth 1 excludes
content that appears in the unrestricted output. Confirm the command’s depth-1
boundary and use an entry that should be omitted at that depth, while retaining
the existing assertions for the target and direct parent.
---
Nitpick comments:
In `@pnpm/crates/cli/tests/suite/approve_builds.rs`:
- Around line 33-37: Move the shared pacquet constructor from approve_builds.rs
into pnpm/crates/cli/tests/suite/_utils/ and reuse it there, consolidating
equivalent constructors such as auth.rs::pacquet_at, bugs.rs::pacquet_at,
catalog.rs::pacquet, and audit.rs::pacquet_cmd as applicable. In
pnpm/crates/cli/tests/suite/audit.rs lines 1077-1095, move nerf, stdout, stderr,
assert_success, and assert_failure into _utils and update callers; consolidate
the equivalent nerf in dist_tag.rs and preserve the existing
canonicalize/list.rs::canonical relationship without inventing unrelated
changes.
In `@pnpm/crates/cli/tests/suite/cache.rs`:
- Line 10: Replace the repeated literal v11/metadata path construction in the
cache tests, including the import test path, with
cache_dir.join(pacquet_resolving_npm_resolver::mirror::ABBREVIATED_META_DIR).
Update all identified sites while preserving the surrounding test behavior.
In `@pnpm/crates/cli/tests/suite/cat_index.rs`:
- Line 11: Remove the redundant self-rebinding statement let pacquet = pacquet;
from the affected test, leaving the destructured pacquet field available
directly for the remaining test logic.
In `@pnpm/crates/cli/tests/suite/custom_fetchers.rs`:
- Around line 12-23: Move the shared pacquet_at, write_manifest, and
installed_version helpers from custom_fetchers.rs and custom_resolvers.rs into
suite/_utils, exposing them through the existing _utils module declared by
suite/main.rs. Remove the duplicate local definitions and import the shared
helpers in both test modules, preserving their current behavior and signatures.
In `@pnpm/crates/cli/tests/suite/dedupe.rs`:
- Around line 59-60: Extract the repeated
Command::cargo_bin("pnpm").expect(...).with_current_dir(...) construction into a
local helper, such as pacquet_cmd, in the dedupe test module. Add the required
std::path::Path import, define the helper to accept the workspace path, and
replace all seven inline constructions while preserving their existing behavior.
- Around line 269-272: Review the inline NDJSON parsing in the test and reuse
_utils::ndjson_records(&Output) if strict validation of every stderr line is not
required. If the test intentionally requires all stderr lines to be valid JSON,
retain the existing serde_json parsing and expectation unchanged.
In `@pnpm/crates/cli/tests/suite/dist_tag.rs`:
- Around line 626-645: Guard both unreachable-registry tests, rm_refuses_latest
and the test around the later dist-tag case, with the same fetch retry and fetch
timeout environment settings used by
ls_redacts_registry_credentials_on_network_error. Extend or reuse the
appropriate run_dist_tag helper so these tests fail fast if validation
regresses, and invoke the guarded/offline variant at both call sites.
- Around line 50-72: The repeated test setup around CommandTempCwd::init,
mockito::Server, the registry URL, and configure should be extracted into a
small fixture helper returning the workspace, server, and auth file, then reused
by the dist-tag tests while preserving existing setup behavior. This is optional
and may be deferred if it would expand the suite-consolidation scope.
In `@pnpm/crates/cli/tests/suite/dlx.rs`:
- Around line 47-48: Update the doc comments for both Unix-gated dlx tests near
their #[cfg(unix)] attributes to state why they are Unix-only, or replace the
gates with cfg_attr-based Windows ignores carrying that reason. Keep the
existing fixture and regression documentation unchanged.
In `@pnpm/crates/cli/tests/suite/exec_recursive.rs`:
- Around line 12-47: Move write_workspace and summary_statuses from
exec_recursive.rs into suite/_utils/mod.rs, including both the name-list and
manifest-map write_workspace variants, then import and reuse them. Remove the
duplicate summary_statuses from run_recursive.rs; update exec_recursive.rs,
list.rs, and pack_recursive.rs at the specified ranges to delete local helper
definitions and use the shared variants.
In `@pnpm/crates/cli/tests/suite/fetch.rs`:
- Around line 19-22: Update virtual_dep to reuse crate::_utils::slot for
constructing the virtual-store slot instead of duplicating the name
transformation and hard-coded 100.0.0 version; pass the resulting slot into the
existing helper for joining it to the workspace path, using the _utils API for
wrapping an existing workspace path as needed.
- Around line 7-9: Centralize suite test helpers in crate::_utils: in
pnpm/crates/cli/tests/suite/fetch.rs:7-9 and dry_run.rs:14-16, remove each local
pacquet_at and import the shared command builder; in
install_runtimes.rs:615-617, remove command and use that builder. In
exec.rs:8-15, move write_executable into crate::_utils behind #[cfg(unix)], then
update run.rs to use the shared helper.
In `@pnpm/crates/cli/tests/suite/find_hash.rs`:
- Line 45: Replace the pre-assertion println! diagnostics in the find_hash test
suite with eprintln!, including the output statements at both diagnostic
locations, while preserving their existing messages and values.
- Line 65: Update the find-hash test invocation in the relevant test function to
generate the 128-character hexadecimal input programmatically instead of
embedding the long literal, while preserving the existing failure assertion and
argument value.
- Around line 101-106: Move the base64 Engine and STANDARD as BASE64 import from
inside parse_hash to the module-level imports at the top of find_hash.rs,
leaving the hash decoding and encoding logic unchanged.
In `@pnpm/crates/cli/tests/suite/global.rs`:
- Around line 229-230: Replace the target directory constructed from
CARGO_MANIFEST_DIR in the package_dir setup with the guaranteed
CARGO_TARGET_TMPDIR environment value, while preserving the existing
tempfile::tempdir_in behavior.
In `@pnpm/crates/cli/tests/suite/link.rs`:
- Around line 6-16: Extract the repeated setup in the link tests into a
link_fixture() helper that initializes CommandTempCwd, adds the mocked registry,
destructures mock_instance, and writes the standard test-project package.json.
Add a write_target(root, name) helper for creating target directories and
writing their manifests, then update the affected tests to use these helpers
while preserving each test’s variable setup and behavior.
- Around line 41-44: Add the same stderr/error-message assertion used by
link_fails_without_paths to ln_alias_fails_without_paths after checking
output.status, verifying the output contains “You must provide a parameter”
before cleanup.
In `@pnpm/crates/cli/tests/suite/list.rs`:
- Around line 409-430: Update the test helper run_ok to print each rendered
command output with eprintln! using display formatting before returning it, so
all multiline tree assertions—including the listed assert_eq! call sites—show
readable newlines and box-drawing characters on failure. Keep the existing
return value and assertion behavior unchanged.
In `@pnpm/crates/cli/tests/suite/lockfile_resolution_reuse.rs`:
- Line 280: Remove the dbg! calls near the lockfile resolution assertions,
including those referencing lockfile.snapshots and lockfile.packages. Preserve
useful failure diagnostics by incorporating the relevant values into the
assertion messages instead of printing during successful runs.
- Around line 55-63: Extract the duplicated `.npmrc` dead-registry rewrite into
a shared `kill_the_registry(npmrc_path: &Path)` helper next to
`dead_registry_url`. Replace the identical blocks at each affected call site
with this helper, preserving the existing filtering, formatting, and failure
behavior.
- Around line 144-153: Strengthen the test around dead_registry_url and the
second install to verify that no network resolution occurred, rather than
relying solely on the released port being refused. Assert the CLI/install result
or recorded resolution state using the existing test symbols so a reclaimed port
and successful live-server response causes the test to fail.
- Around line 281-306: The lockfile assertions in the test, including the
earlier assertions around lines 66–69 and 221–223, need actionable failure
diagnostics. Replace the bare assert! calls with messages naming whether the
wanted or current lockfile failed and rendering the relevant snapshots,
optional-dependency map, or packages map; remove the dbg!(&workspace) and log
the needed structure through assertion messages instead. Keep the existing
conditions and workspace existence assertion behavior unchanged.
- Around line 15-17: Centralize the shared pacquet_at helper in
pnpm/crates/cli/tests/suite/_utils/mod.rs, remove the local definition from
lockfile_resolution_reuse.rs, and import the shared helper there. In
pnpm/crates/cli/tests/suite/find_hash.rs, replace each inline pnpm Command
construction and current_dir setup at lines 40-41, 63-64, and 108-109 with
pacquet_at(&workspace) calls.
- Around line 408-413: Extract the duplicated manifest timestamp update from the
test flow into a helper such as bump_mtime(path: &Path), and replace both
occurrences near the reused-manifest and corresponding later setup with calls to
it. Keep the existing now-plus-two-seconds timestamp, writable open, set_times,
and failure expectation, and document in the helper why the future mtime is
required.
In `@pnpm/crates/cli/tests/suite/login.rs`:
- Around line 65-67: Update the headless login test in the relevant test
function to read auth.ini after the flow completes and assert that the
cli-headless-token from the done endpoint was stored, matching the verification
pattern used by the logout test; otherwise narrow the doc comment to only
describe the behaviors currently asserted.
In `@pnpm/crates/cli/tests/suite/logout.rs`:
- Around line 48-53: Update the not-logged-in test’s registry argument in the
logout test setup to use the local mockito server URL, matching the first test’s
server configuration, instead of the public npm registry URL. Keep the existing
logout invocation and assertions unchanged.
- Around line 12-14: Update the mock setup in the logout test to construct the
DELETE path using the existing TOKEN constant instead of repeating its literal
value. Keep the endpoint format unchanged so the mock continues matching the
request and mock.assert() remains valid.
In `@pnpm/crates/cli/tests/suite/nested_file_dependencies.rs`:
- Around line 121-128: Replace the byte-level lockfile.contains assertions in
the nested dependency test with parsed-structure checks using
pacquet_lockfile::Lockfile, matching lockfile_resolution_reuse.rs. If exact pnpm
output formatting is intentionally required, retain the assertions and document
that requirement in the test’s doc comment.
- Around line 87-94: Extract the duplicated workspace YAML append logic into
_utils::add_workspace_packages(workspace: &Path, globs: &[&str]), and update
both suite modules to call it while preserving their respective glob values.
Resolve the sibling-module write_manifest name collision by either centralizing
the helpers in _utils or renaming one function to distinguish its input type and
purpose.
In `@pnpm/crates/cli/tests/suite/override_version_references.rs`:
- Around line 102-110: Extract the diagnostic unwrapping logic from the test
suites into a shared unwrap_diagnostic helper in _utils/mod.rs, including
whitespace collapsing and removal of the │ continuation prefix. Replace the
local stderr normalization in override_version_references and the equivalent
logic in package_manager_check with calls to this shared helper.
In `@pnpm/crates/cli/tests/suite/pack.rs`:
- Around line 74-84: Add a second workspace package in the pack test fixture
with its own dependencies, then extend the assertions near the existing
packed-manifest checks to verify those dependencies remain intact. Keep the
existing pkg hook behavior and assertions, ensuring the test exercises both the
matching and non-matching manifest.name branches.
In `@pnpm/crates/cli/tests/suite/package_manager_check.rs`:
- Around line 574-577: Remove the dbg!(&output) call from the command execution
helper after command.args(args).output(), leaving the existing output return and
assert_success/assert_failure diagnostics unchanged.
In `@pnpm/crates/cli/tests/suite/ping.rs`:
- Around line 27-37: Move the shared pacquet_at and empty_auth_file helpers from
the ping test module into the suite’s _utils/mod.rs, preserving their current
behavior and signatures. Update ping.rs and the other suite modules that define
equivalent pacquet or empty_auth_file helpers to import and reuse the
centralized implementations, removing the duplicates.
In `@pnpm/crates/cli/tests/suite/pnpr_install.rs`:
- Around line 284-322: Replace the local workspace helpers in pnpr_install.rs,
including write_workspace_project, replace_workspace_dependency,
read_workspace_lockfile, and read_workspace_current_lockfile, with the shared
WorkspaceFixture from _utils/mod.rs. Add the missing dependency-form helper
there if needed, then update the test to use WorkspaceFixture::project(),
::wanted(), ::current(), importer(), snapshot_entries(), and project
node_modules helpers, preserving the existing fixture behavior.
In `@pnpm/crates/cli/tests/suite/pnpx_alias.rs`:
- Around line 24-26: Update the assertion block in the pnpx alias test to print
both multiline values, pnpx_help and dlx_help, immediately before assert_eq!, so
failures expose readable help output while preserving the existing comparison.
In `@pnpm/crates/cli/tests/suite/prefix.rs`:
- Around line 22-23: Remove the unconditional dbg!(&output) diagnostics from the
affected test cases: prefix.rs lines 22-23 and 82-83, and root.rs lines 24, 45,
and 60. Their existing rendered stdout/stderr assertions provide sufficient
failure diagnostics; leave root_matches_pnpm_from_a_workspace_subdir unchanged.
In `@pnpm/crates/cli/tests/suite/publish.rs`:
- Line 29: Remove the implementation-restating rustdoc comment above the publish
test helper; retain documentation only for public item contracts and do not
replace it with another comment.
In `@pnpm/crates/cli/tests/suite/remove.rs`:
- Line 29: Remove the fixed diagnostic eprintln! calls in the remove test at the
referenced assertions, including the logs near dependency removal and the other
listed locations. Keep the underlying simple scalar equality assertions
unchanged, retaining logging only where it provides meaningful multi-line or
complex-state failure context.
In `@pnpm/crates/cli/tests/suite/restart.rs`:
- Around line 10-11: Use consistent POSIX-shell platform gating for all restart
tests, including restart_runs_stop_restart_start_scripts,
restart_fails_when_stop_script_fails, and
restart_fails_when_restart_script_fails. Replace the silent #[cfg(unix)] gate
with the existing cfg_attr(target_os = "windows", ignore = "...") pattern and
preserve the visible reason describing the POSIX shell dependency.
In `@pnpm/crates/cli/tests/suite/root.rs`:
- Around line 15-17: Remove the duplicate canonicalize helper from root.rs and
reuse the shared helper in _utils/mod.rs for the affected tests, preserving the
existing doc comment that explains the CLI dunce::canonicalize behavior. Update
callers as needed to use the shared PathBuf-returning helper, while retaining
list.rs’s required String conversion behavior.
In `@pnpm/crates/cli/tests/suite/run_recursive.rs`:
- Around line 14-24: Move write_workspace from
pnpm/crates/cli/tests/suite/run_recursive.rs (lines 14-24) into _utils/mod.rs,
keeping it distinct from list.rs::write_workspace, then import it in
run_recursive.rs and publish_recursive.rs (lines 20-30), removing the local
publish_recursive.rs copy. Move write_executable from run_recursive.rs (lines
26-31) into _utils/mod.rs behind #[cfg(unix)], import it in run_recursive.rs and
run.rs, and remove the local run.rs copy.
In `@pnpm/crates/cli/tests/suite/runtime.rs`:
- Around line 6-19: Update the assertions in the reporter loop to include the
current reporter variant in both failure messages. Use the existing reporter
value, including the None case, so failures identify which configuration
produced the unexpected status or stderr.
In `@pnpm/crates/cli/tests/suite/sbom.rs`:
- Around line 828-841: Remove the duplicate test function
sbom_dev_flag_includes_only_dev from the SBOM test suite; retain
sbom_dev_flag_excludes_prod as the single coverage for --dev including the dev
dependency and excluding the production dependency.
In `@pnpm/crates/cli/tests/suite/stale_pin_dedupe.rs`:
- Around line 91-96: In
refreshes_stale_transitive_pin_for_caret_range_direct_dep, add a baseline
lockfile assertion immediately after the first install using manifest version
100.0.0, verifying the initial resolved pin is 100.0.0 before changing the
manifest and running the second install.
In `@pnpm/crates/cli/tests/suite/star_tests.rs`:
- Around line 10-35: Move the shared helpers pacquet_at, empty_auth_file, nerf,
configure, stderr_of, and stdout_of into one public implementation in
pnpm/crates/cli/tests/suite/_utils/mod.rs, preserving caller-specific behavior
such as the fetch-retry environment setting and existing parameters. Update
pnpm/crates/cli/tests/suite/star_tests.rs:10-35, unstar_tests.rs:10-35,
search.rs:14-22, unpublish.rs:26-34, view.rs:29-39, and version.rs:160-162 to
import and use those shared helpers; keep helpers that are not shared private to
their module.
In `@pnpm/crates/cli/tests/suite/store.rs`:
- Around line 65-70: Replace the dbg!(&output) call in the store path test with
eprintln! logging that decodes output.stdout and output.stderr into readable
text before asserting output.status.success(). Keep the existing step logging
and ensure both streams are included in the failure diagnostics.
In `@pnpm/crates/cli/tests/suite/tarball_url_dependency.rs`:
- Around line 106-114: In the tarball URL setup, add an assertion after deriving
the replaced mock URL and before constructing package_key that the tarball URL
does not start with mock_instance.url(). Preserve the existing localhost URL
construction and ensure the test fails loudly if the replacement no longer
produces a non-registry tarball URL.
In `@pnpm/crates/cli/tests/suite/team.rs`:
- Around line 33-35: Replace the hand-rolled argument loops in
pnpm/crates/cli/tests/suite/team.rs lines 33-35 and
pnpm/crates/cli/tests/suite/undeprecate.rs lines 34-36 with chained
.with_args(args) and .with_args(params) calls respectively, then invoke
.output() while preserving the existing command_extra builder chains.
In `@pnpm/crates/cli/tests/suite/update_changeset.rs`:
- Around line 61-65: Update generated_changeset_text to log the generated
changeset string with eprintln! immediately before the existing assert_eq! on
the single generated path, preserving the current assertion and return behavior
so all callers receive readable output on failure.
In `@pnpm/crates/cli/tests/suite/version.rs`:
- Line 16: Remove all four dbg! calls, including dbg!(&output), from the version
test cases in the test module. Keep the existing assertions and rely on their
failure diagnostics for captured output.
In `@pnpm/crates/cli/tests/suite/whoami.rs`:
- Around line 26-34: Move the shared nerf-dart logic from the local helper in
whoami.rs and the matching copies in dist_tag.rs, star_tests.rs, and
unstar_tests.rs into a single public nerf function in the suite _utils module.
Update those four modules to call the shared _utils::nerf, while leaving
audit.rs’s separate mocked-http helper unchanged.
In `@pnpm/crates/cli/tests/suite/why.rs`:
- Around line 303-305: Replace direct lines[0] indexing in the why test
assertions with a fallible first-line accessor that includes {stdout} in the
assertion failure message. Apply the same guard to the corresponding assertions
around lines 333, 358, 384, 408, and 492, preserving each existing
expected-value check.
In `@pnpm/crates/cli/tests/suite/with.rs`:
- Around line 23-26: Remove the dbg!(&output) debug statements from the test
cases in with.rs, including the occurrences near the listed test locations,
while preserving assert_success, assert_current_version, and the existing
assertions.
- Around line 138-142: Replace hardcoded pinned-version values in the with.rs
test setup and assertions with PINNED_PNPM_VERSION, including the "Version
9.3.0" checks and bare "9.3.0" arguments. Preserve the deliberate 9.1.0 literal
used to test a version different from the pinned version.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
There was a problem hiding this comment.
Caution
Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.
🛑 Comments failed to post (4)
pnpm/crates/cli/tests/suite/outdated.rs (1)
55-56: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash # Confirm that add_mocked_registry writes storeDir/cacheDir into pnpm-workspace.yaml. set -euo pipefail fd -t f 'bin.rs' pnpm/crates/testing-utils/src --exec cat -n {}Repository: pnpm/pnpm
Length of output: 6397
🏁 Script executed:
#!/bin/bash set -euo pipefail echo "== locate files ==" fd -t f 'outdated.rs|override_version_references.rs|main.rs' pnpm/crates/cli/tests/suite pnpm/crates/cli/tests 2>/dev/null | sed -n '1,120p' echo echo "== outdated.rs snippets around mentioned writes ==" FILE="$(fd -t f '^outdated\.rs$' pnpm/crates/cli/tests/suite | head -n 1)" if [ -n "${FILE:-}" ]; then echo "FILE=$FILE" rg -n "pnpm-workspace|packages:|add_mocked_registry|add_overrides|fs::write" "$FILE" -C 4 || true sed -n '1,80p;180,310p' "$FILE" | wc -l sed -n '1,80p;180,310p' "$FILE" fi echo echo "== override_version_references.rs related snippets ==" FILE="$(fd -t f '^override_version_references\.rs$' pnpm/crates/cli/tests/suite | head -n 1)" if [ -n "${FILE:-}" ]; then echo "FILE=$FILE" sed -n '1,80p' "$FILE" fi echo echo "== nearby imports/usages of addWorkspace or helper definitions ==" rg -n "addWorkspace|add_overrides|pnpm-workspace.yaml|packages:" pnpm/crates/cli/tests/suite pnpm/crates/cli/tests/_utils.rs 2>/dev/null | sed -n '1,200p'Repository: pnpm/pnpm
Length of output: 40739
Append
packages:instead of replacingpnpm-workspace.yaml.
add_mocked_registry()writespnpm-workspace.yamlwith per-teststoreDirandcacheDir, andoverride_version_references.rsdocuments that tests must extend that file. Thefs::write(...)calls atoutdated.rs:55,204,238, and296-300drop those settings, so the tests may use a shared default store and become run-order-dependent. Read, append, and re-write the existing YAML, matching the helper used there.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pnpm/crates/cli/tests/suite/outdated.rs` around lines 55 - 56, Update the workspace-manifest setup in the outdated test cases to read the existing pnpm-workspace.yaml, append the packages configuration, and write it back instead of replacing it. Apply this to each fs::write call identified in the diff, reusing the existing helper pattern and preserving the storeDir and cacheDir entries created by add_mocked_registry().pnpm/crates/cli/tests/suite/publish.rs (1)
270-270: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Assert each configured registry request.
A test can currently pass if publishing fails or succeeds before the expected
PUT. Retain each mock, set.expect(1), and callmock.assert()after the command assertion.
pnpm/crates/cli/tests/suite/publish.rs#L270-L270: Retain the rejection mock and assert that the failing publish reached the registry.pnpm/crates/cli/tests/suite/publish.rs#L301-L301: Retain the JSON-success mock and assert one upload request.pnpm/crates/cli/tests/suite/publish.rs#L322-L322: Retain the reporter-suppression mock and assert one upload request.📍 Affects 1 file
pnpm/crates/cli/tests/suite/publish.rs#L270-L270(this comment)pnpm/crates/cli/tests/suite/publish.rs#L301-L301pnpm/crates/cli/tests/suite/publish.rs#L322-L322🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pnpm/crates/cli/tests/suite/publish.rs` at line 270, Update the publish tests in pnpm/crates/cli/tests/suite/publish.rs at lines 270-270, 301-301, and 322-322: retain each registry mock, configure it with an expectation of exactly one request, and call its assert method after the corresponding command assertion. Ensure the rejection mock verifies the failing publish reached the registry, while the JSON-success and reporter-suppression mocks each verify one upload request.Source: Path instructions
pnpm/crates/cli/tests/suite/update_changeset.rs (1)
372-387: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash # Description: Determine whether add_mocked_registry writes storeDir/cacheDir to .npmrc, pnpm-workspace.yaml, or both. set -euo pipefail fd -g 'bin.rs' pnpm/crates/testing-utils --exec rg -n -C 10 'add_mocked_registry|storeDir|cacheDir|store_dir|cache_dir|pnpm-workspace.yaml|npmrc' {} \;Repository: pnpm/pnpm
Length of output: 5631
🏁 Script executed:
#!/bin/bash # Inspect the target test and nearby isolation setup without executing repository code. set -euo pipefail file="pnpm/crates/cli/tests/suite/update_changeset.rs" sed -n '1,55p;330,405p' "$file" printf '\n--- related workspace yaml usages ---\n' rg -n 'fn setup|fs::remove_file\(workspace\.join\("pnpm-workspace.yaml"\)\)|workspace\.join\("pnpm-workspace.yaml"\)|write_manifest\(|write_changeset_config\(' pnpm/crates/cli/tests/suite/update_changeset.rsRepository: pnpm/pnpm
Length of output: 6431
Do not delete the workspace YAML that carries isolated
storeDir/cacheDir.
add_mocked_registry()writes both per-test tempstoreDir/cacheDirpaths intopnpm-workspace.yaml. This test removes that file beforepnpm install, so the command can fall back to the default global store/cache instead of the temporary fixture paths. Replace only the workspace-defining keys from the existing YAML, or rewrite it while preservingstoreDir,cacheDir, andenableGlobalVirtualStore: false.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pnpm/crates/cli/tests/suite/update_changeset.rs` around lines 372 - 387, The test update_changeset_supports_a_package_outside_a_workspace must preserve the fixture’s isolated store and cache configuration. Replace only the workspace-defining settings in pnpm-workspace.yaml, or rewrite the file while retaining storeDir, cacheDir, and enableGlobalVirtualStore: false, instead of removing the entire YAML before running install.pnpm/crates/cli/tests/suite/version.rs (1)
115-120: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash # Confirm every pacquet_version / pacquet_recursive_version call site passes a # CommandTempCwd workspace whose parent is the temp root. set -euo pipefail rg -nP --type=rust -C4 '\bpacquet_(recursive_)?version\s*\(' pnpm/crates/cli/tests/suite/version.rsRepository: pnpm/pnpm
Length of output: 16432
🏁 Script executed:
#!/bin/bash set -euo pipefail echo "== version.rs relevant sections ==" sed -n '80,125p;580,600p' pnpm/crates/cli/tests/suite/version.rs echo echo "== CommandTempCwd definitions/usages ==" rg -n --type=rust -C3 'struct CommandTempCwd|impl CommandTempCwd|CommandTempCwd' pnpm/crates/cli/tests/suite pnpm/crates echo echo "== test_command occurrences/definition ==" rg -n --type=rust -C3 'fn test_command|test_command\(' pnpm/crates/cli/tests/suite/version.rsRepository: pnpm/pnpm
Length of output: 50366
🏁 Script executed:
#!/bin/bash set -euo pipefail echo "== version.rs relevant sections ==" sed -n '80,125p;580,600p' pnpm/crates/cli/tests/suite/version.rs echo echo "== CommandTempCwd definitions and version call-site workspace types ==" rg -n --type=rust -C4 'struct CommandTempCwd|impl CommandTempCwd|type CommandTempCwd|new() -> CommandTempCwd' pnpm/crates/testing-utils crates/testing-utils 2>/dev/null || true rg -n --type=rust -C3 'let CommandTempCwd |\broot:\s*|workspace:' pnpm/crates/testing-utils pnpm/crates/cli/tests/suite/version.rs | sed -n '1,220p' echo echo "== test_command occurrences/definition in version.rs ==" sed -n '80,110p' pnpm/crates/cli/tests/suite/version.rs | cat -nRepository: pnpm/pnpm
Length of output: 23177
Route
pacquet_recursive_versionthroughtest_command.
pacquet_versionalready addsversion, whilepacquet_recursive_versionbuilds a separate unisolatedpnpmcommand. Both helpers are invoked withrootfromCommandTempCwd::init(), so pass the temp root throughtest_commandbefore changing directories and running the command; this keeps these tests from reading the developer’s global npm/pnpm config and avoids duplication.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pnpm/crates/cli/tests/suite/version.rs` around lines 115 - 120, Update pacquet_recursive_version to use the shared test_command helper with the temp root from CommandTempCwd::init() before changing directories and invoking pnpm version, rather than constructing an independent Command. Preserve pacquet_version’s version argument handling and remove the duplicated unisolated command setup.
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
Micro-Benchmark ResultsLinux |
|
Code review by qodo was updated up to the latest commit 658fb59 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #13679 +/- ##
=======================================
Coverage 88.19% 88.19%
=======================================
Files 615 615
Lines 99955 99955
=======================================
Hits 88160 88160
Misses 11795 11795 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (2)
pnpm/crates/cli/tests/suite/sbom.rs (1)
828-841: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winRemove this duplicate test.
sbom_dev_flag_includes_only_devrepeatssbom_dev_flag_excludes_prodat lines 426-439. Both copy thewith-dev-dependencyfixture, both runcyclonedxwith--dev, and both assert thattypescriptis present andis-positiveis absent. Only the assertion order differs. The duplicate adds one more CLI invocation to the suite without adding coverage, which works against this PR's build- and runtime-cost goal.♻️ Proposed removal
-#[test] -fn sbom_dev_flag_includes_only_dev() { - let tmp = copy_fixture("with-dev-dependency"); - let parsed = run_sbom_json(tmp.path(), "cyclonedx", &["--dev"]); - let components = parsed["components"].as_array().expect("components"); - assert!( - components.iter().any(|comp| comp["name"] == "typescript"), - "dev dep should be included", - ); - assert!( - !components.iter().any(|comp| comp["name"] == "is-positive"), - "prod dep should be excluded with --dev", - ); -}🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pnpm/crates/cli/tests/suite/sbom.rs` around lines 828 - 841, Remove the duplicate test function sbom_dev_flag_includes_only_dev from the SBOM test suite; retain sbom_dev_flag_excludes_prod as the single coverage for --dev including typescript and excluding is-positive.pnpm/crates/cli/tests/suite/cache.rs (1)
10-12: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winReuse
ABBREVIATED_META_DIRfor the abbreviated mirror paths.
ABBREVIATED_META_DIRis exported frompacquet_resolving_npm_resolver::mirrorand resolves tov11/metadata. Replace the repeated"v11/metadata"literal at each shortenedcache_dirsite instead of constructing it manually.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pnpm/crates/cli/tests/suite/cache.rs` around lines 10 - 12, Update the cache directory setup in the test to reuse the exported ABBREVIATED_META_DIR constant from pacquet_resolving_npm_resolver::mirror instead of manually joining "v11" and "metadata"; apply the same replacement at each abbreviated cache_dir construction site.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pnpm/crates/cli/tests/suite/deploy.rs`:
- Around line 352-361: Add pacquet-fs to the CLI crate’s [dev-dependencies] so
the deploy_rejects_linked_target_parent test can directly resolve
pacquet_fs::symlink_dir. Keep the existing normal dependency declaration
unchanged.
In `@pnpm/crates/cli/tests/suite/publish.rs`:
- Around line 18-42: Update the publish test setup around pacquet and publish to
pass the shared empty_auth_file path via --npmrc-auth-file, matching the guard
used by unpublish.rs and bugs.rs. Ensure every publish invocation uses this
empty authentication file so user-level ~/.npmrc settings cannot affect the
tests, while preserving the existing project .npmrc behavior.
In `@pnpm/crates/cli/tests/suite/run_recursive.rs`:
- Around line 112-127: Increase the polling limit in the waits_for_peer
build-script closure so peer startup can exceed the current one-second budget on
loaded CI runners. Keep the existing short sleep, early exit when
../{peer}.started appears, and bounded-loop guard unchanged.
In `@pnpm/crates/cli/tests/suite/sbom.rs`:
- Around line 760-768: Update the test sbom_split_single_project_not_triggered
to pass --split through run_sbom_json while preserving its assertion that a
single-project workspace emits one regular JSON document with a bomFormat field
rather than NDJSON; if the intended contract is instead one NDJSON line, adjust
the assertion and rename the test to match that behavior.
---
Nitpick comments:
In `@pnpm/crates/cli/tests/suite/cache.rs`:
- Around line 10-12: Update the cache directory setup in the test to reuse the
exported ABBREVIATED_META_DIR constant from
pacquet_resolving_npm_resolver::mirror instead of manually joining "v11" and
"metadata"; apply the same replacement at each abbreviated cache_dir
construction site.
In `@pnpm/crates/cli/tests/suite/sbom.rs`:
- Around line 828-841: Remove the duplicate test function
sbom_dev_flag_includes_only_dev from the SBOM test suite; retain
sbom_dev_flag_excludes_prod as the single coverage for --dev including
typescript and excluding is-positive.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 70d9cc1e-ce3e-4fc1-b2cc-ff7de5adcb9f
⛔ Files ignored due to path filters (7)
pnpm/crates/cli/tests/suite/snapshots/suite__add__should_install_all_dependencies.snapis excluded by!**/*.snap,!**/*.snappnpm/crates/cli/tests/suite/snapshots/suite__add__should_symlink_correctly.snapis excluded by!**/*.snap,!**/*.snappnpm/crates/cli/tests/suite/snapshots/suite__init__should_create_package_json.snapis excluded by!**/*.snap,!**/*.snappnpm/crates/cli/tests/suite/snapshots/suite__init__should_throw_on_existing_file.snapis excluded by!**/*.snap,!**/*.snappnpm/crates/cli/tests/suite/snapshots/suite__install__should_install_dependencies.snapis excluded by!**/*.snap,!**/*.snappnpm/crates/cli/tests/suite/snapshots/suite__install__should_install_exec_files.snapis excluded by!**/*.snap,!**/*.snappnpm/crates/cli/tests/suite/snapshots/suite__install__should_install_index_files.snapis excluded by!**/*.snap,!**/*.snap
📒 Files selected for processing (117)
pnpm/AGENTS.mdpnpm/crates/cli/tests/suite/_utils/mod.rspnpm/crates/cli/tests/suite/add.rspnpm/crates/cli/tests/suite/approve_builds.rspnpm/crates/cli/tests/suite/audit.rspnpm/crates/cli/tests/suite/auth.rspnpm/crates/cli/tests/suite/bin.rspnpm/crates/cli/tests/suite/bugs.rspnpm/crates/cli/tests/suite/bundled_dependencies.rspnpm/crates/cli/tests/suite/cache.rspnpm/crates/cli/tests/suite/cat_file.rspnpm/crates/cli/tests/suite/cat_index.rspnpm/crates/cli/tests/suite/catalog.rspnpm/crates/cli/tests/suite/change.rspnpm/crates/cli/tests/suite/clean.rspnpm/crates/cli/tests/suite/completion.rspnpm/crates/cli/tests/suite/config_dependencies.rspnpm/crates/cli/tests/suite/convergence_overrides.rspnpm/crates/cli/tests/suite/create.rspnpm/crates/cli/tests/suite/current_lockfile.rspnpm/crates/cli/tests/suite/custom_fetchers.rspnpm/crates/cli/tests/suite/custom_resolvers.rspnpm/crates/cli/tests/suite/dedupe.rspnpm/crates/cli/tests/suite/dedupe_direct_deps.rspnpm/crates/cli/tests/suite/dedupe_injected_deps.rspnpm/crates/cli/tests/suite/deploy.rspnpm/crates/cli/tests/suite/deprecate.rspnpm/crates/cli/tests/suite/dist_tag.rspnpm/crates/cli/tests/suite/dlx.rspnpm/crates/cli/tests/suite/docs.rspnpm/crates/cli/tests/suite/dry_run.rspnpm/crates/cli/tests/suite/exclude_links_from_lockfile.rspnpm/crates/cli/tests/suite/exec.rspnpm/crates/cli/tests/suite/exec_recursive.rspnpm/crates/cli/tests/suite/fetch.rspnpm/crates/cli/tests/suite/find_hash.rspnpm/crates/cli/tests/suite/git_hosted_install.rspnpm/crates/cli/tests/suite/global.rspnpm/crates/cli/tests/suite/global_virtual_store.rspnpm/crates/cli/tests/suite/hoist.rspnpm/crates/cli/tests/suite/hoisted_node_linker.rspnpm/crates/cli/tests/suite/import.rspnpm/crates/cli/tests/suite/init.rspnpm/crates/cli/tests/suite/inject_workspace_packages.rspnpm/crates/cli/tests/suite/install.rspnpm/crates/cli/tests/suite/install_filters.rspnpm/crates/cli/tests/suite/install_runtimes.rspnpm/crates/cli/tests/suite/install_state.rspnpm/crates/cli/tests/suite/install_test.rspnpm/crates/cli/tests/suite/licenses.rspnpm/crates/cli/tests/suite/lifecycle_scripts.rspnpm/crates/cli/tests/suite/link.rspnpm/crates/cli/tests/suite/list.rspnpm/crates/cli/tests/suite/local_tarball_dependency.rspnpm/crates/cli/tests/suite/lockfile_only.rspnpm/crates/cli/tests/suite/lockfile_resolution_reuse.rspnpm/crates/cli/tests/suite/lockfile_verification.rspnpm/crates/cli/tests/suite/login.rspnpm/crates/cli/tests/suite/logout.rspnpm/crates/cli/tests/suite/main.rspnpm/crates/cli/tests/suite/multiple_importers.rspnpm/crates/cli/tests/suite/named_registry_install.rspnpm/crates/cli/tests/suite/nested_file_dependencies.rspnpm/crates/cli/tests/suite/optional_dependencies.rspnpm/crates/cli/tests/suite/outdated.rspnpm/crates/cli/tests/suite/override_version_references.rspnpm/crates/cli/tests/suite/pack.rspnpm/crates/cli/tests/suite/pack_recursive.rspnpm/crates/cli/tests/suite/package_manager_check.rspnpm/crates/cli/tests/suite/patch.rspnpm/crates/cli/tests/suite/peers.rspnpm/crates/cli/tests/suite/ping.rspnpm/crates/cli/tests/suite/pnpm_compatibility.rspnpm/crates/cli/tests/suite/pnpr_install.rspnpm/crates/cli/tests/suite/pnpx_alias.rspnpm/crates/cli/tests/suite/prefix.rspnpm/crates/cli/tests/suite/prune.rspnpm/crates/cli/tests/suite/publish.rspnpm/crates/cli/tests/suite/publish_recursive.rspnpm/crates/cli/tests/suite/rebuild_recursive.rspnpm/crates/cli/tests/suite/remove.rspnpm/crates/cli/tests/suite/repeat_install.rspnpm/crates/cli/tests/suite/repo.rspnpm/crates/cli/tests/suite/restart.rspnpm/crates/cli/tests/suite/root.rspnpm/crates/cli/tests/suite/run.rspnpm/crates/cli/tests/suite/run_recursive.rspnpm/crates/cli/tests/suite/runtime.rspnpm/crates/cli/tests/suite/sbom.rspnpm/crates/cli/tests/suite/scope_report.rspnpm/crates/cli/tests/suite/search.rspnpm/crates/cli/tests/suite/self_update.rspnpm/crates/cli/tests/suite/set_script.rspnpm/crates/cli/tests/suite/side_effects_cache.rspnpm/crates/cli/tests/suite/stage.rspnpm/crates/cli/tests/suite/stale_pin_dedupe.rspnpm/crates/cli/tests/suite/star_tests.rspnpm/crates/cli/tests/suite/stars_tests.rspnpm/crates/cli/tests/suite/store.rspnpm/crates/cli/tests/suite/tarball_url_dependency.rspnpm/crates/cli/tests/suite/team.rspnpm/crates/cli/tests/suite/test_command.rspnpm/crates/cli/tests/suite/undeprecate.rspnpm/crates/cli/tests/suite/unlink.rspnpm/crates/cli/tests/suite/unpublish.rspnpm/crates/cli/tests/suite/unstar_tests.rspnpm/crates/cli/tests/suite/update.rspnpm/crates/cli/tests/suite/update_changeset.rspnpm/crates/cli/tests/suite/update_jsr.rspnpm/crates/cli/tests/suite/update_recursive.rspnpm/crates/cli/tests/suite/verify_deps_before_run.rspnpm/crates/cli/tests/suite/version.rspnpm/crates/cli/tests/suite/view.rspnpm/crates/cli/tests/suite/whoami.rspnpm/crates/cli/tests/suite/why.rspnpm/crates/cli/tests/suite/with.rspnpm/crates/cli/tests/suite/workspace_install.rs
💤 Files with no reviewable changes (8)
- pnpm/crates/cli/tests/suite/_utils/mod.rs
- pnpm/crates/cli/tests/suite/update_recursive.rs
- pnpm/crates/cli/tests/suite/update_jsr.rs
- pnpm/crates/cli/tests/suite/inject_workspace_packages.rs
- pnpm/crates/cli/tests/suite/install_test.rs
- pnpm/crates/cli/tests/suite/init.rs
- pnpm/crates/cli/tests/suite/scope_report.rs
- pnpm/crates/cli/tests/suite/dedupe_direct_deps.rs
🚧 Files skipped from review as they are similar to previous changes (97)
- pnpm/crates/cli/tests/suite/licenses.rs
- pnpm/crates/cli/tests/suite/git_hosted_install.rs
- pnpm/crates/cli/tests/suite/add.rs
- pnpm/crates/cli/tests/suite/lifecycle_scripts.rs
- pnpm/crates/cli/tests/suite/hoist.rs
- pnpm/crates/cli/tests/suite/workspace_install.rs
- pnpm/crates/cli/tests/suite/hoisted_node_linker.rs
- pnpm/crates/cli/tests/suite/optional_dependencies.rs
- pnpm/crates/cli/tests/suite/install_filters.rs
- pnpm/crates/cli/tests/suite/config_dependencies.rs
- pnpm/crates/cli/tests/suite/pnpx_alias.rs
- pnpm/crates/cli/tests/suite/prune.rs
- pnpm/crates/cli/tests/suite/dedupe_injected_deps.rs
- pnpm/crates/cli/tests/suite/named_registry_install.rs
- pnpm/crates/cli/tests/suite/login.rs
- pnpm/crates/cli/tests/suite/install.rs
- pnpm/crates/cli/tests/suite/docs.rs
- pnpm/crates/cli/tests/suite/update.rs
- pnpm/crates/cli/tests/suite/override_version_references.rs
- pnpm/crates/cli/tests/suite/repeat_install.rs
- pnpm/crates/cli/tests/suite/runtime.rs
- pnpm/crates/cli/tests/suite/test_command.rs
- pnpm/crates/cli/tests/suite/lockfile_only.rs
- pnpm/crates/cli/tests/suite/cat_index.rs
- pnpm/crates/cli/tests/suite/current_lockfile.rs
- pnpm/crates/cli/tests/suite/logout.rs
- pnpm/crates/cli/tests/suite/deprecate.rs
- pnpm/crates/cli/tests/suite/nested_file_dependencies.rs
- pnpm/crates/cli/tests/suite/dedupe.rs
- pnpm/crates/cli/tests/suite/repo.rs
- pnpm/crates/cli/tests/suite/lockfile_verification.rs
- pnpm/crates/cli/tests/suite/verify_deps_before_run.rs
- pnpm/crates/cli/tests/suite/convergence_overrides.rs
- pnpm/AGENTS.md
- pnpm/crates/cli/tests/suite/link.rs
- pnpm/crates/cli/tests/suite/patch.rs
- pnpm/crates/cli/tests/suite/unstar_tests.rs
- pnpm/crates/cli/tests/suite/pnpm_compatibility.rs
- pnpm/crates/cli/tests/suite/root.rs
- pnpm/crates/cli/tests/suite/exclude_links_from_lockfile.rs
- pnpm/crates/cli/tests/suite/side_effects_cache.rs
- pnpm/crates/cli/tests/suite/update_changeset.rs
- pnpm/crates/cli/tests/suite/tarball_url_dependency.rs
- pnpm/crates/cli/tests/suite/install_state.rs
- pnpm/crates/cli/tests/suite/fetch.rs
- pnpm/crates/cli/tests/suite/bin.rs
- pnpm/crates/cli/tests/suite/team.rs
- pnpm/crates/cli/tests/suite/global_virtual_store.rs
- pnpm/crates/cli/tests/suite/whoami.rs
- pnpm/crates/cli/tests/suite/main.rs
- pnpm/crates/cli/tests/suite/bundled_dependencies.rs
- pnpm/crates/cli/tests/suite/remove.rs
- pnpm/crates/cli/tests/suite/unlink.rs
- pnpm/crates/cli/tests/suite/stars_tests.rs
- pnpm/crates/cli/tests/suite/peers.rs
- pnpm/crates/cli/tests/suite/catalog.rs
- pnpm/crates/cli/tests/suite/pack_recursive.rs
- pnpm/crates/cli/tests/suite/undeprecate.rs
- pnpm/crates/cli/tests/suite/store.rs
- pnpm/crates/cli/tests/suite/multiple_importers.rs
- pnpm/crates/cli/tests/suite/completion.rs
- pnpm/crates/cli/tests/suite/exec.rs
- pnpm/crates/cli/tests/suite/search.rs
- pnpm/crates/cli/tests/suite/find_hash.rs
- pnpm/crates/cli/tests/suite/dist_tag.rs
- pnpm/crates/cli/tests/suite/exec_recursive.rs
- pnpm/crates/cli/tests/suite/stale_pin_dedupe.rs
- pnpm/crates/cli/tests/suite/cat_file.rs
- pnpm/crates/cli/tests/suite/view.rs
- pnpm/crates/cli/tests/suite/approve_builds.rs
- pnpm/crates/cli/tests/suite/install_runtimes.rs
- pnpm/crates/cli/tests/suite/dlx.rs
- pnpm/crates/cli/tests/suite/stage.rs
- pnpm/crates/cli/tests/suite/rebuild_recursive.rs
- pnpm/crates/cli/tests/suite/custom_resolvers.rs
- pnpm/crates/cli/tests/suite/local_tarball_dependency.rs
- pnpm/crates/cli/tests/suite/outdated.rs
- pnpm/crates/cli/tests/suite/set_script.rs
- pnpm/crates/cli/tests/suite/restart.rs
- pnpm/crates/cli/tests/suite/import.rs
- pnpm/crates/cli/tests/suite/why.rs
- pnpm/crates/cli/tests/suite/version.rs
- pnpm/crates/cli/tests/suite/pnpr_install.rs
- pnpm/crates/cli/tests/suite/create.rs
- pnpm/crates/cli/tests/suite/custom_fetchers.rs
- pnpm/crates/cli/tests/suite/with.rs
- pnpm/crates/cli/tests/suite/ping.rs
- pnpm/crates/cli/tests/suite/change.rs
- pnpm/crates/cli/tests/suite/clean.rs
- pnpm/crates/cli/tests/suite/list.rs
- pnpm/crates/cli/tests/suite/publish_recursive.rs
- pnpm/crates/cli/tests/suite/prefix.rs
- pnpm/crates/cli/tests/suite/global.rs
- pnpm/crates/cli/tests/suite/auth.rs
- pnpm/crates/cli/tests/suite/star_tests.rs
- pnpm/crates/cli/tests/suite/pack.rs
- pnpm/crates/cli/tests/suite/run.rs
There was a problem hiding this comment.
Caution
Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.
Actionable comments posted: 4
🧹 Nitpick comments (2)
pnpm/crates/cli/tests/suite/sbom.rs (1)
828-841: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winRemove this duplicate test.
sbom_dev_flag_includes_only_devrepeatssbom_dev_flag_excludes_prodat lines 426-439. Both copy thewith-dev-dependencyfixture, both runcyclonedxwith--dev, and both assert thattypescriptis present andis-positiveis absent. Only the assertion order differs. The duplicate adds one more CLI invocation to the suite without adding coverage, which works against this PR's build- and runtime-cost goal.♻️ Proposed removal
-#[test] -fn sbom_dev_flag_includes_only_dev() { - let tmp = copy_fixture("with-dev-dependency"); - let parsed = run_sbom_json(tmp.path(), "cyclonedx", &["--dev"]); - let components = parsed["components"].as_array().expect("components"); - assert!( - components.iter().any(|comp| comp["name"] == "typescript"), - "dev dep should be included", - ); - assert!( - !components.iter().any(|comp| comp["name"] == "is-positive"), - "prod dep should be excluded with --dev", - ); -}🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pnpm/crates/cli/tests/suite/sbom.rs` around lines 828 - 841, Remove the duplicate test function sbom_dev_flag_includes_only_dev from the SBOM test suite; retain sbom_dev_flag_excludes_prod as the single coverage for --dev including typescript and excluding is-positive.pnpm/crates/cli/tests/suite/cache.rs (1)
10-12: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winReuse
ABBREVIATED_META_DIRfor the abbreviated mirror paths.
ABBREVIATED_META_DIRis exported frompacquet_resolving_npm_resolver::mirrorand resolves tov11/metadata. Replace the repeated"v11/metadata"literal at each shortenedcache_dirsite instead of constructing it manually.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pnpm/crates/cli/tests/suite/cache.rs` around lines 10 - 12, Update the cache directory setup in the test to reuse the exported ABBREVIATED_META_DIR constant from pacquet_resolving_npm_resolver::mirror instead of manually joining "v11" and "metadata"; apply the same replacement at each abbreviated cache_dir construction site.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pnpm/crates/cli/tests/suite/deploy.rs`:
- Around line 352-361: Add pacquet-fs to the CLI crate’s [dev-dependencies] so
the deploy_rejects_linked_target_parent test can directly resolve
pacquet_fs::symlink_dir. Keep the existing normal dependency declaration
unchanged.
In `@pnpm/crates/cli/tests/suite/publish.rs`:
- Around line 18-42: Update the publish test setup around pacquet and publish to
pass the shared empty_auth_file path via --npmrc-auth-file, matching the guard
used by unpublish.rs and bugs.rs. Ensure every publish invocation uses this
empty authentication file so user-level ~/.npmrc settings cannot affect the
tests, while preserving the existing project .npmrc behavior.
In `@pnpm/crates/cli/tests/suite/run_recursive.rs`:
- Around line 112-127: Increase the polling limit in the waits_for_peer
build-script closure so peer startup can exceed the current one-second budget on
loaded CI runners. Keep the existing short sleep, early exit when
../{peer}.started appears, and bounded-loop guard unchanged.
In `@pnpm/crates/cli/tests/suite/sbom.rs`:
- Around line 760-768: Update the test sbom_split_single_project_not_triggered
to pass --split through run_sbom_json while preserving its assertion that a
single-project workspace emits one regular JSON document with a bomFormat field
rather than NDJSON; if the intended contract is instead one NDJSON line, adjust
the assertion and rename the test to match that behavior.
---
Nitpick comments:
In `@pnpm/crates/cli/tests/suite/cache.rs`:
- Around line 10-12: Update the cache directory setup in the test to reuse the
exported ABBREVIATED_META_DIR constant from
pacquet_resolving_npm_resolver::mirror instead of manually joining "v11" and
"metadata"; apply the same replacement at each abbreviated cache_dir
construction site.
In `@pnpm/crates/cli/tests/suite/sbom.rs`:
- Around line 828-841: Remove the duplicate test function
sbom_dev_flag_includes_only_dev from the SBOM test suite; retain
sbom_dev_flag_excludes_prod as the single coverage for --dev including
typescript and excluding is-positive.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 70d9cc1e-ce3e-4fc1-b2cc-ff7de5adcb9f
⛔ Files ignored due to path filters (7)
pnpm/crates/cli/tests/suite/snapshots/suite__add__should_install_all_dependencies.snapis excluded by!**/*.snap,!**/*.snappnpm/crates/cli/tests/suite/snapshots/suite__add__should_symlink_correctly.snapis excluded by!**/*.snap,!**/*.snappnpm/crates/cli/tests/suite/snapshots/suite__init__should_create_package_json.snapis excluded by!**/*.snap,!**/*.snappnpm/crates/cli/tests/suite/snapshots/suite__init__should_throw_on_existing_file.snapis excluded by!**/*.snap,!**/*.snappnpm/crates/cli/tests/suite/snapshots/suite__install__should_install_dependencies.snapis excluded by!**/*.snap,!**/*.snappnpm/crates/cli/tests/suite/snapshots/suite__install__should_install_exec_files.snapis excluded by!**/*.snap,!**/*.snappnpm/crates/cli/tests/suite/snapshots/suite__install__should_install_index_files.snapis excluded by!**/*.snap,!**/*.snap
📒 Files selected for processing (117)
pnpm/AGENTS.mdpnpm/crates/cli/tests/suite/_utils/mod.rspnpm/crates/cli/tests/suite/add.rspnpm/crates/cli/tests/suite/approve_builds.rspnpm/crates/cli/tests/suite/audit.rspnpm/crates/cli/tests/suite/auth.rspnpm/crates/cli/tests/suite/bin.rspnpm/crates/cli/tests/suite/bugs.rspnpm/crates/cli/tests/suite/bundled_dependencies.rspnpm/crates/cli/tests/suite/cache.rspnpm/crates/cli/tests/suite/cat_file.rspnpm/crates/cli/tests/suite/cat_index.rspnpm/crates/cli/tests/suite/catalog.rspnpm/crates/cli/tests/suite/change.rspnpm/crates/cli/tests/suite/clean.rspnpm/crates/cli/tests/suite/completion.rspnpm/crates/cli/tests/suite/config_dependencies.rspnpm/crates/cli/tests/suite/convergence_overrides.rspnpm/crates/cli/tests/suite/create.rspnpm/crates/cli/tests/suite/current_lockfile.rspnpm/crates/cli/tests/suite/custom_fetchers.rspnpm/crates/cli/tests/suite/custom_resolvers.rspnpm/crates/cli/tests/suite/dedupe.rspnpm/crates/cli/tests/suite/dedupe_direct_deps.rspnpm/crates/cli/tests/suite/dedupe_injected_deps.rspnpm/crates/cli/tests/suite/deploy.rspnpm/crates/cli/tests/suite/deprecate.rspnpm/crates/cli/tests/suite/dist_tag.rspnpm/crates/cli/tests/suite/dlx.rspnpm/crates/cli/tests/suite/docs.rspnpm/crates/cli/tests/suite/dry_run.rspnpm/crates/cli/tests/suite/exclude_links_from_lockfile.rspnpm/crates/cli/tests/suite/exec.rspnpm/crates/cli/tests/suite/exec_recursive.rspnpm/crates/cli/tests/suite/fetch.rspnpm/crates/cli/tests/suite/find_hash.rspnpm/crates/cli/tests/suite/git_hosted_install.rspnpm/crates/cli/tests/suite/global.rspnpm/crates/cli/tests/suite/global_virtual_store.rspnpm/crates/cli/tests/suite/hoist.rspnpm/crates/cli/tests/suite/hoisted_node_linker.rspnpm/crates/cli/tests/suite/import.rspnpm/crates/cli/tests/suite/init.rspnpm/crates/cli/tests/suite/inject_workspace_packages.rspnpm/crates/cli/tests/suite/install.rspnpm/crates/cli/tests/suite/install_filters.rspnpm/crates/cli/tests/suite/install_runtimes.rspnpm/crates/cli/tests/suite/install_state.rspnpm/crates/cli/tests/suite/install_test.rspnpm/crates/cli/tests/suite/licenses.rspnpm/crates/cli/tests/suite/lifecycle_scripts.rspnpm/crates/cli/tests/suite/link.rspnpm/crates/cli/tests/suite/list.rspnpm/crates/cli/tests/suite/local_tarball_dependency.rspnpm/crates/cli/tests/suite/lockfile_only.rspnpm/crates/cli/tests/suite/lockfile_resolution_reuse.rspnpm/crates/cli/tests/suite/lockfile_verification.rspnpm/crates/cli/tests/suite/login.rspnpm/crates/cli/tests/suite/logout.rspnpm/crates/cli/tests/suite/main.rspnpm/crates/cli/tests/suite/multiple_importers.rspnpm/crates/cli/tests/suite/named_registry_install.rspnpm/crates/cli/tests/suite/nested_file_dependencies.rspnpm/crates/cli/tests/suite/optional_dependencies.rspnpm/crates/cli/tests/suite/outdated.rspnpm/crates/cli/tests/suite/override_version_references.rspnpm/crates/cli/tests/suite/pack.rspnpm/crates/cli/tests/suite/pack_recursive.rspnpm/crates/cli/tests/suite/package_manager_check.rspnpm/crates/cli/tests/suite/patch.rspnpm/crates/cli/tests/suite/peers.rspnpm/crates/cli/tests/suite/ping.rspnpm/crates/cli/tests/suite/pnpm_compatibility.rspnpm/crates/cli/tests/suite/pnpr_install.rspnpm/crates/cli/tests/suite/pnpx_alias.rspnpm/crates/cli/tests/suite/prefix.rspnpm/crates/cli/tests/suite/prune.rspnpm/crates/cli/tests/suite/publish.rspnpm/crates/cli/tests/suite/publish_recursive.rspnpm/crates/cli/tests/suite/rebuild_recursive.rspnpm/crates/cli/tests/suite/remove.rspnpm/crates/cli/tests/suite/repeat_install.rspnpm/crates/cli/tests/suite/repo.rspnpm/crates/cli/tests/suite/restart.rspnpm/crates/cli/tests/suite/root.rspnpm/crates/cli/tests/suite/run.rspnpm/crates/cli/tests/suite/run_recursive.rspnpm/crates/cli/tests/suite/runtime.rspnpm/crates/cli/tests/suite/sbom.rspnpm/crates/cli/tests/suite/scope_report.rspnpm/crates/cli/tests/suite/search.rspnpm/crates/cli/tests/suite/self_update.rspnpm/crates/cli/tests/suite/set_script.rspnpm/crates/cli/tests/suite/side_effects_cache.rspnpm/crates/cli/tests/suite/stage.rspnpm/crates/cli/tests/suite/stale_pin_dedupe.rspnpm/crates/cli/tests/suite/star_tests.rspnpm/crates/cli/tests/suite/stars_tests.rspnpm/crates/cli/tests/suite/store.rspnpm/crates/cli/tests/suite/tarball_url_dependency.rspnpm/crates/cli/tests/suite/team.rspnpm/crates/cli/tests/suite/test_command.rspnpm/crates/cli/tests/suite/undeprecate.rspnpm/crates/cli/tests/suite/unlink.rspnpm/crates/cli/tests/suite/unpublish.rspnpm/crates/cli/tests/suite/unstar_tests.rspnpm/crates/cli/tests/suite/update.rspnpm/crates/cli/tests/suite/update_changeset.rspnpm/crates/cli/tests/suite/update_jsr.rspnpm/crates/cli/tests/suite/update_recursive.rspnpm/crates/cli/tests/suite/verify_deps_before_run.rspnpm/crates/cli/tests/suite/version.rspnpm/crates/cli/tests/suite/view.rspnpm/crates/cli/tests/suite/whoami.rspnpm/crates/cli/tests/suite/why.rspnpm/crates/cli/tests/suite/with.rspnpm/crates/cli/tests/suite/workspace_install.rs
💤 Files with no reviewable changes (8)
- pnpm/crates/cli/tests/suite/_utils/mod.rs
- pnpm/crates/cli/tests/suite/update_recursive.rs
- pnpm/crates/cli/tests/suite/update_jsr.rs
- pnpm/crates/cli/tests/suite/inject_workspace_packages.rs
- pnpm/crates/cli/tests/suite/install_test.rs
- pnpm/crates/cli/tests/suite/init.rs
- pnpm/crates/cli/tests/suite/scope_report.rs
- pnpm/crates/cli/tests/suite/dedupe_direct_deps.rs
🚧 Files skipped from review as they are similar to previous changes (97)
- pnpm/crates/cli/tests/suite/licenses.rs
- pnpm/crates/cli/tests/suite/git_hosted_install.rs
- pnpm/crates/cli/tests/suite/add.rs
- pnpm/crates/cli/tests/suite/lifecycle_scripts.rs
- pnpm/crates/cli/tests/suite/hoist.rs
- pnpm/crates/cli/tests/suite/workspace_install.rs
- pnpm/crates/cli/tests/suite/hoisted_node_linker.rs
- pnpm/crates/cli/tests/suite/optional_dependencies.rs
- pnpm/crates/cli/tests/suite/install_filters.rs
- pnpm/crates/cli/tests/suite/config_dependencies.rs
- pnpm/crates/cli/tests/suite/pnpx_alias.rs
- pnpm/crates/cli/tests/suite/prune.rs
- pnpm/crates/cli/tests/suite/dedupe_injected_deps.rs
- pnpm/crates/cli/tests/suite/named_registry_install.rs
- pnpm/crates/cli/tests/suite/login.rs
- pnpm/crates/cli/tests/suite/install.rs
- pnpm/crates/cli/tests/suite/docs.rs
- pnpm/crates/cli/tests/suite/update.rs
- pnpm/crates/cli/tests/suite/override_version_references.rs
- pnpm/crates/cli/tests/suite/repeat_install.rs
- pnpm/crates/cli/tests/suite/runtime.rs
- pnpm/crates/cli/tests/suite/test_command.rs
- pnpm/crates/cli/tests/suite/lockfile_only.rs
- pnpm/crates/cli/tests/suite/cat_index.rs
- pnpm/crates/cli/tests/suite/current_lockfile.rs
- pnpm/crates/cli/tests/suite/logout.rs
- pnpm/crates/cli/tests/suite/deprecate.rs
- pnpm/crates/cli/tests/suite/nested_file_dependencies.rs
- pnpm/crates/cli/tests/suite/dedupe.rs
- pnpm/crates/cli/tests/suite/repo.rs
- pnpm/crates/cli/tests/suite/lockfile_verification.rs
- pnpm/crates/cli/tests/suite/verify_deps_before_run.rs
- pnpm/crates/cli/tests/suite/convergence_overrides.rs
- pnpm/AGENTS.md
- pnpm/crates/cli/tests/suite/link.rs
- pnpm/crates/cli/tests/suite/patch.rs
- pnpm/crates/cli/tests/suite/unstar_tests.rs
- pnpm/crates/cli/tests/suite/pnpm_compatibility.rs
- pnpm/crates/cli/tests/suite/root.rs
- pnpm/crates/cli/tests/suite/exclude_links_from_lockfile.rs
- pnpm/crates/cli/tests/suite/side_effects_cache.rs
- pnpm/crates/cli/tests/suite/update_changeset.rs
- pnpm/crates/cli/tests/suite/tarball_url_dependency.rs
- pnpm/crates/cli/tests/suite/install_state.rs
- pnpm/crates/cli/tests/suite/fetch.rs
- pnpm/crates/cli/tests/suite/bin.rs
- pnpm/crates/cli/tests/suite/team.rs
- pnpm/crates/cli/tests/suite/global_virtual_store.rs
- pnpm/crates/cli/tests/suite/whoami.rs
- pnpm/crates/cli/tests/suite/main.rs
- pnpm/crates/cli/tests/suite/bundled_dependencies.rs
- pnpm/crates/cli/tests/suite/remove.rs
- pnpm/crates/cli/tests/suite/unlink.rs
- pnpm/crates/cli/tests/suite/stars_tests.rs
- pnpm/crates/cli/tests/suite/peers.rs
- pnpm/crates/cli/tests/suite/catalog.rs
- pnpm/crates/cli/tests/suite/pack_recursive.rs
- pnpm/crates/cli/tests/suite/undeprecate.rs
- pnpm/crates/cli/tests/suite/store.rs
- pnpm/crates/cli/tests/suite/multiple_importers.rs
- pnpm/crates/cli/tests/suite/completion.rs
- pnpm/crates/cli/tests/suite/exec.rs
- pnpm/crates/cli/tests/suite/search.rs
- pnpm/crates/cli/tests/suite/find_hash.rs
- pnpm/crates/cli/tests/suite/dist_tag.rs
- pnpm/crates/cli/tests/suite/exec_recursive.rs
- pnpm/crates/cli/tests/suite/stale_pin_dedupe.rs
- pnpm/crates/cli/tests/suite/cat_file.rs
- pnpm/crates/cli/tests/suite/view.rs
- pnpm/crates/cli/tests/suite/approve_builds.rs
- pnpm/crates/cli/tests/suite/install_runtimes.rs
- pnpm/crates/cli/tests/suite/dlx.rs
- pnpm/crates/cli/tests/suite/stage.rs
- pnpm/crates/cli/tests/suite/rebuild_recursive.rs
- pnpm/crates/cli/tests/suite/custom_resolvers.rs
- pnpm/crates/cli/tests/suite/local_tarball_dependency.rs
- pnpm/crates/cli/tests/suite/outdated.rs
- pnpm/crates/cli/tests/suite/set_script.rs
- pnpm/crates/cli/tests/suite/restart.rs
- pnpm/crates/cli/tests/suite/import.rs
- pnpm/crates/cli/tests/suite/why.rs
- pnpm/crates/cli/tests/suite/version.rs
- pnpm/crates/cli/tests/suite/pnpr_install.rs
- pnpm/crates/cli/tests/suite/create.rs
- pnpm/crates/cli/tests/suite/custom_fetchers.rs
- pnpm/crates/cli/tests/suite/with.rs
- pnpm/crates/cli/tests/suite/ping.rs
- pnpm/crates/cli/tests/suite/change.rs
- pnpm/crates/cli/tests/suite/clean.rs
- pnpm/crates/cli/tests/suite/list.rs
- pnpm/crates/cli/tests/suite/publish_recursive.rs
- pnpm/crates/cli/tests/suite/prefix.rs
- pnpm/crates/cli/tests/suite/global.rs
- pnpm/crates/cli/tests/suite/auth.rs
- pnpm/crates/cli/tests/suite/star_tests.rs
- pnpm/crates/cli/tests/suite/pack.rs
- pnpm/crates/cli/tests/suite/run.rs
🛑 Comments failed to post (4)
pnpm/crates/cli/tests/suite/deploy.rs (1)
352-361: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash # Description: Check the pacquet-fs dev-dependency and the symlink_dir signature. set -euo pipefail fd -t f 'Cargo.toml' crates/cli | xargs rg -n -A30 '\[dev-dependencies\]' fd -t f -e rs . crates/fs | xargs ast-grep run --pattern 'pub fn symlink_dir($$$) { $$$ }' --lang rustRepository: pnpm/pnpm
Length of output: 30427
🏁 Script executed:
#!/bin/bash set -euo pipefail echo "== CLI Cargo manifests ==" git ls-files 'pnpm/crates/cli/**/Cargo.toml' echo echo "== CLI pnpm/fs references in tests ==" rg -n "pacquet_fs|symlink_dir|symlink_file|pacquet.*fs|pacquet-fs" pnpm/crates/cli pnpm/crates/fs --glob '*.rs' --glob '*.toml' || true echo echo "== CLI dev-deps section ==" sed -n '105,135p' pnpm/crates/cli/Cargo.toml echo echo "== fs symlink_dir definitions/usages ==" rg -n "pub fn symlink_dir|symlink_dir\(" pnpm/crates/fs --glob '*.rs' fd -t f -e rs . pnpm/crates/fs | xargs rg -n "symlink_dir"Repository: pnpm/pnpm
Length of output: 19899
Add
pacquet-fsas a CLI test dependency.
pacquet_fs::symlink_diris used inpnpm/crates/cli/tests/suite/deploy.rs, butpnpm/crates/cli/Cargo.tomlonly addspacquet-fsunder normal dependencies; the suite is outsidesrcand only gains it by transitive test resolution. Add it to[dev-dependencies]so the Windows symlink setup is explicitly available to the test target.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pnpm/crates/cli/tests/suite/deploy.rs` around lines 352 - 361, Add pacquet-fs to the CLI crate’s [dev-dependencies] so the deploy_rejects_linked_target_parent test can directly resolve pacquet_fs::symlink_dir. Keep the existing normal dependency declaration unchanged.pnpm/crates/cli/tests/suite/publish.rs (1)
18-42: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Isolate these tests from the developer's
~/.npmrc.
pacquetclears the CI and OIDC variables, but nothing stops the CLI from reading the caller's real~/.npmrc.write_projectonly writes a project-level.npmrc. A user file that carries//<host>/:_authToken,always-auth, or similar settings therefore changes what the publish requests send, and results differ between machines.Sibling modules added in this PR already guard against this.
unpublish.rspasses--npmrc-auth-filepointing at an empty file and documents the reason at lines 12-13;bugs.rsuses the sameempty_auth_filehelper. Apply the same guard here so all 12 publish tests stay host-independent.🛡️ Proposed guard, matching `unpublish.rs`
fn pacquet(workspace: &Path) -> Command { Command::cargo_bin("pnpm") .expect("find the pnpm binary") .with_current_dir(workspace) + .with_arg("--npmrc-auth-file") + .with_arg(empty_auth_file(workspace)) .without_env("GITHUB_ACTIONS") .without_env("GITLAB_CI") .without_env("NPM_ID_TOKEN") .without_env("ACTIONS_ID_TOKEN_REQUEST_TOKEN") .without_env("ACTIONS_ID_TOKEN_REQUEST_URL") } + +fn empty_auth_file(workspace: &Path) -> PathBuf { + let auth_file = workspace.join("auth-npmrc"); + fs::write(&auth_file, "").expect("write empty auth .npmrc"); + auth_file +}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.fn pacquet(workspace: &Path) -> Command { Command::cargo_bin("pnpm") .expect("find the pnpm binary") .with_current_dir(workspace) .with_arg("--npmrc-auth-file") .with_arg(empty_auth_file(workspace)) .without_env("GITHUB_ACTIONS") .without_env("GITLAB_CI") .without_env("NPM_ID_TOKEN") .without_env("ACTIONS_ID_TOKEN_REQUEST_TOKEN") .without_env("ACTIONS_ID_TOKEN_REQUEST_URL") } fn empty_auth_file(workspace: &Path) -> PathBuf { let auth_file = workspace.join("auth-npmrc"); fs::write(&auth_file, "").expect("write empty auth .npmrc"); auth_file } /// Run `pacquet publish --no-git-checks` in `workspace` with `args` appended. fn publish(workspace: &Path, args: &[&str]) -> std::process::Output { pacquet(workspace) .with_arg("publish") .with_arg("--no-git-checks") .with_args(args) .output() .expect("spawn pacquet publish") } fn write_project(dir: &Path, registry: &str, manifest: &Value) { fs::write(dir.join(".npmrc"), format!("registry={registry}\n")).expect("write .npmrc"); fs::write(dir.join("package.json"), manifest.to_string()).expect("write package.json"); }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pnpm/crates/cli/tests/suite/publish.rs` around lines 18 - 42, Update the publish test setup around pacquet and publish to pass the shared empty_auth_file path via --npmrc-auth-file, matching the guard used by unpublish.rs and bugs.rs. Ensure every publish invocation uses this empty authentication file so user-level ~/.npmrc settings cannot affect the tests, while preserving the existing project .npmrc behavior.pnpm/crates/cli/tests/suite/run_recursive.rs (1)
112-127: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
Raise the peer-wait budget to reduce false failures.
The build script polls for the peer marker at most 100 times with
sleep 0.01, so it gives up after about one second and then fails attest -f ../{peer}.started. Under--parallelboth scripts normally start together, but on a loaded CI runner the secondshprocess can take longer than one second to spawn. The test then reports a failure even though the runner behaved correctly.A larger cap does not slow the passing path, because the loop exits as soon as the peer marker appears. It only extends the timeout on the failing path, and it keeps the guard that prevents an unbounded wait if parallelism regresses.
🔧 Proposed change
- while [ ! -f ../{peer}.started ] && [ \"$attempts\" -lt 100 ]; do \ + while [ ! -f ../{peer}.started ] && [ \"$attempts\" -lt 3000 ]; do \📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.let waits_for_peer = |name: &str, peer: &str| { json!({ "name": name, "version": "1.0.0", "scripts": { "build": format!( "touch ../{name}.started; \ attempts=0; \ while [ ! -f ../{peer}.started ] && [ \"$attempts\" -lt 3000 ]; do \ sleep 0.01; attempts=$((attempts + 1)); \ done; \ test -f ../{peer}.started" ), }, }) };🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pnpm/crates/cli/tests/suite/run_recursive.rs` around lines 112 - 127, Increase the polling limit in the waits_for_peer build-script closure so peer startup can exceed the current one-second budget on loaded CI runners. Keep the existing short sleep, early exit when ../{peer}.started appears, and bounded-loop guard unchanged.pnpm/crates/cli/tests/suite/sbom.rs (1)
760-768: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
This test does not exercise the behavior its name claims.
sbom_split_single_project_not_triggerednever passes--split. It runs a plaincyclonedxreport and asserts thatbomFormatis a string, whichsbom_cyclonedx_basicat lines 60-77 already covers. As written it cannot detect a regression in split suppression for a single-project workspace.Add
--splitso the test proves that a single project still produces one regular JSON document rather than NDJSON.💚 Proposed fix
fn sbom_split_single_project_not_triggered() { let tmp = copy_fixture("simple-sbom"); - let parsed = run_sbom_json(tmp.path(), "cyclonedx", &[]); + let parsed = run_sbom_json(tmp.path(), "cyclonedx", &["--split"]); assert!( parsed["bomFormat"].is_string(), "single project should produce regular JSON, not NDJSON", ); }Confirm the expected behavior first: if
--spliton a single project is meant to emit one NDJSON line instead, assert that shape and rename the test accordingly.📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.#[test] fn sbom_split_single_project_not_triggered() { let tmp = copy_fixture("simple-sbom"); let parsed = run_sbom_json(tmp.path(), "cyclonedx", &["--split"]); assert!( parsed["bomFormat"].is_string(), "single project should produce regular JSON, not NDJSON", ); }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pnpm/crates/cli/tests/suite/sbom.rs` around lines 760 - 768, Update the test sbom_split_single_project_not_triggered to pass --split through run_sbom_json while preserving its assertion that a single-project workspace emits one regular JSON document with a bomFormat field rather than NDJSON; if the intended contract is instead one NDJSON line, adjust the assertion and rename the test to match that behavior.
Integrated-Benchmark Report (Linux)Commit: Regular scenarios report direct and pnpr installs. The peer-heavy resolver scenario compares current Rust, main Rust, and TypeScript pnpm. Bencher consumes pacquet@HEAD and pnpr@HEAD. The tables below show mean ± σ; Bencher thresholds on the minimum latency, which is far less perturbed by shared-runner contention (noise only adds time). Scenario: Isolated linker: fresh restore, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.51819577694,
"stddev": 0.1517815274340897,
"median": 2.43758616224,
"user": 1.6713775199999996,
"system": 1.38351138,
"min": 2.36835018424,
"max": 2.75385407424,
"times": [
2.42002004624,
2.60331912824,
2.45433159324,
2.42084073124,
2.37102299324,
2.36835018424,
2.74823793524,
2.6312498082399998,
2.75385407424,
2.41073127524
]
},
{
"command": "pacquet@main",
"mean": 2.58798501364,
"stddev": 0.14569623789744474,
"median": 2.6371280497400003,
"user": 1.63148692,
"system": 1.32842128,
"min": 2.37399357824,
"max": 2.7824556662399997,
"times": [
2.5580319772399998,
2.62896112124,
2.73360359624,
2.64529497824,
2.3978172992399998,
2.67340779124,
2.41490916224,
2.7824556662399997,
2.37399357824,
2.67137496624
]
},
{
"command": "pnpr@HEAD",
"mean": 1.46281337534,
"stddev": 0.10449543214353586,
"median": 1.4299230292399998,
"user": 1.14164772,
"system": 1.16773568,
"min": 1.36018944524,
"max": 1.70095078424,
"times": [
1.57283283424,
1.42913690924,
1.70095078424,
1.43070914924,
1.36018944524,
1.50300244824,
1.44587706024,
1.36994916024,
1.39846302824,
1.41702293424
]
},
{
"command": "pnpr@main",
"mean": 1.5420349345399997,
"stddev": 0.1578072003135907,
"median": 1.50703574524,
"user": 1.14725002,
"system": 1.20511228,
"min": 1.36772940424,
"max": 1.78148504324,
"times": [
1.5282086212400001,
1.78148504324,
1.73752086224,
1.75201715224,
1.36772940424,
1.43091258324,
1.48586286924,
1.52900117324,
1.4071865852399998,
1.40042505124
]
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.30018504604000007,
"stddev": 0.01938268348058227,
"median": 0.29917613094,
"user": 0.26122626,
"system": 0.58436354,
"min": 0.27214592744,
"max": 0.34482274444,
"times": [
0.29054345644,
0.30145471844,
0.27214592744,
0.28593569543999997,
0.30111341644,
0.29723884544,
0.30390564044,
0.29067994244,
0.34482274444,
0.31401007344
]
},
{
"command": "pacquet@main",
"mean": 0.30267966694,
"stddev": 0.011267448217020934,
"median": 0.30023106594,
"user": 0.25956345999999997,
"system": 0.59116614,
"min": 0.29021379544,
"max": 0.32864827744,
"times": [
0.29785309144,
0.32864827744,
0.30743102344,
0.30354487144,
0.31175759444,
0.30260904044,
0.29619660344,
0.29384512944,
0.29469724244,
0.29021379544
]
},
{
"command": "pnpr@HEAD",
"mean": 0.29492161884,
"stddev": 0.016039172098978673,
"median": 0.29847486594,
"user": 0.25302286000000007,
"system": 0.55446314,
"min": 0.27374409544,
"max": 0.32090015844,
"times": [
0.32090015844,
0.30844679444,
0.29755315644,
0.29939657544,
0.30773907444,
0.30344479244,
0.27374409544,
0.27622935144,
0.28003326944,
0.28172892044
]
},
{
"command": "pnpr@main",
"mean": 0.32114295444,
"stddev": 0.008764850453211832,
"median": 0.32100155394,
"user": 0.26337636,
"system": 0.6072133399999998,
"min": 0.30145007944,
"max": 0.33500755344,
"times": [
0.31878629044,
0.30145007944,
0.32137633444,
0.32829333144,
0.33500755344,
0.32062677344,
0.32739854644,
0.31943953044,
0.31764163744,
0.32140946744
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.70134801924,
"stddev": 0.022680929070496857,
"median": 2.69690486994,
"user": 1.7297300599999996,
"system": 1.49849456,
"min": 2.66271803344,
"max": 2.72942653044,
"times": [
2.72556362744,
2.72934485244,
2.66271803344,
2.69822886644,
2.7126100064400003,
2.6914807984399998,
2.72942653044,
2.69226221844,
2.67626438544,
2.69558087344
]
},
{
"command": "pacquet@main",
"mean": 2.6462468558400003,
"stddev": 0.06634463214952269,
"median": 2.62239874544,
"user": 1.6060995599999999,
"system": 1.36917206,
"min": 2.57682577944,
"max": 2.81116083244,
"times": [
2.68595451944,
2.63062097744,
2.61417651344,
2.57682577944,
2.81116083244,
2.60282404044,
2.6400369764400002,
2.61365985144,
2.6140306194400003,
2.67317844844
]
},
{
"command": "pnpr@HEAD",
"mean": 1.6377730084400004,
"stddev": 0.12432597665946137,
"median": 1.62532734644,
"user": 1.1042830600000002,
"system": 1.22533656,
"min": 1.4543677984399999,
"max": 1.84105053344,
"times": [
1.64599661844,
1.73216095044,
1.5590436624400001,
1.84105053344,
1.4543677984399999,
1.59725271844,
1.70949871744,
1.75865974244,
1.47504126844,
1.60465807444
]
},
{
"command": "pnpr@main",
"mean": 1.55702978814,
"stddev": 0.14299262618199335,
"median": 1.51474277344,
"user": 1.10814816,
"system": 1.2105525599999998,
"min": 1.4247780404400001,
"max": 1.88444667144,
"times": [
1.88444667144,
1.50674402244,
1.54845211144,
1.46786818144,
1.45752765344,
1.4247780404400001,
1.43384482044,
1.64595782544,
1.6779370304399999,
1.52274152444
]
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.40099083384,
"stddev": 0.013716043045528852,
"median": 0.39982936944,
"user": 0.5210368400000001,
"system": 0.7013001,
"min": 0.37945942544,
"max": 0.42671441244,
"times": [
0.40204921144,
0.39614091444000005,
0.40246094644,
0.39674716444,
0.41307814344000005,
0.41096702144,
0.42671441244,
0.39760952744,
0.38468157144000004,
0.37945942544
]
},
{
"command": "pacquet@main",
"mean": 0.38939846934000005,
"stddev": 0.013268750848663786,
"median": 0.38904664944,
"user": 0.5145501400000001,
"system": 0.6654821999999999,
"min": 0.36762901344000004,
"max": 0.41390826944000003,
"times": [
0.40183812844,
0.38741183044000005,
0.36762901344000004,
0.37992161044,
0.39149750144,
0.39784630444,
0.37583873644000004,
0.38991548744000004,
0.41390826944000003,
0.38817781144
]
},
{
"command": "pnpr@HEAD",
"mean": 0.31150576374,
"stddev": 0.004611122083546097,
"median": 0.31153853344000004,
"user": 0.20668883999999998,
"system": 0.5319798,
"min": 0.30629511644,
"max": 0.32152895244,
"times": [
0.31268683244,
0.31243596044,
0.31496029544000004,
0.32152895244,
0.31048545344,
0.31064110644000004,
0.30676850744,
0.30629511644,
0.31264999244,
0.30660542044
]
},
{
"command": "pnpr@main",
"mean": 0.32950700464000005,
"stddev": 0.01697224701050604,
"median": 0.32592075394,
"user": 0.21390203999999996,
"system": 0.5697162,
"min": 0.31480281944,
"max": 0.37269016744,
"times": [
0.37269016744,
0.32263320944,
0.31669310244000004,
0.33929222444,
0.32392153044,
0.33049214244,
0.32791997744,
0.31480281944,
0.33012742744,
0.31649744544
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.7879130480199996,
"stddev": 0.057314736057778405,
"median": 1.75440102452,
"user": 0.8234783999999999,
"system": 0.81000816,
"min": 1.7374494405199998,
"max": 1.87265129652,
"times": [
1.83009494052,
1.87265129652,
1.87056134452,
1.75878436752,
1.74303407952,
1.74259414152,
1.75001768152,
1.73760878052,
1.8363344075199999,
1.7374494405199998
]
},
{
"command": "pacquet@main",
"mean": 1.7679818749199996,
"stddev": 0.06451525033374737,
"median": 1.74648118502,
"user": 0.7867354000000001,
"system": 0.7721836599999998,
"min": 1.7250355875199999,
"max": 1.9434121865199998,
"times": [
1.7473665615199998,
1.7573319455199998,
1.7595611895199998,
1.74005973552,
1.74559580852,
1.73857900352,
1.7250355875199999,
1.72981943052,
1.79305730052,
1.9434121865199998
]
},
{
"command": "pnpr@HEAD",
"mean": 0.34025543122,
"stddev": 0.01972673965375841,
"median": 0.33969772052,
"user": 0.23786789999999997,
"system": 0.57927696,
"min": 0.30978950952,
"max": 0.38082953152000004,
"times": [
0.34702440752,
0.35808726652000006,
0.33944546652,
0.38082953152000004,
0.34491297552000005,
0.33157601852,
0.33994997452000003,
0.30978950952,
0.32928126852,
0.32165789352
]
},
{
"command": "pnpr@main",
"mean": 0.32797698392,
"stddev": 0.022390614096372212,
"median": 0.32410999802000007,
"user": 0.23962509999999998,
"system": 0.53750006,
"min": 0.29847540952,
"max": 0.38460499652,
"times": [
0.32141587852000003,
0.32482636652,
0.29847540952,
0.31902462852,
0.32378031752,
0.31436447852000005,
0.32443967852000005,
0.38460499652,
0.33310804052000004,
0.33573004452000005
]
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.18041111790000006,
"stddev": 0.0022690072632843054,
"median": 0.18077689840000002,
"user": 0.1633083025,
"system": 0.07067264250000002,
"min": 0.17636840290000003,
"max": 0.18327227490000003,
"times": [
0.18063194590000003,
0.18157985990000003,
0.18324609390000002,
0.18286001790000003,
0.18260895590000004,
0.17849359090000003,
0.17904745390000001,
0.18271682790000002,
0.17844904690000002,
0.18131321790000002,
0.17970314690000003,
0.18092185090000001,
0.17847277190000002,
0.18327227490000003,
0.17636840290000003,
0.17689242790000004
]
},
{
"command": "pacquet@main",
"mean": 0.18106205816666668,
"stddev": 0.004715229284534444,
"median": 0.18017692890000003,
"user": 0.16192104000000002,
"system": 0.07283194666666667,
"min": 0.17608890590000004,
"max": 0.19509571290000002,
"times": [
0.19509571290000002,
0.18365660590000002,
0.18194514690000002,
0.17839343290000004,
0.17918552390000003,
0.18018331190000003,
0.17608890590000004,
0.17902341990000004,
0.18581667190000004,
0.17658545990000002,
0.1784103549,
0.18062041390000003,
0.18310461890000002,
0.18017692890000003,
0.17764436390000002
]
},
{
"command": "pnpr@HEAD",
"mean": 0.08780246627499999,
"stddev": 0.0017955188041171761,
"median": 0.08737790640000001,
"user": 0.020386239999999996,
"system": 0.01048892375,
"min": 0.0851072189,
"max": 0.09318658190000001,
"times": [
0.08797768090000001,
0.0873992309,
0.08780395290000001,
0.0858119549,
0.08937379790000001,
0.0851072189,
0.08786196190000001,
0.0868971179,
0.0866392109,
0.0875310789,
0.0886085769,
0.0871170509,
0.0879154729,
0.0864744709,
0.0871565549,
0.08740379990000001,
0.0869266719,
0.08722688690000001,
0.08724673590000001,
0.0873109449,
0.0862936309,
0.08637487390000001,
0.0908592329,
0.08735658190000001,
0.0866128609,
0.08755962390000001,
0.08595860990000001,
0.0885306399,
0.09162625690000001,
0.0917782319,
0.09318658190000001,
0.0877514239
]
},
{
"command": "pnpr@main",
"mean": 0.08800934396250001,
"stddev": 0.0018366392394116955,
"median": 0.08793167290000001,
"user": 0.019273677499999996,
"system": 0.01170523625,
"min": 0.0852931579,
"max": 0.09357236890000001,
"times": [
0.0871699299,
0.0859976949,
0.0866637869,
0.0883916589,
0.0912577829,
0.0877793469,
0.0881716149,
0.0859727569,
0.0865584709,
0.0871125319,
0.0879461299,
0.0879164149,
0.09357236890000001,
0.0899961179,
0.08838584790000001,
0.0852931579,
0.0879172159,
0.08625293390000001,
0.0894135929,
0.0860666929,
0.0880442449,
0.0861766409,
0.08818683490000001,
0.0881956899,
0.0856707189,
0.08878309590000001,
0.0869625299,
0.0908235149,
0.0885522219,
0.0898197659,
0.08688157690000001,
0.0903661239
]
}
]
}Scenario: Isolated linker: peer-heavy resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.8554652998555556,
"stddev": 0.2389843631663105,
"median": 0.8569416843000001,
"user": 0.7998396999999999,
"system": 0.1701132844444444,
"min": 0.4363080243,
"max": 1.2459300172999999,
"times": [
1.1493917302999999,
0.8569416843000001,
0.8800417223000001,
0.7204913853000001,
1.2459300172999999,
0.8048609633000001,
0.7148960063,
0.8903261653000001,
0.4363080243
]
},
{
"command": "pacquet@main",
"mean": 0.6919944265222223,
"stddev": 0.11462376002034243,
"median": 0.6667209053,
"user": 0.6443653666666666,
"system": 0.11106017333333333,
"min": 0.5502561013,
"max": 0.9025693333000001,
"times": [
0.7869290323000001,
0.5532469393,
0.5502561013,
0.7459842943000001,
0.6621650723000001,
0.6667209053,
0.6180529753,
0.9025693333000001,
0.7420251853000001
]
},
{
"command": "pnpm@HEAD",
"mean": 3.1404051469666667,
"stddev": 0.1854873416797178,
"median": 3.1585597493,
"user": 4.709255477777777,
"system": 0.30680117333333334,
"min": 2.8930866093,
"max": 3.5166024533,
"times": [
3.5166024533,
3.2435896423,
3.1585597493,
3.1062471263,
3.0471330743,
3.1723357843,
3.2021897892999998,
2.9239020943,
2.8930866093
]
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.55135032052,
"stddev": 0.13306746229094102,
"median": 4.50106080682,
"user": 1.8546511199999998,
"system": 1.40834152,
"min": 4.44235169982,
"max": 4.88866774482,
"times": [
4.59921993882,
4.88866774482,
4.48518940982,
4.50155808082,
4.4815538108199995,
4.63190912282,
4.44235169982,
4.45010564782,
4.50056353282,
4.53238421682
]
},
{
"command": "pacquet@main",
"mean": 4.68746368702,
"stddev": 0.17157601239711717,
"median": 4.59779003482,
"user": 2.12910792,
"system": 1.5896178199999997,
"min": 4.53095352782,
"max": 4.9857434638199996,
"times": [
4.88525036382,
4.75688201682,
4.87218392282,
4.53095352782,
4.59189729882,
4.60368277082,
4.55056775282,
4.55299716982,
4.54447858282,
4.9857434638199996
]
},
{
"command": "pnpr@HEAD",
"mean": 3.63307662032,
"stddev": 0.12923556694831562,
"median": 3.5907875578199997,
"user": 1.52443332,
"system": 1.4777817199999999,
"min": 3.48289090182,
"max": 3.89082211782,
"times": [
3.5776656938199998,
3.69840544082,
3.5287497968199997,
3.89082211782,
3.48289090182,
3.53207214582,
3.60390942182,
3.5405467688199996,
3.76556059582,
3.71014331982
]
},
{
"command": "pnpr@main",
"mean": 3.5827529579199995,
"stddev": 0.06368396329964283,
"median": 3.56584138932,
"user": 1.5008533199999998,
"system": 1.4710222199999998,
"min": 3.49869312882,
"max": 3.67056030182,
"times": [
3.58106554482,
3.67056030182,
3.52918727682,
3.6650284538199998,
3.49869312882,
3.53710925182,
3.52874578582,
3.5506172338199997,
3.65503560482,
3.61148699682
]
}
]
} |
|
| Project | pnpm's project |
| Branch | pr/13679 |
| Testbed | pnpr |
⚠️ WARNING: No Threshold found!Without a Threshold, no Alerts will ever be generated.
Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the--ci-only-thresholdsflag.
Click to view all benchmark results
| Benchmark | Latency | milliseconds (ms) |
|---|---|---|
| isolated-linker.fresh-install.cold-cache.cold-store | 📈 view plot | 1,454.37 ms |
| isolated-linker.fresh-install.cold-cache.hot-store | 📈 view plot | 309.79 ms |
| isolated-linker.fresh-install.hot-cache.hot-store | 📈 view plot | 306.30 ms |
| isolated-linker.fresh-resolve.hot-cache.offline | 📈 view plot | 85.11 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store | 📈 view plot | 1,360.19 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr | 📈 view plot | 3,482.89 ms |
| isolated-linker.fresh-restore.hot-cache.hot-store | 📈 view plot | 273.74 ms |
|
Thanks for the pass. I went through all 20 findings — none of them is a defect introduced by this PR, and I'd like to keep them out of it. Why. This PR is 122 file renames. The only content edits in the whole diff are:
I cross-checked the set of files with content changes against the set of flagged files, and the two are disjoint. Every finding lands on lines this PR does not touch; they surfaced only because GitHub presents a rename as a new file, so the whole pre-existing test body got read as new code. A few of them may well be worth fixing on their own merits — the Windows junction check in One theme is a genuine follow-up, though, and it's worth recording because this PR is what makes it possible: several comments suggest hoisting duplicated helpers ( For the record on the change itself: Written by an agent (Claude Code, claude-opus-5). |
`pacquet-cli` had 114 integration-test files, and Cargo builds one binary
per `tests/*.rs`. Each of those binaries statically links the whole
dependency graph — `pnpr`, the full registry server, included — so each
weighed 241 MB, and any change to the crate recompiled and re-linked all
~27 GB of them.
Every file now lives under `tests/suite/` as a module of
`tests/suite/main.rs`, so that work happens once. Measured on a 32-core
Linux box (mold, sccache, `debug = "line-tables-only"`):
one-line change to cli/src/lib.rs, rebuild its test targets
20.5-22.1s -> 3.45-3.73s
touch package-manifest, rebuild --workspace --all-targets
~30s -> 11.2s
clean `cargo build -p pacquet-cli --tests` disk usage
30 GB -> 4.9 GB
test binaries
114 x 241 MB -> 1 x 264 MB
The disk figure matters beyond local builds: the Rust CI test job already
carries a "Free up runner disk space" step and a `line-tables-only`
override because this workspace kept crossing the runner's ENOSPC
ceiling mid-link.
Trade-offs: editing a single test file now rebuilds the suite binary
(~1s -> ~3.5s), which is the rarer of the two loops; and
`--test <file_stem>` becomes the module filter
`-E 'test(/^<file_stem>::/)'`. Both are documented in `pnpm/AGENTS.md`,
along with the rule that new test files belong under `tests/suite/`,
so a stray `tests/*.rs` does not quietly reintroduce a binary.
Test isolation is unchanged. `cargo nextest`, which every test recipe in
the justfile and the codecov workflow uses, runs each test in its own
process no matter how many binaries there are.
Two things the merge surfaced and this commit also fixes: seven test
files declared `pub mod _utils;` without ever using it, so each was
compiling 538 dead lines; and the `must_use_candidate` expectation in
`_utils` no longer fires now that the module is private rather than a
binary root.
Snapshots move to `tests/suite/snapshots/` under the `suite__` prefix
insta derives from the new module path.
`include_str!` resolves against the containing file, so the two call
sites that reach into `pnpm11/` need one more `../` at the new depth.
`pnpm/AGENTS.md` calls this out, since a test written against the old
layout will carry the shorter path.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
Code review by qodo was updated up to the latest commit 0287c50 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Picks up a large batch, of which two reshape this branch's changes: #13948 renames the Rust crates from `pacquet-` to `pnpm-`, and #13679 moves the CLI end-to-end tests under `tests/suite/` so they build as one target. This branch's helpers move with them. The `pnpm-testing-utils` mtime helpers keep their names, their imports follow the crate rename, and the `bump_mtime` call sites travel to the relocated suite files. The `Sys: Clock` seam on `build_workspace_state` and its `::<Host>` call sites are re-applied against the renamed crates.
The crate rename (#13948) collided with every import this branch touches, and two changes collided semantically: - `config.registries` became `registries_by_scope` (#13942), so `publish_options` builds its scoped-registry map from the new field. - main's side of `publish_options` still parsed the resolved access through `Access::parse`. This branch forwards it verbatim on purpose -- pnpm validates only `publishConfig.access`, and dropping an unrecognized configured value falls back to the manifest's, which can be the more permissive level. Kept this branch's resolution, on main's field name. The CLI end-to-end tests became a single target under `tests/suite/` (#13679); git carried the three publish/stage files across and they are registered in `main.rs`. Replace this branch's hand-rolled ambient-config isolation with `without_ambient_pnpm_config()` from #13744, which strips every `pnpm_config_*` / `npm_config_*` spelling rather than the five names spelled out here. `CommandTempCwd` already applies it, so the recursive suite only needs the `XDG_CONFIG_HOME` pin that keeps a developer's global `config.yaml` out; the other two build their own command and call it directly. Repoint the `pacquet_publish::` doc references this branch added at `pnpm_publish::`.
Five conflicts, all from main growing its own version of what this branch touches. The Rust crates were renamed from `pacquet-` to `pnpm-` (#13948), so every `pacquet_config::` path in the new code moved with them, and `cli_args/config_warnings.rs` picked up a second warning (`warn_unmatched_registry_options`) beside this branch's emit-once drain. Both halves are additive: the file keeps both, and its test module keeps both test sets. `crates/cli/tests/` is now a single target whose modules live in `tests/suite/` (#13679). Git moved `login.rs` for us but left this branch's new `config_warnings.rs` at the old path, where it would have become its own ~240 MB binary; it moves into `tests/suite/` and is declared in `main.rs`. The substantive one is the config reader. This branch hand-rolled a `REPO_MANIFEST_SKIPPED_SETTINGS` denylist plus a bespoke `IGNORED_SCOPE_WARNING`, and main has since generalized exactly that concept: `PROJECT_MANIFEST_SKIPPED_KEYS`, assembled from the machine locations, the current run's locations, and the credential keys, with one warning that names each refused key and the route that does set it (#13642). Keeping both would leave two denylists answering the same question, so `scope` joins main's as a `LOGIN_TARGET_KEYS` category and the bespoke set and constant are dropped. Users get the unified sentence, which also names the global command, and `pnpm config set scope` in a project now refuses with that same route rather than writing a key the reader would ignore. pacquet has no such mechanism — main left it untouched, since it parses the manifest into a declared struct — so its `IGNORED_SCOPE_WARNING` is reworded to the sentence the TypeScript reader now assembles, keeping the two stacks emitting identical text. The `Config.ts` note on the field goes away with it: main keeps this fact only in the denylist, and `configDir` and its peers carry no such note.
Summary
pacquet-clihad 114 integration-test files, and Cargo builds one binary pertests/*.rs. Each of those binaries statically links the whole dependency graph —pnpr, the full registry server, included — so each weighed 241 MB, and any change to the crate recompiled and re-linked all ~27 GB of them.Every file now lives under
tests/suite/as a module oftests/suite/main.rs, so that work happens once.Measured on a 32-core Linux box (mold, sccache,
debug = "line-tables-only"), min of 3 reps:cli/src/lib.rs, rebuild its test targetspackage-manifest, rebuild--workspace --all-targetscargo build -p pacquet-cli --testsdisk usageThe disk figure matters beyond local builds: the Rust CI test job already carries a
Free up runner disk spacestep and aline-tables-onlyoverride because this workspace kept crossing the runner's ENOSPC ceiling mid-link.How this was chosen
cargo build --timingsshowed the build is throughput-bound, not chain-bound — the momentpacquet-cli's rlib lands, all 114 test binaries unblock at once and run to the end of the build, with nothing waiting on a dependency chain. So splitting crates would not have helped; the workspace is already 75 crates at normal-dep depth 11. Two other candidates were measured and rejected:split-debuginfo = "unpacked"(19.2s vs 20.6s) and anodatacow/uncompressed target dir (22.5s). Building third-party deps without debuginfo cuts each binary to 182 MB but its wall-time effect was inconclusive under load, so it is not included here.Trade-offs
--test <file_stem>becomes the module filter-E 'test(/^<file_stem>::/)'.Both are documented in
pnpm/AGENTS.md, along with the rule that new test files belong undertests/suite/, so a straytests/*.rsdoes not quietly reintroduce a binary.Test isolation is unchanged:
cargo nextest, which every test recipe in the justfile and the codecov workflow uses, runs each test in its own process no matter how many binaries there are.Verification
cargo nextest run -p pacquet-cli --no-fail-fast— 2438 passed, 0 failed, 4 skippedcargo clippy --locked --workspace --all-targets -- --deny warnings— cleancargo fmt --check,taplo format --check,typos,cargo doc,cargo dylint— clean (full pre-push gate)Squash Commit Body
Checklist
pnpm/port, or the description notes what still needs porting.No counterpart needed — this changes only how pacquet's own test targets
are laid out. Nothing user-visible, so nothing to mirror.
removed, and all 2438 tests pass.
pnpm/AGENTS.mdgains thetests/suite/layout rule and the module-filter form of--test.No changeset: no published package changes — this is test-target layout only.
Written by an agent (Claude Code, claude-opus-5).
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by CodeRabbit
Tests
Documentation