Improve pipeline validator unit tests#554
Conversation
|
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. |
|
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 |
|
Droid finished @EffortlessSteven's task —— View job Review summaryLGTM — the test refactor is more idiomatic (Result-returning tests) and the added boundary coverage looks correct; I didn’t spot any actionable correctness or security issues in this diff. |
Compatibility Layer Usage ReportCurrent usage count: 193 📈 Usage Trend (Last 30 Days)
Usage Details
... and 183 more occurrences Migration GuideTo migrate these usages, replace:
See Migration Patterns for detailed examples. |
Motivation
PipelineValidatorunit tests more robust and idiomatic by converting panic-based tests toResult-returning tests so the?operator can be used instead ofunwrap-style helpers.Description
crates/openracing-pipeline/src/validation.rsto returnResultfrom tests and remove themust()panic helper and the#[allow(clippy::unwrap_used)]exception.create_valid_config()to returnResult<FilterConfig, _>and construct domain types with their validated constructors (e.g.Gain::new,FrequencyHz::new,CurvePoint::new,NotchFilter::new) using?instead of unwrapping.assert_invalid_parametershelper and new tests that cover boundary gains, notch frequency and Q limits, enabled/disabled bumpstop and hands-off validation, schema-rejected non-monotonic curves, exact linear-identity empty-config behavior, and response curve validation.Testing
python scripts/cargo_fmt_workspace.pyto format the workspace and the formatting step completed successfully.cargo test -p openracing-pipeline validation::testsand the test suite passed:15 passed; 0 failed.cargo clippy -p openracing-pipeline --all-targets -- -D warningsand the lint run completed successfully.cargo test ... --all-featuresinitially failed due to a missing system dependency (libudevrequired byhidapi), after installinglibudev-devthe targeted validation tests were executed and passed as reported above.Codex Task