test(security): expand verification & audit log coverage#292
test(security): expand verification & audit log coverage#292EffortlessSteven wants to merge 1 commit into
Conversation
Adds 26 unit tests inside verification.rs covering VerificationConfig defaults, SecurityVerifier construction, audit log routing/trimming/ clearing, verify_security pass-baseline behaviour (including fail_on_warnings=true), the private generate_recommendations and determine_overall_status helpers across all status/severity branches, and serde round-trips for SecurityCheck and AuditEvent. https://claude.ai/code/session_0133KrE5AfK8pBzVUjGPkpnW
|
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 |
Summary
Expands unit-test coverage of
crates/flight-security/src/verification.rs. Before this PR the 650-LOC file had only 3 inline tests — well below the 70% project coverage target for blocking-tier crates.Adds 26 new
#[test]functions (29 total) covering:VerificationConfig::default()field-by-field defaultsSecurityVerifier::new/Defaultinitial empty audit logaudit_eventno-op whenaudit_logging_enabled=falseSecuritySeverityvariantsget_audit_log/clear_audit_log(including double-clear)verify_securitybaseline +fail_on_warnings=truepathgenerate_recommendationsbranches: empty / Critical / High / Medium / Low+Info / Pass-skipped / missing-remediationdetermine_overall_statusfor all-Pass, empty, any-Fail, Warning withfail_on_warningsflippedSecurityCheckandAuditEventAll tests live inside the existing
#[cfg(test)] mod testsblock. No production code modified, no new dependencies added.Test plan
cargo test -p flight-security— 208 tests passcargo fmt -p flight-security -- --checkclean for verification.rscargo clippy -p flight-security --lib— new tests trigger no warningsGenerated by Claude Code