tests: fast default run, slow tests opt-in - #36
Merged
Merged
Conversation
- Shrink inputs: precursor sweeps use the first 60 precursors (whole file is a slow variant), the pure-Python shuffled-frame merge uses a 40k-point m/z band, watershed smoothing tests use the lowest-TOF eighth of the MS1 frame, viz and smooth-kwarg tests use a PASEF MS2 frame, edited-DB copies hard-link the frame binary. - Hypothesis: profiles in tests/conftest.py (default 30, thorough 200, deep 2000); per-test max_examples removed so the profile governs. - slow marker (subprocess launches, whole-file sweeps, 390k-row table), skipped unless --run-slow or RUN_SLOW=1. - CI, publish and latest-deps workflows set RUN_SLOW=1 and HYPOTHESIS_PROFILE=thorough; just test-all, test-cov and test-mcp run slow tests. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Times (shared machine under load 30-45, 1 core, workspace venv)
pytest tests--run-slowRUN_SLOW=1 HYPOTHESIS_PROFILE=thorough(what CI runs)The 20 s target is not met under this load. No single test is over 1.7 s now; what is left is ~770 tests at ~50 ms each plus ~5 s of collection/imports. On a quiet machine the default run should be roughly half that.
Shrunk (still run by default)
iter_precursor_spectratests (matches merged peaks, scattered order + tiny cache, decode-once): the first 60 precursors (20 frames, 39 multi-frame). The whole-file version (2519 precursors) is kept as aslowparam.test_merge_peaks_shuffled_frame_matches_tof_scan_order[python]: the lowest-m/z 40,000 points of the largest MS1 frame (a contiguous m/z band, all scans) instead of all ~350,000. The numba variant still uses the full frame.TestWatershedCentroiderCall: the lowest-TOF eighth of the first MS1 frame instead of all ~340,000 points.test_vizdefault andcentroid=tests,test_smooth_kwarg_threads_through_convenience_api: a PASEF MS2 frame instead of an MS1 frame. Addedn > 0checks so an empty frame cannot pass silently.test_v5_vocabulary._copyhard-links the 60 MBanalysis.tdf_bin(falls back to a copy) since those tests only editanalysis.tdf.Hypothesis
Profiles move to
tests/conftest.py:default30 examples,thorough200 (at least 2x every old per-test count),deep2000 (the oldtest_propertiesthorough). Per-testmax_examplesremoved so the profile governs.Marked
slow(skipped unless--run-sloworRUN_SLOW=1)PandasTdf.properties(390k rows; the other 18 tables cover the same path)CI
ci.yml,publish.yml,latest-deps.ymlsetRUN_SLOW=1andHYPOTHESIS_PROFILE=thoroughat workflow level, so the test matrix, lowest, coverage and mcp jobs run everything.just test-alladded;test-cov,codecov-tests,test-mcpsetRUN_SLOW=1. CLAUDE.md / CONTRIBUTING updated.No tests deleted, no assertions weakened, no
src/changes.🤖 Generated with Claude Code