Skip to content

tests: fast default run, slow tests opt-in - #36

Merged
pgarrett-scripps merged 1 commit into
mainfrom
test-speed
Sep 25, 2026
Merged

pgarrett-scripps merged 1 commit into
mainfrom
test-speed

Conversation

@pgarrett-scripps

Copy link
Copy Markdown
Collaborator

Times (shared machine under load 30-45, 1 core, workspace venv)

run before after
default pytest tests 103.6 s (same machine, same session); 207 s in the earlier workspace baseline 41.9 s
--run-slow n/a 79.3 s
RUN_SLOW=1 HYPOTHESIS_PROFILE=thorough (what CI runs) n/a 87.4 s

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_spectra tests (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 a slow param.
  • 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_viz default and centroid= tests, test_smooth_kwarg_threads_through_convenience_api: a PASEF MS2 frame instead of an MS1 frame. Added n > 0 checks so an empty frame cannot pass silently.
  • test_v5_vocabulary._copy hard-links the 60 MB analysis.tdf_bin (falls back to a copy) since those tests only edit analysis.tdf.

Hypothesis

Profiles move to tests/conftest.py: default 30 examples, thorough 200 (at least 2x every old per-test count), deep 2000 (the old test_properties thorough). Per-test max_examples removed so the profile governs.

Marked slow (skipped unless --run-slow or RUN_SLOW=1)

  • stdio MCP server launch, core-import subprocess check, validate CLI subprocess, docs collect-from-another-dir subprocess
  • whole-file precursor sweeps (above), the docs example that iterates every precursor
  • PandasTdf.properties (390k rows; the other 18 tables cover the same path)

CI

ci.yml, publish.yml, latest-deps.yml set RUN_SLOW=1 and HYPOTHESIS_PROFILE=thorough at workflow level, so the test matrix, lowest, coverage and mcp jobs run everything. just test-all added; test-cov, codecov-tests, test-mcp set RUN_SLOW=1. CLAUDE.md / CONTRIBUTING updated.

No tests deleted, no assertions weakened, no src/ changes.

🤖 Generated with Claude Code

- 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>
@pgarrett-scripps
pgarrett-scripps merged commit 25ad2c8 into main Sep 25, 2026
14 checks passed
@pgarrett-scripps
pgarrett-scripps deleted the test-speed branch September 25, 2026 00:17
@codecov

codecov Bot commented Sep 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

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