Skip to content

test(diffguard-analytics): cover baseline + history edge cases#1610

Merged
EffortlessSteven merged 2 commits into
mainfrom
claude/improve-code-coverage-dZYp6-analytics
May 16, 2026
Merged

test(diffguard-analytics): cover baseline + history edge cases#1610
EffortlessSteven merged 2 commits into
mainfrom
claude/improve-code-coverage-dZYp6-analytics

Conversation

@EffortlessSteven
Copy link
Copy Markdown
Member

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 path
  • merge_false_positive_baselines: the base-only fingerprint append branch (seen.insert(...) returning true) and the rule_id / path / line fill-in branches when an existing entry has empty/zero values
  • false_positive_fingerprint_set: round-trip from baseline to lookup set
  • normalize_trend_history: empty-schema fill-in
  • append_trend_run: no-limit (None) and zero-limit (Some(0)) pass-through behavior
  • summarize_trend_history: empty-history and single-run shapes (no delta)

Test plan

  • cargo test -p diffguard-analytics — 13/13 pass
  • cargo clippy -p diffguard-analytics --all-targets -- -D warnings — clean
  • cargo fmt -p diffguard-analytics -- --check

Generated by Claude Code

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.
@gemini-code-assist
Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 16, 2026

Warning

Rate limit exceeded

@EffortlessSteven has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 38 minutes and 20 seconds before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 9a1615c7-5f19-4e78-a5b8-6ff22b27975c

📥 Commits

Reviewing files that changed from the base of the PR and between 29bd0ad and 0cce994.

📒 Files selected for processing (1)
  • crates/diffguard-analytics/src/lib.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/improve-code-coverage-dZYp6-analytics

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Comment thread crates/diffguard-analytics/src/lib.rs Fixed
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.
@EffortlessSteven EffortlessSteven marked this pull request as ready for review May 16, 2026 18:47
@gemini-code-assist
Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@EffortlessSteven EffortlessSteven merged commit 108c2a7 into main May 16, 2026
11 checks passed
@EffortlessSteven EffortlessSteven deleted the claude/improve-code-coverage-dZYp6-analytics branch May 16, 2026 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Close code coverage gaps in lsp + analytics + main

3 participants