Repository navigation
test: consolidate the byte-identity file-compare idiom into a shared helper - #950
Conversation
…helper The cutover-parity tests each reimplemented `assert_eq!(read_to_string(a), read_to_string(b))` inline (dedup, group, clip, retag, correct — 7 sites). Add a single `assert_text_files_eq(actual, expected, label)` to the shared `helpers/assertions.rs` (with unit tests for the identical / divergent / missing cases) and route those sites through it. Pure test-infra hygiene; the existing cutover assertions are unchanged in behavior. The helper deliberately does not guard for non-empty content — whether an output file must carry data rows is specific to the metric being compared, so that check stays with its caller.
|
Note Reviews pausedUse the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Essentials Run ID: 📒 Files selected for processing (6)
Included review availability: 0 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour. WalkthroughThe changes add a shared byte-for-byte text-file assertion helper and replace direct string comparisons in cutover parity tests for metrics and histogram outputs. ChangesText-file parity assertions
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This change centralizes parity-test file comparisons without changing their behavior, so no merge-blocking production risk remains. 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
Comment |
|
@coderabbitai pause |
✅ Action performedReviews paused. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #950 +/- ##
==========================================
- Coverage 94.44% 94.44% -0.01%
==========================================
Files 307 307
Lines 151152 151152
==========================================
- Hits 142763 142751 -12
- Misses 8389 8401 +12 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
Pure test-infra hygiene. The cutover-parity tests each reimplemented the byte-identity file-compare idiom
assert_eq!(read_to_string(a), read_to_string(b))inline — 7 sites across 5 files (dedup, group, clip, retag, correct). This consolidates them into a singleassert_text_files_eq(actual, expected, label)in the sharedtests/integration/helpers/assertions.rs, with unit tests for the identical / divergent / missing-file cases.Behavior-preserving: same files, same
actual/expectedordering, same per-site labels — the existing cutover assertions are unchanged and the full suite stays green. The helper deliberately does not guard for non-empty content: whether an output file must carry data rows is specific to the metric being compared, so any such check stays with its caller.Risk: command output changes: none;
unsafechanges: none, andCLAUDE.mdallowlist changes: none; memory bounds, queue capacity, and thread/backpressure policy changes: none.Added
assert_text_files_eqfor byte-identical text-file assertions. Added tests for identical, divergent, and missing files. Replaced seven inline comparisons in cutover-parity tests while preserving file order, labels, assertion behavior, and caller-specific non-empty checks.