Skip to content

tests: remove redundant and vacuous tests, repair weak ones - #319

Merged
AndreaGuarracino merged 2 commits into
mainfrom
tests/prune-redundant
Nov 14, 2026
Merged

AndreaGuarracino merged 2 commits into
mainfrom
tests/prune-redundant

Conversation

@AndreaGuarracino

Copy link
Copy Markdown
Member

An audit read 1015 tests (all unit tests and the 49 integration files) and classified each one from its body and from the code it calls. A test was removed only when another test makes the same assertions on the same code path, or when it cannot fail for a bug in impg. Where one assertion had no other cover, it was moved into the test that stays.

Removed. Tests covered by a broader test (38 in src/syng.rs, 27 in 11 other core files, 15 in genome_inference and commands, 6 integration tests). Tests of other crates (serde_json, sweepga) and of #[cfg(test)] helpers around bluntg; the bluntg dependency goes with them, since no other code used it. 6 ignored tests: 4 needed a graph under /home/erikg, 1 asserted something its own ignore text calls unsatisfiable, 1 was marked superseded. 2 ignored tests that fail by design.

Kept against the audit. 6 tests where the cover was not shown, for example the 3 checks of the first byte of .1gbwt and .1khash files.

Repaired. Tests whose fixture never reached the code they name: detect_repeat (now a 1013 bp x 10 tandem and a random control), the smooth polish (now uses polish_method: Smooth), the self-loop reverse walk (unit AC, not the self-reverse-complement AT), test_cli_gbwt_output_requires_prefix (now reaches the -O check), exp_underflow_point (now calls the function), and 6 more.

No silent skip. 13 integration files take the binary from env!("CARGO_BIN_EXE_impg"). Before, 7 of them tried target/debug/impg first and returned with "SKIP" when no binary was found. The 6 CLI tests in src/syng.rs fail with a message when the binary is missing.

End-to-end test runs. test_full_pipeline (index, partition, graph, lace) was ignored. It runs by default on 4 strains x 60 kb with the bundled wfmash and no samtools, and checks that every laced path spells its input. 16 s.

Same tests in two executables. tests/test_panel_route_window_domain.rs re-ran the 24 tests of examples/panel_route_diploid_search; its 2 own tests moved to test_panel_route_diploid_search.rs.

Full suite, rustc 1.99.1, overflow checks: main 1046 passed, 30 ignored, 53 executables; this branch 940 passed, 0 failed, 22 ignored, 51 executables. Run time is unchanged (333 s against 311 s, within the run-to-run spread of the crush tests): one test, c4_slice_auto_crush_with_flank_preserves_path_sequences, takes 137 s.

Not touched: files under the policy source hash (panel_route_search_policy) and supported_v1; the 9 ignored tests with a documented manual command; 7 other ignored tests. 7 lines in docs/ still name deleted tests in cargo test commands.

An audit read 1015 tests. Removed: tests covered by a broader test, tests of other crates or of test-only helpers, and 6 ignored tests that need data outside the repository or assert something unsatisfiable. Repaired: tests whose fixture did not reach the code they name. Tests no longer skip when the impg binary is missing. test_full_pipeline runs by default on 4 strains x 60 kb with the bundled wfmash and checks that laced paths spell the inputs.
@AndreaGuarracino
AndreaGuarracino merged commit e4d938f into main Nov 14, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant