From d2130734d674dd8b62780051caac65dcb8c48625 Mon Sep 17 00:00:00 2001 From: "Edgar Y. Walker" Date: Fri, 27 Nov 2026 18:09:10 -0800 Subject: [PATCH] ci: limit pull request test matrices to Python 3.13 (ITL-1566) --- .github/workflows/run-postgres-tests.yml | 2 +- .github/workflows/run-specification-tests.yml | 2 +- .zed/rules | 11 +++++------ CLAUDE.md | 11 +++++------ CONTRIBUTING.md | 9 +++++---- changelog.d/ITL-1566.md | 5 +++++ 6 files changed, 22 insertions(+), 18 deletions(-) create mode 100644 changelog.d/ITL-1566.md diff --git a/.github/workflows/run-postgres-tests.yml b/.github/workflows/run-postgres-tests.yml index ed5fd2a3d..2f341d623 100644 --- a/.github/workflows/run-postgres-tests.yml +++ b/.github/workflows/run-postgres-tests.yml @@ -23,7 +23,7 @@ jobs: id-token: write strategy: matrix: - python-version: ["3.11", "3.12", "3.13"] + python-version: ${{ fromJSON(github.event_name == 'pull_request' && '["3.13"]' || '["3.11", "3.12", "3.13"]') }} services: postgres: diff --git a/.github/workflows/run-specification-tests.yml b/.github/workflows/run-specification-tests.yml index 2ff973bc1..58ae1b930 100644 --- a/.github/workflows/run-specification-tests.yml +++ b/.github/workflows/run-specification-tests.yml @@ -24,7 +24,7 @@ jobs: id-token: write strategy: matrix: - python-version: ["3.11", "3.12", "3.13"] + python-version: ${{ fromJSON(github.event_name == 'pull_request' && '["3.13"]' || '["3.11", "3.12", "3.13"]') }} steps: - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 diff --git a/.zed/rules b/.zed/rules index 987b73fd3..4ff2e31e5 100644 --- a/.zed/rules +++ b/.zed/rules @@ -316,10 +316,9 @@ What runs where (developer, November 16, 2026; ITL-1181): Python 3.11, 3.12 and 3.13, the others on 3.11. It applies only while the repository is private (ITL-1193). - `lint.yml` (job `Ruff and basedpyright`) runs the first three on every pull request and - push to `main`, on both repositories. `run-tests.yml` runs pytest with coverage: on a pull - request one job, `Tests (3.13)`, whose coverage is the one reported to Codecov; on a push - to `main`, Python 3.11, 3.12 and 3.13. Once the required CI no longer applies, a pull - request is tested on Python 3.13 only, and a failure only 3.11 or 3.12 shows is first + push to `main`. The main, PostgreSQL and specification test suites run with coverage on + Python 3.13 on pull requests and on Python 3.11, 3.12 and 3.13 on pushes to `main` + (ITL-1566). For all three suites, a failure specific to Python 3.11 or 3.12 is first seen on `main`. - Each test job names its suite, so no two checks share a name (ITL-1212): `Tests (3.x)` (`run-tests.yml`), `Specification tests (3.x)` (`run-specification-tests.yml`, `test-specification/`) @@ -328,8 +327,8 @@ What runs where (developer, November 16, 2026; ITL-1181): - In CI the tests run in parallel, one worker per logical CPU (pytest-xdist, `-n logical`; `-n auto` counts physical cores, one on a GitHub runner). One place turns it on, `tests/conftest.py`, when `CI` is `true` and no `-n` is given; `-n 0` keeps a run serial - (the PostgreSQL and SpiralDB integration jobs). Coverage on Python 3.12 and later uses - `COVERAGE_CORE=sysmon`. + (the PostgreSQL and SpiralDB integration jobs). In `run-tests.yml`, coverage on Python + 3.12 and later uses `COVERAGE_CORE=sysmon`. - Locally the tests run serially. `uv run pytest -n 4 tests/` runs them on four workers; each worker holds its own copy of the suite's memory, so do it only on a machine with cores and memory to spare, never beside another heavy process. diff --git a/CLAUDE.md b/CLAUDE.md index 0c732eed0..bea24d4b5 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -327,10 +327,9 @@ What runs where (developer, November 16, 2026; ITL-1181): Python 3.11, 3.12 and 3.13, the others on 3.11. It applies only while the repository is private (ITL-1193). - `lint.yml` (job `Ruff and basedpyright`) runs the first three on every pull request and - push to `main`, on both repositories. `run-tests.yml` runs pytest with coverage: on a pull - request one job, `Tests (3.13)`, whose coverage is the one reported to Codecov; on a push - to `main`, Python 3.11, 3.12 and 3.13. Once the required CI no longer applies, a pull - request is tested on Python 3.13 only, and a failure only 3.11 or 3.12 shows is first + push to `main`. The main, PostgreSQL and specification test suites run with coverage on + Python 3.13 on pull requests and on Python 3.11, 3.12 and 3.13 on pushes to `main` + (ITL-1566). For all three suites, a failure specific to Python 3.11 or 3.12 is first seen on `main`. - Each test job names its suite, so no two checks share a name (ITL-1212): `Tests (3.x)` (`run-tests.yml`), `Specification tests (3.x)` (`run-specification-tests.yml`, `test-specification/`) @@ -339,8 +338,8 @@ What runs where (developer, November 16, 2026; ITL-1181): - In CI the tests run in parallel, one worker per logical CPU (pytest-xdist, `-n logical`; `-n auto` counts physical cores, one on a GitHub runner). One place turns it on, `tests/conftest.py`, when `CI` is `true` and no `-n` is given; `-n 0` keeps a run serial - (the PostgreSQL and SpiralDB integration jobs). Coverage on Python 3.12 and later uses - `COVERAGE_CORE=sysmon`. + (the PostgreSQL and SpiralDB integration jobs). In `run-tests.yml`, coverage on Python + 3.12 and later uses `COVERAGE_CORE=sysmon`. - Locally the tests run serially. `uv run pytest -n 4 tests/` runs them on four workers; each worker holds its own copy of the suite's memory, so do it only on a machine with cores and memory to spare, never beside another heavy process. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6f820911e..c21a7ce25 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -37,10 +37,11 @@ uv run pytest tests/ error fails the check. The existing errors are recorded in `.basedpyright/baseline.json`. Fix a new error, and do not regenerate the baseline to hide it. - **Tests.** The full suite takes a while; while you work, run the folder or file you - changed, for example `uv run pytest tests/test_docs/`. CI's own test command differs from - the local one: it names the Python version (3.13 on a pull request; 3.11, 3.12 and 3.13 on - `main`), runs in parallel with coverage, and leaves out the PostgreSQL tests, which a - separate job runs. + changed, for example `uv run pytest tests/test_docs/`. CI runs the main, PostgreSQL and + specification test suites in separate jobs with coverage. All three run on Python 3.13 + on pull requests and on Python 3.11, 3.12 and 3.13 on pushes to `main`. A failure specific + to Python 3.11 or 3.12 is first seen on `main` for any of these suites. The main test job + runs in parallel. Two more commands were not run while writing this page: diff --git a/changelog.d/ITL-1566.md b/changelog.d/ITL-1566.md new file mode 100644 index 000000000..26866074e --- /dev/null +++ b/changelog.d/ITL-1566.md @@ -0,0 +1,5 @@ +### Changed + +- Run the PostgreSQL and specification test suites on Python 3.13 only for pull requests + to match the main test suite. Pushes to `main` still run all three suites on Python + 3.11, 3.12 and 3.13.