Repository navigation
CI: share test helpers in repair/scan tests (#824) - #1410
Conversation
Assisted-by: Claude Code:claude-opus-5-5
Four repair/ and scan/ test files still kept their own copies of the binary() and git_sha256 helpers, held back while #1398 changed them. That PR has merged, so they now use the shared ones in tests/common, and the helper-copy ratchet drops them from its pending list so a new copy there fails the test. Only the four shared *_common modules stay pending. Refs #824 Assisted-by: Claude Code:claude-opus-5-5
Drop a doc comment left with no item under it, rewrap the ratchet's pending-list comment, and import the sha2 Digest trait only inside the one helper that uses it. Refs #824 Assisted-by: Claude Code:claude-opus-5-5
|
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 e1b04a6. Configure here.
|
[agent] Generated by Claude Code |
|
Ready for review (burn-down agent)
Generated by Claude Code |
Final review briefWhat it does: Test-only cleanup for #824. Four repair/scan test files drop their private copies of Risk: low. No production code touched; the removed helpers are byte-for-byte the same as Look here:
Verified: read the full diff; compared the removed helpers with Changes I made: none. Open questions: none. Auto-merge is armed, so approving sends it straight to the merge queue. Generated by Claude Code |
LLM Description written by Claude Code:claude-opus-5-5
Refs #824 (slice 5; the tracking issue stays open for the four shared
*_commonmodules).What
Four CLI test files still carried private copies of
binary()andgit_sha256, held back only because #1398 touched them. #1398 has merged, so they now usecrate::common::{binary, git_sha256}like every other file in therepairandscantest binaries (both already declaremod common):repair/covgap_commands_repair.rsrepair/covgap_commands_repair_vendor.rsrepair/repair_invariants.rsscan/covgap_commands_fetch_stage.rsThe ratchet in
cli/shared_helper_copies.rsdrops these entries, so a new private copy in any of them now failsno_new_private_binary_or_git_sha256.Still pending
vex_e2e_common,vlt_e2e_common,vlt_hosted_commonandvlt_vendor_commonare#[path]-included by dozens of test targets, many of which don't declaremod common. Migrating them needs a separate decision (addmod commonto every includer, or re-export) and is left for a later slice.Test evidence
cargo fmt --all -- --check: clean.cargo check -p socket-patch-cli --all-features --test repair --test scan --test cli: no warnings.cargo test -p socket-patch-cli --all-features --test cli: 110 passed (includes theshared_helper_copiesratchet).--test scan: 125 passed.--test repair: 126 passed, 2 failed. The 2 failures (repair_exits_zero_and_stays_quiet_when_lock_file_unremovable,repair_cleanup_failure_is_reported_in_json_and_silent_modes) fail the same way on unmodifiedorigin/main. They chmod a dir to 0o555, and the sandbox runs as uid 0, which ignores the bit. CI runs as non-root./code-review high: no correctness findings. Fixed: an orphaned doc comment incovgap_commands_fetch_stage.rs, the rewrap of the ratchet comment, and a module-levelDigestimport moved intosri_of. Not fixed:sri_ofis also duplicated inrepair/repair_vendor_e2e.rs, but it is not one of the two helpers the Tracking: share CLI test helpers through one test-support module instead of 100+ per-file copies #824 ratchet tracks, so it is left for a later slice to keep this PR scoped.CI cost
Test-only change. Lean PR run: same jobs (~28 Linux jobs, ~8 min wall) before and after; no workflow changes.
🤖 Generated with Claude Code
https://claude.ai/code/session_0156V3EY4FwW4tMqqcGRHn7J
Generated by Claude Code