ci: isolate CARGO_HOME in preflight snapshot test#86
Conversation
The snapshot passed on nextest/PR lanes but failed on the Coverage (llvm-cov) lane because llvm-cov runs cargo test without the nextest harness. Root cause is unrelated to the runner though: the test removed CARGO_REGISTRY_TOKEN and CARGO_REGISTRIES_CRATES_IO_TOKEN but did nothing about the third token source in Shipper's resolution chain: $CARGO_HOME/credentials.toml. On developer machines that file exists and contains a real token, so the snapshot was recorded with `Token Detected: ✓` and `Auth Type: Token`. On CI runners credentials.toml does not exist, so preflight reports `Token Detected: ✗` and `Auth Type: -`. The diff flipped the lane red. Fix: set CARGO_HOME to the test tempdir so the credentials.toml lookup cannot find anything. Re-record the snapshot under the isolated env — now deterministic on every runner regardless of ambient credentials.
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 8 minutes and 44 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
✨ 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Summary
The
preflight_allow_dirty_snapshottest passed onnextest/ PR lanes but failed on the Coverage (llvm-cov) lane, flippingmainred even after PR #82 merged.Root cause is not the test harness — it's the test env setup:
CARGO_REGISTRY_TOKEN→CARGO_REGISTRIES_<NAME>_TOKEN→$CARGO_HOME/credentials.toml.CARGO_HOME.~/.cargo/credentials.tomlexists and contains a real token, so the snapshot was recorded withToken Detected: ✓/Auth Type: Token.Token Detected: ✗/Auth Type: -. The diff flipped red.Fix: set
CARGO_HOMEto the test's tempdir so thecredentials.tomllookup can't find anything. Re-recorded the snapshot under the isolated env — now deterministic regardless of ambient credentials.Verification
cargo test -p shipper-cli --test e2e_expanded preflight_allow_dirty_snapshot -- --exact— passes locally with the isolated env.Token Detected: ✗/Auth Type: -, matching what every clean CI runner produces.Test plan