test(diffguard-analytics): cover baseline + history edge cases#1610
Conversation
Adds unit tests for the previously-uncovered branches in diffguard-analytics/src/lib.rs (was 93.46% region coverage, 24 uncovered regions): - normalize_false_positive_baseline: empty-schema fill-in branch and the deduplication-by-fingerprint path - merge_false_positive_baselines: the base-only fingerprint append branch and the rule_id/path/line fill-in branches when an entry has empty/zero values - false_positive_fingerprint_set: round-trip from baseline to set - normalize_trend_history: empty-schema fill-in branch - append_trend_run: no-limit and zero-limit pass-through path - summarize_trend_history: empty-history and single-run shapes Pure test-only additions — no behavior change. Closes #1609.
|
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
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ 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 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 |
Replaces the only .expect() call in the new tests with a let-else + panic!() to avoid tripping the diffguard self-lint rust.no_unwrap. Refs #1609.
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Summary
Adds unit tests for previously-uncovered branches in
crates/diffguard-analytics/src/lib.rs(was 93.46% region coverage, 24 uncovered regions). Pure test-only additions — no behavior change.Closes #1609 (tracked alongside sibling PRs).
New unit tests cover:
normalize_false_positive_baseline: empty-schema fill-in and the dedup-by-fingerprint pathmerge_false_positive_baselines: the base-only fingerprint append branch (seen.insert(...)returning true) and therule_id/path/linefill-in branches when an existing entry has empty/zero valuesfalse_positive_fingerprint_set: round-trip from baseline to lookup setnormalize_trend_history: empty-schema fill-inappend_trend_run: no-limit (None) and zero-limit (Some(0)) pass-through behaviorsummarize_trend_history: empty-history and single-run shapes (no delta)Test plan
cargo test -p diffguard-analytics— 13/13 passcargo clippy -p diffguard-analytics --all-targets -- -D warnings— cleancargo fmt -p diffguard-analytics -- --checkGenerated by Claude Code