Repository navigation
Use tests/common's binary() and git_sha256 in 40 more CLI tests (#824) - #1258
Mikola Lysenko (mikolalysenko) merged 3 commits into
Conversation
Assisted-by: Claude Code:claude-opus-5-5
Forty more CLI test files drop their private copies of binary() and git_sha256 and import tests/common's instead, so a change to how the tests find the binary or hash a blob is made in one place. The two pnpm build suites keep their SOCKET_PATCH_PNPM_E2E_SOCKET_BIN override as a named socket_bin() helper. No test changes what it asserts. The shared_helper_copies ratchet drops the migrated files; the 27 files open PRs change and the 4 shared modules stay listed. Assisted-by: Claude Code:claude-opus-5-5
|
BugBot review Generated by Claude Code |
|
Labeled Ready for review by the burn-down agent.
Generated by Claude Code |
Final review brief (
|
Nine standalone e2e suites now include common/mod.rs, which already declares cache_env and hermetic, yet still loaded those two files a second time through their own #[path] mods (clippy::duplicate_mod under --all-targets). They take common's modules instead. Assisted-by: Claude Code:claude-opus-5-5
|
[agent] Addressed the final-review note in 189dddb: the 9 standalone suites (e2e_gem, e2e_npm, e2e_pypi, e2e_redirect_{gem,gradle}build, e2e_scan, e2e_vendor{composer,pnpm,pypi}_build) now take One Generated by Claude Code |
|
BugBot review Generated by Claude Code |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 189dddb. Configure here.
|
[final reviewer] Disarmed auto-merge: the head moved from Generated by Claude Code |
LLM Description written by Claude Code:claude-opus-5-5
Refs #824 (children 2–3, slice 2; the tracker stays open for the files that open PRs change).
Summary
Forty more CLI test files drop their private
binary()andgit_sha256and import the ones intests/commoninstead. Standalone test binaries declare#[path = "common/mod.rs"] mod common;; directory binaries (apply/,cli/,get/,remove/,repair/,rollback/,scan/,e2e_vex_lockfile/) usecrate::common. The two pnpm build suites keep theirSOCKET_PATCH_PNPM_E2E_SOCKET_BINoverride, renamed tosocket_bin()so it no longer looks like a copy. Theshared_helper_copiesratchet drops the 40 migrated files.Why
register/20-audit-core.md; living documentdoc/08-tests-ci-docs.md, shared test support). It follows Use tests/common's binary() and git_sha256 in CLI tests (#824) #1124, which moved the first ~75 files.binary(), 25git_sha256), S 0, R L (test-only). It ranked first among candidates whose files no open PR changes. Every production candidate with higher B or U (the manifest-load cluster An unparseable .socket/manifest.json is reported under five different --json error codes depending on the command #931/apply, apply --check and vendor report noManifest (exit 0) when .socket/manifest.json exists but can't be stat'd #998/scan reads a corrupt manifest as empty, so --prune skips GC and reports success #1063/A directory at .socket/manifest.json exits 2 with no --json output when --manifest-path spells the path, but exits 1 with manifest_unreadable under the default path #1123, Locate hosted Maven pom edits and their upstream restore through the formats::maven element scanner #717, Upstream restore sends every public-registry lookup at once; the registry_concurrency cap has no caller #1220, Chunk patch batch searches through one core helper with one set of batch limits #675, Mirror global flags into the environment once before dispatch, and read the lock timeout through one accessor #794) overlaps an open PR.What changed
sha2/PathBufimports removed.cache_env/hermeticthroughcommoninstead of loading them twice (189dddb, from the final review).tests/cli/shared_helper_copies.rs: 40 entries removed fromPENDING_PRIVATE_HELPERS(31 left: 27 files changed by open PRs, and 4 shared modules whose includers don't all declaremod common).Deleted
git diff --stat origin/main: 41 files, +152/−421 (after 189dddb), all undercrates/socket-patch-cli/tests. Production: 0 lines.Behavior
None. Every removed
git_sha256was the Git-blob SHA-256 (SHA256("blob <len>\0" ++ bytes)) or a call tocompute_git_sha256_from_bytes;tests/common's own tests pin both shapes as equal. Every removedbinary()returnedenv!("CARGO_BIN_EXE_socket-patch")as aPathBufor&'static str, and every caller compiles against thePathBufversion.Test evidence
cargo test -p socket-patch-cli --all-features --no-runon all 34 touched targets: no warnings.cargo test -p socket-patch-cli --all-featureson the same targets plusspawn_env_hygiene: all pass (apply 119, cli 97 including the ratchet, get 81, remove 99, rollback 57, scan 120, e2e_vex_lockfile 344, vendor_jvm_cli 50, e2e_vendor_pnpm_build 49, e2e_vendor_pypi_build 52, …). The only failures are the 2 root-onlyrepairtests (repair_exits_zero_and_stays_quiet_when_lock_file_unremovable,repair_cleanup_failure_is_reported_in_json_and_silent_modes). They fail the same way onmainbecause the sandbox runs as root, and their files are not changed here.cargo clippy --workspace --all-features -- -D warnings: clean.maincopy was already rustfmt-clean (all 41).Risk
Low. Test-only, mechanical, and the compiler checks every call site. The ignored e2e bodies (docker, toolchain builds) are compiled but not run here; they call the same helpers as before.
🤖 Generated with Claude Code
Note
Low Risk
Test-only mechanical deduplication; shared helpers are already pinned by
tests/commonand the ratchet test.Overview
Forty CLI integration/e2e tests now import shared
binary()andgit_sha256()fromtests/commoninstead of maintaining local copies. Standalone test binaries add#[path = "common/mod.rs"] mod common; nested suites underapply/,cli/,get/, etc. usecrate::common. Several e2e suites also pullcache_env/hermeticthroughcommonso those modules are not loaded twice.The
shared_helper_copiesratchet drops the 40 migrated paths fromPENDING_PRIVATE_HELPERS, leaving only files still pending or blocked by other PRs.pnpm build e2e keeps the
SOCKET_PATCH_PNPM_E2E_SOCKET_BINoverride but renames the local helper tosocket_bin()so it is not confused with the sharedbinary().No production or CLI runtime behavior changes—duplicate helper bodies and unused
sha2imports are removed only.Reviewed by Cursor Bugbot for commit 189dddb. Configure here.
Generated by Claude Code