Skip to content

[codex] Speed up test matrix - #1623

Merged
EmilStenstrom merged 3 commits into
masterfrom
codex/speed-up-test-matrix
Apr 25, 2026
Merged

EmilStenstrom merged 3 commits into
masterfrom
codex/speed-up-test-matrix

Conversation

@EmilStenstrom

Copy link
Copy Markdown
Collaborator

Summary

This splits the slow full test run into focused CI lanes so the compatibility matrix stops paying for browser setup and heavyweight snapshot tests on every Python/Django/OS combination.

Changes include:

  • Run the main tox test env with pytest-xdist, excluding browser E2E and benchmark snapshot tests.
  • Keep tests/test_templatetags_provide.py serial because it has shared cache assertions that are not xdist-safe.
  • Add dedicated e2e and benchmark_snapshot tox envs.
  • Make the Django E2E test server opt-in instead of an autouse fixture.
  • Add DJC_TEST_BROWSERS, defaulting to all browsers locally while CI runs Chromium in the E2E lane.
  • Reduce Windows matrix coverage to smoke coverage while keeping full Linux Python/Django coverage.
  • Stop installing Playwright browsers in non-E2E CI jobs.

Timing

Measured locally before the change:

  • uv run pytest -q: 1325 passed, 7 skipped, real 120.50s

Measured locally after the split:

  • main non-E2E/non-benchmark run: 1211 passed, 6 skipped, real 9.69s
  • Chromium E2E lane: 37 passed, real 11.55s
  • benchmark snapshot lane: 4 passed, real 1.20s

The comparable local split is about 22.44s total versus 120.50s before. CI should see a larger practical win because Playwright browser installation now only happens in the E2E job.

Validation

  • uv run tox -e py314-django52
  • uv run tox -e e2e,benchmark_snapshot
  • uv run ruff check tests/conftest.py tests/e2e/utils.py
  • uv run ruff format --check tests/conftest.py tests/e2e/utils.py
  • uv run mypy tests/conftest.py tests/e2e/utils.py

@EmilStenstrom

Copy link
Copy Markdown
Collaborator Author

@JuroOravec Thoughts?

@github-actions

Copy link
Copy Markdown
Contributor

Performance Benchmark Results

Comparing PR changes against master branch:

Benchmarks that have stayed the same:

Change Before [f26b66b] After [c754942] Ratio Benchmark (Parameter)
69.2±0.5ms 70.0±0.9ms 1.01 Components vs Django.timeraw_render_lg_first('django')
251±6ms 251±4ms 1 Components vs Django.timeraw_render_lg_first('django-components')

@github-actions

Copy link
Copy Markdown
Contributor

Performance Benchmark Results

Comparing PR changes against master branch:

Benchmarks that have stayed the same:

Change Before [af73533] After [3131079] Ratio Benchmark (Parameter)
70.1±0.6ms 70.0±1ms 1 Components vs Django.timeraw_render_lg_first('django')
253±3ms 251±5ms 0.99 Components vs Django.timeraw_render_lg_first('django-components')

@EmilStenstrom
EmilStenstrom force-pushed the codex/speed-up-test-matrix branch from a219ca0 to 1018f95 Compare April 25, 2026 07:24
@github-actions

Copy link
Copy Markdown
Contributor

Performance Benchmark Results

Comparing PR changes against master branch:

Benchmarks that have stayed the same:

Change Before [af73533] After [19bf059] Ratio Benchmark (Parameter)
61.2±0.7ms 61.6±1ms 1.01 Components vs Django.timeraw_render_lg_first('django')
222±3ms 224±3ms 1.01 Components vs Django.timeraw_render_lg_first('django-components')

@EmilStenstrom
EmilStenstrom marked this pull request as ready for review April 25, 2026 08:28
@github-actions

Copy link
Copy Markdown
Contributor

Performance Benchmark Results

Comparing PR changes against master branch:

Benchmarks that have stayed the same:

Change Before [3d5261c] After [ee17c72] Ratio Benchmark (Parameter)
70.5±1ms 69.8±0.7ms 0.99 Components vs Django.timeraw_render_lg_first('django')
252±3ms 250±3ms 0.99 Components vs Django.timeraw_render_lg_first('django-components')

@github-actions

Copy link
Copy Markdown
Contributor

Performance Benchmark Results

Comparing PR changes against master branch:

Benchmarks that have stayed the same:

Change Before [3d5261c] After [7cf917f] Ratio Benchmark (Parameter)
68.4±1ms 67.3±2ms 0.98 Components vs Django.timeraw_render_lg_first('django')
243±2ms 242±3ms 1 Components vs Django.timeraw_render_lg_first('django-components')

@EmilStenstrom
EmilStenstrom merged commit 2df59e3 into master Apr 25, 2026
15 checks passed
@EmilStenstrom
EmilStenstrom deleted the codex/speed-up-test-matrix branch April 25, 2026 11:38
@JuroOravec

Copy link
Copy Markdown
Collaborator

@EmilStenstrom Great idea! I remember that in the past there was a Firefox-specific bug w.r.t. to Window.Components. So I think there is value in testing other browsers. But instead of it being part of main CI checks, it can be e.g. a weekly pipeline. See #1652

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.

2 participants