Skip to content

perf: reduce test suite from 188s to 22s (88% faster)#421

Merged
Jammy2211 merged 1 commit intomainfrom
feature/unit-test-profiling
Apr 6, 2026
Merged

perf: reduce test suite from 188s to 22s (88% faster)#421
Jammy2211 merged 1 commit intomainfrom
feature/unit-test-profiling

Conversation

@Jammy2211
Copy link
Copy Markdown
Collaborator

Summary

Reduces the PyAutoLens unit test suite from 188s (286 tests) to 22s (245 tests) — an 88% speedup. Moves in-development LOS tests and database-heavy aggregator tests to integration test repos where they belong, removes a redundant JAX solver test now covered by smoke tests, and optimises the test harness by mocking expensive matplotlib layout operations.

API Changes

None — internal changes only. All changes are to test files; no source code was modified.

Test Plan

  • Full PyAutoLens test suite passes (245/245)
  • Moved tests to be re-added in autolens_workspace_test and autolens_workspace_developer (workspace phase)
  • Smoke tests confirm no downstream breakage
Full API Changes (for automation & release notes)

No public API changes. All modifications are test-only:

Removed (from unit tests — moved to integration)

  • test_autolens/lens/test_los.py — full LOS test suite (25 tests, ~130s) → autolens_workspace_developer + autolens_workspace_test
  • test_autolens/aggregator/ — all aggregator tests (8 tests, ~20s) → autolens_workspace_test
  • test_autolens/point/triangles/test_solver.py::test_real_example_jax — JAX solver test (~12s) → covered by smoke/integration tests

Changed (test infrastructure)

  • test_autolens/conftest.pyplot_patch fixture now also mocks plt.tight_layout and plt.colorbar to skip expensive matplotlib layout computation (~12s saved)
  • test_autolens/imaging/test_simulate_and_fit_imaging.py — complex fit test grid reduced from 21×21 to 15×15 (~0.7s saved)

🤖 Generated with Claude Code

Move LOS and aggregator tests to integration test repos (in-development
and database-heavy respectively), remove redundant JAX solver test
covered by smoke tests, shrink complex fit grid, and mock tight_layout
and colorbar in plot_patch fixture to skip expensive matplotlib layout
computation during test runs.

Closes #420

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Jammy2211
Copy link
Copy Markdown
Collaborator Author

Workspace PR: PyAutoLabs/autolens_workspace_test#12

@Jammy2211
Copy link
Copy Markdown
Collaborator Author

@Jammy2211 Jammy2211 merged commit 3001f92 into main Apr 6, 2026
2 checks passed
@Jammy2211 Jammy2211 deleted the feature/unit-test-profiling branch April 6, 2026 18:40
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