test: complete test-suite overhaul (phases 1-7)#194
Merged
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Moves all test_*.py files and dataset/, tracks/, variants/ subdirs into tests/integration/, preserving subdirectory structure. Increments parents[N] and parent.parent depth references by one to account for the extra nesting level; suite stays at 500 passed, 6 skipped, 3 deselected, 2 xfailed. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Audit 35 integration test files (137 test functions) into Delete (5), Port (77), and Keep-as-integration (55) buckets, with a polymorphism-gap section covering 8 axes. Gating document for Phases 4+ (delete pass, unit builders, coverage trim). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
5 pure-utility tests (bed_to_regions, splits_sum_le_value, normalize_contig_name) with no fixture dependencies. Whole-file move per audit classification — all Port, zero Keep. Phase 5 utility component of the test suite overhaul.
Both files move together to preserve the prepend-mode sibling import (`from utils import nonoverlapping_intervals`). 4 parametrized cases; no fixture dependencies; the tested helper is itself a test utility, not library code. Phase 5 tracks (broader) component.
Move test_write_duplicate_track_names_rejected to tests/unit/dataset/test_write_tracks.py (port: input validation fires before disk I/O). Rename the integration file to test_write_tracks_e2e.py to avoid the pytest prepend-mode basename collision (precedent: reconstruct plan). Phase 5 tracks (broader) component.
12 Table tests (init, column_map, from_path format dispatch, count_intervals kernel, contig normalization). All audit-Port, zero Keep. tmp_path is the only fixture used; no project scaffolding. Phase 5 tracks (broader) component — final file.
Add session-scoped reference fixture to tests/conftest.py. Two existing files (test_ref_ds_splicing, test_ref_ds_splice_settings) duplicated the same Reference.from_path(..., in_memory=False) construction; both now consume the conftest fixture. Convention carve-out documented in the fixture docstring — metadata-only construction is cheap enough to warrant centralization. Phase 5 ref/fasta component — fixture pre-work.
3 Fasta.read pad/no-pad boundary tests. Audit-Port whole-file move; only ref_fasta fixture used (already in conftest); no basename collision. Phase 5 ref/fasta component.
2 remaining audit-Port tests (test_getitem, test_padded_slice) move whole-file to tests/unit/dataset/. The local reference fixture is deleted in favor of the conftest fixture promoted in the previous commit. Tidy the pytest_cases import (fixture no longer needed). Phase 5 ref/fasta component — final move.
Follow-up to 8eafb36 — the prior commit landed the rename only; pre-commit's working-tree stash hid the fixture-drop edits. This commit removes the duplicate `reference` fixture from the moved file and tidies the unused `pytest_cases.fixture` import. The moved tests pick up the conftest fixture by name.
Move test_with_insertion_fill_rejects_when_no_tracks_active to tests/unit/dataset/test_with_insertion_fill.py. The test uses gvl.get_dummy_dataset() (gvl-shipped helper, not a project toy- dataset fixture) and only checks API-level rejection behavior. The 2 remaining tests in the integration file exercise the full reconstruction call path and stay in integration. Phase 5 dataset polymorphism component — minimal scope (test_ds_indexing deferred pending a make_dataset consumer; see status doc).
Explore-agent systematic comparison of every remaining integration test against the unit tier found zero strict redundancies. The audit's Port/Delete buckets already captured everything that could move; remaining Keeps exercise write→read roundtrips, byte-comparison against real FASTA, or full reconstruction call paths that no unit test covers. Last component before the overhaul is done: Phase 7 (htmlcov CI upload).
Runs the existing test-cov pixi task on py312 in parallel with the pytest matrix. Publishes htmlcov/ and coverage.xml as separate GitHub Actions artifacts; both upload with if-no-files-found=error so a silently-empty artifact never lands. Closes the test-suite-overhaul Phase 7 (CI report).
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.
Summary
Completes the test-suite overhaul across all 7 phases. The tree is now split into a fast unit tier (no project fixtures) and an integration tier (real on-disk artifacts), with a CI job publishing coverage HTML on every PR.
pytest-covconfig +test-covpixi task; scaffoldedtests/unit/,tests/integration/,tests/_builders/; relocated all existing tests undertests/integration/.tests/conftest.py(ref_fasta,phased_{vcf,pgen,svar}_gvl,kg_*,source_*,issue_153_*,vcf_dir,pgen_dir,bigwig_dir,consensus_dir,filtered_svar); migrated every integration file to use them.docs/superpowers/specs/2026-05-24-test-audit.mdclassifying 137 functions across 35 files (Delete: 5, Port: 77, Keep: 55).test_filter_af.py,test_rs_indexing147-case cross-product,test_interval_track.py, etc.).make_ragged_seqs,make_ragged_intervals)make_tracksbuilder + 19-test insertion-fill extraction)choose_exonic_variants)get_splice_bed+RefDatasetsettings/validation)test_utils.pywhole-file)test_random_nonoverlapping+ siblingutils.py,test_write_tracksatomic split (integration renamed_e2efor basename-collision avoidance),test_table.pywhole-filereferencefixture promoted to conftest with docstring carve-out (metadata-only Reference is cheap);test_fasta.py+test_ref_ds.pywhole-file movestest_with_insertion_fill_rejects_when_no_tracks_activeextracted;test_ds_indexingdeferred (would require a speculativemake_datasetbuilder — YAGNI)coveragejob in.github/workflows/test.yamlrunstest-covon py312 in parallel with the pytest matrix; publisheshtmlcov/+coverage.xmlas GHA artifacts on every PR and main push.Final state
tests/_builders/exportsmake_ragged_seqs,make_ragged_intervals,make_tracks.make_dataset+test_ds_indexingport (no consumer beyond one test).Test Plan
pytestmatrix (py310–py313) passes on every entry.coveragejob uploadshtmlcov/andcoverage.xmlartifacts.htmlcovartifact from the CI run; spot-check the report renders.docs/superpowers/specs/2026-05-24-test-suite-overhaul-status.md(living status snapshot) — "Notable decisions / gotchas" section captures the non-obvious choices (basename collisions, sibling-import preservation, conftest carve-out, etc.).🤖 Generated with Claude Code