test: remove vacuous and duplicate tests, enable xdist#135
Merged
Conversation
An audit found 86 tests (99 nodes) that assert only framework mechanics, duplicate a cheaper tier's coverage, or re-run already-proven code paths. Biggest win is e2e: 27 of 57 nodes were per-test uvicorn boots or subprocess runs fully covered by in-process TestClient/CliRunner tests.
pytest-xdist was a declared dev dependency but never invoked. On 4 cores the suite drops from 83s to 26s (non-e2e, coverage on) and 240s to 83s (e2e).
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.
Removes 86 low-value test functions (99 collected nodes, ~720 lines) surfaced by a full-suite audit, and turns on
pytest-xdistparallelism that was already a declared dependency but never wired intoaddopts. Locally on 4 cores this takes the non-e2e suite from 83s to 26s and the e2e suite from 240s to 83s.The
e2etier booted a freshuvicornsubprocess for nearly every test even though most of those endpoints already had cheaperTestClientcoverage intests/integration/test_api/. Three parallel audits read every test file end-to-end and flagged only exact cross-tier duplicates, pure framework-mechanics assertions (e.g. pydantic's own 422 validation), and re-runs of an already-covered code path — every parsing edge case, algorithm-correctness test, and named regression test was left untouched.tests/e2e/: cut 14 functions (27 nodes) — mostly the per-endpoint live-server sweep intest_api_server.pyandreturncode == 0-only stats checkstests/integration/: cut 43 functions — largely pure-pydantic 422 checks and key-existence-only "shape" assertions already covered by a value-asserting siblingtests/unit/: cut 29 functions — mostly cosmetic CLI-formatting tests and re-runs of an already-covered tolerance-matching enginepyproject.toml: add-n autoto pytestaddoptsGenerated by Claude Code