Skip to content

Run the test suite on pull requests - #41

Merged
fbunt merged 2 commits into
mainfrom
ci-run-tests-on-prs
Jul 29, 2026
Merged

Run the test suite on pull requests#41
fbunt merged 2 commits into
mainfrom
ci-run-tests-on-prs

Conversation

@fbunt

@fbunt fbunt commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a pull_request trigger to the Tests workflow.

It previously ran only on pushes to main and a weekly cron, so no pull request
ever had its tests run
. The only check reporting on a PR was the pre-commit
workflow, which covers formatting and linting and nothing else, so a PR could show
green with a failing suite. The tests first ran against the merged result, once it
was already on main.

Details

The new trigger mirrors the paths-ignore list from the push trigger, so PRs that
only touch docs/, paper/, or notebooks/ still skip the run.

No concurrency change was needed. The existing group keys on github.ref, which is
refs/pull/N/merge for a pull request, so it is already unique per PR --
cancel-in-progress supersedes earlier runs when a PR is updated without affecting
other PRs.

Cost

Five conda-based jobs per PR push, covering Python 3.10 through 3.14. That is the
tradeoff being made deliberately: a PR that breaks the suite should say so before it
merges rather than after. If the cost turns out to be annoying in practice, the
matrix could be trimmed for PRs and left full for main and the cron, but starting
with full parity seems better than guessing which versions matter.

Verifying it works

This PR does not touch the ignored paths, so opening it should itself trigger the
workflow. If the Tests checks appear here, the change works.

fbunt added 2 commits July 28, 2026 18:43
The Tests workflow only triggered on pushes to main and a weekly cron, so
no pull request ever had its tests run. A PR showed green from the
pre-commit workflow alone, which checks formatting and linting and nothing
else, and the suite first ran against the merged result once it was already
on main.

The pull_request trigger mirrors the paths-ignore list from the push
trigger so docs, paper, and notebook only changes still skip the run. The
existing concurrency group keys on github.ref, which is refs/pull/N/merge
for a pull request, so successive pushes to one PR cancel the earlier run
without affecting other PRs.

This costs five conda based jobs per PR push, covering Python 3.10 to
3.14, which is the point: a broken PR should say so before it lands rather
than after.
Replaces the hardcoded -n 2 with -n auto so the worker count comes from
the machine rather than a number that has to be revisited when runner
specs change.

This is not a speedup. Measured across the full matrix it changes nothing:
auto resolves to 2 workers here, the same as before, because psutil is in
the CI environment and pytest-xdist's auto counts physical cores, of which
the runner has two. Mean test step went 376s to 387s, which is noise. Only
-n logical would reach the four logical CPUs, and whether hyperthread
siblings help this mostly CPU bound suite is unmeasured, so that is left
alone.
@fbunt
fbunt force-pushed the ci-run-tests-on-prs branch from 4451e6b to c7ed493 Compare July 29, 2026 01:10
@fbunt
fbunt merged commit 9f2f739 into main Jul 29, 2026
7 checks passed
@fbunt
fbunt deleted the ci-run-tests-on-prs branch July 29, 2026 01:11
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