Problem Statement
The reusable Python test workflow currently hard-codes the minimums and tests Nox sessions. Callers can select the runner, but cannot reduce the tested Python versions or add a repository-specific expensive session.
Recently the CI load became a bottleneck in MQT repos (due to increased PR activity). MQT Predictor is a concrete example with a very compute-heavy test pipeline. For this reason I would like to reduce its impact on our resources by introducing this Predictor strategy (should be adjusted for other repos):
- Draft pull requests should test only the latest supported Python version on Linux, macOS, and Windows.
- Ready pull requests should test every supported Python version.
- RL/model training should run only once per CI run, on Linux with the latest Python version in ready PRs.
Implementing this entirely in Predictor requires GitHub-specific event handling inside noxfile.py and test selection through exact pytest node IDs. This mixes CI scheduling policy with the local test configuration and is fragile when tests or their dependencies change. Using a complete OS × Python GitHub Actions matrix would make the policy explicit, but would also increase the number of jobs and repeat setup work.
This follows the direction already discussed in #60, where configurable versions and sessions were suggested as a way to reduce redundant CI workload.
Proposed Solution
Add backward-compatible inputs to reusable-python-tests.yml that let callers select the Nox sessions it executes.
One possible interface is:
minimums-session, defaulting to minimums
tests-session, defaulting to tests
- an optional
additional-session
The caller workflow would own event and runner policy. Consumer repositories would own their test grouping through named Nox sessions and registered pytest markers.
For Predictor, this would allow:
- draft PRs:
minimums-<latest> and tests-<latest> on every supported platform;
- ready PRs and non-PR runs: the complete version sessions;
- ready PRs and non-PR runs on Linux/latest only: one additional model-training session.
The exact input interface and realization is open for discussion, because I honestly dont know the implications for other repositories.
Problem Statement
The reusable Python test workflow currently hard-codes the
minimumsandtestsNox sessions. Callers can select the runner, but cannot reduce the tested Python versions or add a repository-specific expensive session.Recently the CI load became a bottleneck in MQT repos (due to increased PR activity). MQT Predictor is a concrete example with a very compute-heavy test pipeline. For this reason I would like to reduce its impact on our resources by introducing this Predictor strategy (should be adjusted for other repos):
Implementing this entirely in Predictor requires GitHub-specific event handling inside
noxfile.pyand test selection through exact pytest node IDs. This mixes CI scheduling policy with the local test configuration and is fragile when tests or their dependencies change. Using a complete OS × Python GitHub Actions matrix would make the policy explicit, but would also increase the number of jobs and repeat setup work.This follows the direction already discussed in #60, where configurable versions and sessions were suggested as a way to reduce redundant CI workload.
Proposed Solution
Add backward-compatible inputs to
reusable-python-tests.ymlthat let callers select the Nox sessions it executes.One possible interface is:
minimums-session, defaulting tominimumstests-session, defaulting totestsadditional-sessionThe caller workflow would own event and runner policy. Consumer repositories would own their test grouping through named Nox sessions and registered pytest markers.
For Predictor, this would allow:
minimums-<latest>andtests-<latest>on every supported platform;The exact input interface and realization is open for discussion, because I honestly dont know the implications for other repositories.