Skip to content

test(axis): expand unit test coverage for conflict detection#293

Draft
EffortlessSteven wants to merge 1 commit into
mainfrom
claude/coverage/axis-conflict-tests
Draft

test(axis): expand unit test coverage for conflict detection#293
EffortlessSteven wants to merge 1 commit into
mainfrom
claude/coverage/axis-conflict-tests

Conversation

@EffortlessSteven
Copy link
Copy Markdown
Member

Summary

Expands unit-test coverage of crates/flight-axis/src/conflict.rs. Before this PR the 558-LOC curve-conflict detection module had only 4 inline tests — well below the 70% project target for blocking-tier crates.

Adds 17 new #[test] functions covering:

  • ConflictDetectorConfig::default() field defaults
  • CurveConflictDetector new / with_config / Default parity, empty-state getters
  • add_sample: multi-axis isolation, buffer growth past min_samples * 2 triggering the trim path
  • clear_conflicts wipes the sample buffer, last-analysis map, and detected-conflicts map
  • analyze_samples None paths (too-few samples; linear data below threshold); Some path for step-function samples
  • analyze_linearity degenerate input (zero-range) no-panic
  • assess_severity Critical / High / Medium / Low buckets + boundary
  • classify_conflict all three branches (DoubleCurve / ExcessiveNonlinearity / OpposingCurves)
  • generate_description per-type strings
  • generate_resolutions for ExcessiveNonlinearity and OpposingCurves (including gain_factor math)
  • Full ConflictSeverity Ord/PartialOrd ordering

All tests live in the existing #[cfg(test)] mod tests block. No production code modified, no new dependencies.

Test plan

  • cargo test -p flight-axis — 743 unit tests + integration/doctests green
  • cargo test -p flight-axis conflict — all conflict tests pass
  • rustfmt --check crates/flight-axis/src/conflict.rs clean

Generated by Claude Code

Add 17 new unit tests to crates/flight-axis/src/conflict.rs covering
pure-logic paths that did not require RT-thread machinery:

- ConflictDetectorConfig defaults and field round-trip via with_config
- CurveConflictDetector::default() empty state parity with new()
- get_conflicts/get_all_conflicts empty before any analysis
- add_sample multi-axis isolation and buffer growth past
  min_samples * 2 (trim path with fresh timestamps)
- clear_conflicts wipes detected_conflicts, sample_buffer, and
  last_analysis together
- analyze_samples returns None below min_samples and for perfectly
  linear data; returns Some with non-empty resolutions for a
  step-function response
- analyze_linearity handles degenerate (all-same) input without panic
- assess_severity thresholds at Critical/High/Medium/Low boundaries
- classify_conflict branches for DoubleCurve, ExcessiveNonlinearity,
  and OpposingCurves
- generate_description content per ConflictType
- generate_resolutions for ExcessiveNonlinearity (target_strength)
  and OpposingCurves (gain_factor computation)
- ConflictSeverity full ordering via vector sort
@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 37 minutes and 36 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: 34dfa040-a301-4ac5-8b94-6f10144aaae4

📥 Commits

Reviewing files that changed from the base of the PR and between 7d026c3 and c4c9250.

📒 Files selected for processing (1)
  • crates/flight-axis/src/conflict.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/coverage/axis-conflict-tests

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.

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.

2 participants