fix(ci): tolerate a missing target/debug/deps in the cargo-test prune step - #8629
fix(ci): tolerate a missing target/debug/deps in the cargo-test prune step#8629jdalton wants to merge 1 commit into
Conversation
… step The full cargo-test job pruned linked test binaries between packages with a bare 'find target/debug/deps ... -delete', but that directory only exists once something has built into it. When the scope's first package builds straight to --release (the perry/perry-stdlib branch above it), or before any cargo test -p <package> has run in the per-package loop, the directory is absent and find exits 1, failing the whole job even though every test passed. This has been failing main's scheduled and push CI runs repeatedly and is unrelated to any specific PR's changes.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe full ChangesTest workflow cleanup
Estimated code review effort: 1 (Trivial) | ~2 minutes Merge Risk: ⚪ Minimal · up to This localized CI change makes pruning a missing directory a no-op, preventing otherwise successful test jobs from failing; no actionable merge-blocking risk remains after normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 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 |
…deps) (#8631) * fix(ci): tolerate a missing target/debug/deps in the cargo-test prune step The full cargo-test job pruned linked test binaries between packages with a bare 'find target/debug/deps ... -delete', but that directory only exists once something has built into it. When the scope's first package builds straight to --release (the perry/perry-stdlib branch above it), or before any cargo test -p <package> has run in the per-package loop, the directory is absent and find exits 1, failing the whole job even though every test passed. This has been failing main's scheduled and push CI runs repeatedly and is unrelated to any specific PR's changes. * chore: add the changelog fragment for #8629 --------- Co-authored-by: John-David Dalton <jdalton@socket.dev> Co-authored-by: Ralph Küpper <ralph@skelpo.com>
|
Landed on Verified your One thing noted in the changelog fragment, not a blocker: Thanks — this was failing |
|
Appreciate the independent verification, and good catch on the tradeoff. On the failure-mode tradeoffAgreed the failure mode changes shape rather than disappearing: a genuinely broken prune now surfaces as disk exhaustion later instead of a pointed |
Summary
Fixes a CI script bug that has been failing
main's scheduled and push runs repeatedly, unrelated to any specific PR's code changes.What broke and why
The full
cargo-testjob (nightly cron, release tags,workflow_dispatch) prunes linked test binaries between packages to avoid exhausting runner disk, using a barefind target/debug/deps -maxdepth 1 -type f -perm -111 ! -name '*.so' -delete.That directory only exists once something has actually built into it. When the job's scope builds straight to
--release(theperry/perry-stdlibbranch just above the first prune call) and nocargo test -p <package>has run yet,target/debug/depsis absent,findexits 1, and the whole job fails, even when every test in it passed. I confirmed this against a real run:cargo testreported2595 passed; 0 failed, and the job still failed on this exact line right after.Changes
Both prune calls in
.github/workflows/test.yml(find target/debug/deps ...) now redirect stderr and fall back totrue, so a missing directory is treated as a no-op instead of a job failure. The behavior when the directory does exist is unchanged.Related issue
n/a
Test plan
I confirmed the failure mode against a real CI run at
https://github.com/PerryTS/perry/actions/runs/32553699612, where thecargo-testjob passed every test and then failed on this exact line withfind: 'target/debug/deps': No such file or directory. I ranactionlintagainst the edited workflow file and it reported no new findings, only two pre-existing unrelated shellcheck notes elsewhere in the file that this change does not touch.cargo build --releaseand the workspace test suite are not applicable here, since no Rust source changed.Checklist
I have not bumped the workspace version or edited CLAUDE.md or CHANGELOG.md. My commit follows the
fix:prefix convention used in the log. I have read CONTRIBUTING.md and agree to the Code of Conduct.