#65749 closed enhancement (fixed)
Allow the PHPUnit test runner to be set by a repository variable
| Reported by: | lancewillett | Owned by: | lancewillett |
|---|---|---|---|
| Priority: | normal | Milestone: | 7.1 |
| Component: | Build/Test Tools | Version: | |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: |
Description
The PHPUnit workflows run on a fixed runner (ubuntu-24.04), passed as the os input to reusable-phpunit-tests-v3.yml and consumed at runs-on: ${{ inputs.os }}.
This makes the runner overridable by a repository variable, so maintainers can direct the PHPUnit matrices to a specific runner, for example a dedicated runner during high-load release windows, without editing the workflow.
reusable-phpunit-tests-v3.yml changes its runs-on to:
runs-on: ${{ vars.PHPUNIT_RUNNER || inputs.os }}
With the PHPUNIT_RUNNER variable unset (the default), jobs run on inputs.os exactly as today, so there is no behavior change. It is backward-compatible for every branch that calls the workflow at @trunk; no input is added or made required.
Change History (4)
This ticket was mentioned in PR #12745 on WordPress/wordpress-develop by @lancewillett.
15 hours ago
#1
@lancewillett commented on PR #12745:
15 hours ago
#2
For this to work, @bazza or another GitHub admin will need to flip the PHPUNIT_RUNNER variable before / after release using GitHub.com settings for WordPress.org.
---
### How to route the PHPUnit matrices to a specific runner
This change is a no-op until a PHPUNIT_RUNNER repository variable exists. To direct the PHPUnit jobs to a runner (for example, a larger release-runner during a high-load release window):
Turn it on
- Repo → Settings → Secrets and variables → Actions → Variables.
- New repository variable → Name:
PHPUNIT_RUNNER, Value: the runner label (e.g.release-runner). - New PHPUnit runs pick it up immediately. In-flight runs are unaffected; re-run if you need them moved.
Turn it off
- Same page → delete the
PHPUNIT_RUNNERvariable. - PHPUnit jobs fall back to the default runner (
ubuntu-24.04).
Notes
- Scoped per repository—set it only on the exact repo you want to redirect; other repos are unaffected.
- Larger hosted runners are billed per-minute, so set it only for the window and remove it after.
- Changing the variable needs repo admin access.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Allows the PHPUnit runner to be directed by a repository variable, defaulting to the current runner.
reusable-phpunit-tests-v3.ymlchanges itsruns-onto${{ vars.PHPUNIT_RUNNER || inputs.os }}. With thePHPUNIT_RUNNERvariable unset (the default), jobs run oninputs.os(ubuntu-24.04) exactly as before. When a maintainer setsPHPUNIT_RUNNERto a runner label, the PHPUnit matrices run on that runner instead—useful for directing them to a dedicated runner during high-load release windows, without editing the workflow.@trunk; no input is added or made required.varsis available inruns-on, so the override is valid.Trac: https://core.trac.wordpress.org/ticket/65749