Repository navigation
tests: remove redundant and vacuous tests, repair weak ones - #319
Merged
Merged
Conversation
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.
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.
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 ingenome_inferenceandcommands, 6 integration tests). Tests of other crates (serde_json,sweepga) and of#[cfg(test)]helpers aroundbluntg; thebluntgdependency 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
.1gbwtand.1khashfiles.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 usespolish_method: Smooth), the self-loop reverse walk (unitAC, not the self-reverse-complementAT),test_cli_gbwt_output_requires_prefix(now reaches the-Ocheck),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 triedtarget/debug/impgfirst and returned with "SKIP" when no binary was found. The 6 CLI tests insrc/syng.rsfail 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 bundledwfmashand nosamtools, and checks that every laced path spells its input. 16 s.Same tests in two executables.
tests/test_panel_route_window_domain.rsre-ran the 24 tests ofexamples/panel_route_diploid_search; its 2 own tests moved totest_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) andsupported_v1; the 9 ignored tests with a documented manual command; 7 other ignored tests. 7 lines indocs/still name deleted tests incargo testcommands.