Skip to content

ci: run a trimmed Python test matrix on pull requests - #509

Merged
JuroOravec merged 1 commit into
mainfrom
ci/trim-pr-test-matrix
Oct 28, 2026
Merged

JuroOravec merged 1 commit into
mainfrom
ci/trim-pr-test-matrix

Conversation

@JuroOravec

Copy link
Copy Markdown
Member

Part of #405, a follow-up Juro approved.

Change

py--tests.yml's test job now picks its cells by event, in one include: expression:

Event Linux Windows macOS Cells
Pull request 3.11, 3.12, 3.13, 3.15 3.11, 3.15 3.15 7
Push to main or dev, manual run 3.11, 3.12, 3.13, 3.15 3.11 to 3.15 3.11, 3.15 11

Linux 3.14 stays out of both, because the Check workflow runs the same suite there on every pull request (#489).

Saving

The saving per PR is 4 jobs and their runner slots: Windows 3.12, 3.13 and 3.14, and macOS 3.11. By the completed-run medians in the #405 proposal, that is about 24 + 27 + 26.5 + 20 ≈ 97 job-minutes. Windows drops from 5 of the free plan's 20 concurrent slots per PR to 2.

Risk

A failure that shows only on Windows 3.12 to 3.14, or only on macOS 3.11, no longer shows on the pull request. It shows in the push run on main right after the merge. Python tests has a path filter on push, the same as on pull requests, so every change that ran the trimmed set also runs the full set once merged.

Required checks

The main ruleset ("Require checks for main") requires only check. No cell of this matrix is required, so no required check disappears on pull requests.

Guards and docs

  • test_ci_workflows.py reads both sets out of the expression and pins them:

    • the full set must hold every supported Python on Windows and Linux (minus the Check workflow's Python), plus macOS on the oldest and newest;
    • the pull-request set must be exactly the stated subset, and smaller than the full set.

    So a later edit that drops main's coverage fails the test.

  • scripts/supported_versions.py, which the weekly supported-versions workflow runs, reads the Python versions from the full set, and its generate output describes both sets.

  • docs/codebase.md describes both sets and the one place that picks them.

Evidence

  • test_ci_workflows.py and test_repo_check_script.py pass (16).
  • scripts/validate.py passes.
  • supported_versions.matrix_versions() returns 3.11 to 3.15 from the new matrix.
  • This PR's own CI shows the trimmed set: 7 test cells.

🤖 Generated with Claude Code

The free plan's 20 concurrent jobs are always full, and the Python test
matrix alone takes 11 of them on every pull request, 5 on Windows. Pull
requests now run Linux on every Python, Windows on 3.11 and 3.15, and
macOS on 3.15: 7 cells. Pushes to main and dev and manual runs still run
the full 11, so a failure that shows only on Windows 3.12 to 3.14 or on
macOS 3.11 appears in the push run right after the merge.

One `include:` expression in the test job picks the set by event.
test_ci_workflows.py pins both sets: the full set must cover every
supported Python on Windows and Linux (except the one the Check workflow
runs) and macOS at both ends, and the pull-request set must be the stated
subset. scripts/supported_versions.py reads the versions from the full
set, and docs/codebase.md describes both.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@JuroOravec
JuroOravec merged commit 32c9337 into main Oct 28, 2026
1 of 21 checks passed
@JuroOravec
JuroOravec deleted the ci/trim-pr-test-matrix branch October 28, 2026 18:27
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