Test/phase 2 integration#134
Merged
Merged
Conversation
Adds a new rneat/tests/ harness that exercises the real binary boundary (CLI → config → model → output) via assert_cmd. Four integration suites with 12 tests total, plus one prod fix that the suite caught on its first run. New harness: - tests/common/mod.rs — shared helpers (binary command, fixtures, config builders, decompression). Also provides a GenReadsConfig builder with paired-ended, model, thread, and seed knobs. - New dev-deps: assert_cmd, predicates. cli_smoke.rs (4 tests): - `rneat --help` lists all 6 subcommands. - Each subcommand's `--help` exits 0 and mentions --configuration-yaml. - Missing config file → non-zero exit + stderr error message. - No arguments → non-zero exit + help text on stderr. pipeline_e2e.rs (2 tests): - gen-reads with default model produces a structurally well-formed FASTQ (multiple of 4 lines, '@'/+' markers, seq.len == qual.len). - gen-seq-error-model with binned_quality_bins → gen-reads → only bin-valued qualities appear in the output FASTQ. Prod fix caught by the second pipeline test: gen-reads previously loaded `quality_score_model` independently from `sequence_error_model`, so the QualityScoreModel embedded in a trained SequencingErrorModel was silently ignored. When a user set `sequence_error_model:` without a separate `quality_score_model:`, gen-reads quietly fell back to the built-in default — meaning binned-quality training had no effect on output. Fixed in gen_reads/utils/runner.rs by falling through to the SeqErrorModel's embedded QSM when no explicit override is configured. This matches the user-facing docstring in gen_reads_template.yml. determinism.rs (3 tests): - Same seed, single-threaded → same record multiset. - Same seed, multi-threaded → same record multiset. - Different seeds → different output (seed argument is load-bearing). Comparisons are on decompressed contents (gzip headers carry mtime). Multiset rather than byte-identical because rneat iterates HashMaps during contig assembly, so the line order in the output is non- deterministic even with num_threads=1; the record *set* is stable. fastq_validation.rs (3 tests): - Single-ended FASTQ passes strict structural validation (ACGTN-only seq, printable-ASCII qual, seq.len == qual.len) and every read's length matches the configured read_len. - Paired-end run produces both _r1 and _r2 with equal record counts; R1 names end in /1, R2 names end in /2, and name stems match pairwise. - Every quality byte decodes to a valid Phred+33 score in [0, 93]. cargo test --workspace: 12 new integration tests + 355 existing, all passing. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adding integration tests