Repository navigation
test: add end-to-end regression tests using simulate and compare - #227
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughAdded a new integration test module 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #227 +/- ##
==========================================
+ Coverage 88.27% 88.80% +0.52%
==========================================
Files 113 113
Lines 53215 53215
==========================================
+ Hits 46977 47259 +282
+ Misses 6238 5956 -282 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@tests/integration/main.rs`:
- Around line 19-20: Add the crate-level attribute to deny unsafe code by
inserting #![deny(unsafe_code)] at the very top of the integration test crate
root (above any mod declarations), so the integration tests including the
conditional module test_e2e_regression are compiled with unsafe code banned;
ensure the attribute appears before the existing #[cfg(...)] mod
test_e2e_regression line.
In `@tests/integration/test_e2e_regression.rs`:
- Around line 288-294: The test currently compares the same BAM file to itself
using assert_bams_identical(&filtered, &filtered, ...), which will pass even for
an empty file and won't catch nondeterminism in the
extract->group->simplex->filter pipeline; fix by producing two independent
outputs (e.g., run the pipeline twice into separate variables/files like
filtered_a and filtered_b) and then call assert_bams_identical(&filtered_a,
&filtered_b, "content", ...) to validate deterministic content, or alternatively
add a real record-count assertion (check the BAM record count > 0 using the same
helper used elsewhere) against the pipeline output (referencing the filtered
variable/outputs and the assert_bams_identical helper).
- Around line 333-334: The current assertion uses assert!(!success) which passes
for any non-zero exit (including unrelated errors); update the test around
compare_bams(&bam1, &bam2, "content") to assert the specific "files differ"
failure mode instead: either change compare_bams to return a typed status and
assert it equals the specific variant (e.g., CompareResult::FilesDiffer) or, if
compare_bams returns stdout/stderr text, assert that the output contains the
canonical "files differ" message; replace the generic assert!(!success, ...)
with an assertion that checks the exact failure mode from compare_bams
(referencing compare_bams, bam1, bam2).
- Around line 34-37: The helper path_str() forces UTF-8 and panics; instead
change the pipeline so paths are preserved as OsStr: remove use of path_str(),
update fgumi() and fgumi_ok() signatures to accept an argument slice generic
over AsRef<OsStr> (e.g., &[impl AsRef<OsStr>] or a concrete
&[OsString]/&[OsStr]), and pass each argument to Command::arg using .as_ref() so
non-UTF-8 paths are preserved; update call sites to pass Path/OsStr/OsString
values and only convert to &str where truly required (not for Command::arg).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 926022e6-ba97-4ec0-9462-6dbee1a682b1
📒 Files selected for processing (2)
tests/integration/main.rstests/integration/test_e2e_regression.rs
Add 6 E2E regression tests that validate full pipeline determinism without golden files. Tests use simulate to generate synthetic data, run pipeline commands, and compare outputs: - Simulate determinism (same seed → identical output) - Simplex pipeline determinism (grouped → simplex → compare) - Simplex + filter pipeline determinism - Full pipeline (fastq → extract → group → simplex → filter) - Dedup pipeline determinism - Different seeds produce different output (sanity check) Tests are feature-gated behind both `compare` and `simulate` features, so they run as part of `cargo ci-test`.
6c068b1 to
78e6996
Compare
Summary
simulateto generate synthetic data, run pipeline commands, andcompareoutputscompareandsimulatefeatures (runs incargo ci-test)Test plan
cargo nextest run --features compare,simulate -E 'test(test_e2e_regression)'cargo ci-test(2,213 tests, 0 failures)cargo ci-fmtandcargo ci-lintclean