perf: reduce test suite from 188s to 22s (88% faster)#421
Merged
Conversation
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>
This was referenced Apr 6, 2026
Collaborator
Author
|
Workspace PR: PyAutoLabs/autolens_workspace_test#12 |
Collaborator
Author
|
Workspace PR (developer): https://github.com/PyAutoLabs/autolens_workspace_developer/pull/1 |
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
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
autolens_workspace_testandautolens_workspace_developer(workspace phase)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_testtest_autolens/aggregator/— all aggregator tests (8 tests, ~20s) →autolens_workspace_testtest_autolens/point/triangles/test_solver.py::test_real_example_jax— JAX solver test (~12s) → covered by smoke/integration testsChanged (test infrastructure)
test_autolens/conftest.py—plot_patchfixture now also mocksplt.tight_layoutandplt.colorbarto 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