Make WordPress Core

Opened 15 hours ago

Closed 14 hours ago

Last modified 14 hours ago

#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

Allows the PHPUnit runner to be directed by a repository variable, defaulting to the current runner.

reusable-phpunit-tests-v3.yml changes its runs-on to ${{ vars.PHPUNIT_RUNNER || inputs.os }}. With the PHPUNIT_RUNNER variable unset (the default), jobs run on inputs.os (ubuntu-24.04) exactly as before. When a maintainer sets PHPUNIT_RUNNER to 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.

  • No behavior change by default; the variable is unset.
  • Backward-compatible for every branch that calls this workflow @trunk; no input is added or made required.
  • vars is available in runs-on, so the override is valid.

Trac: https://core.trac.wordpress.org/ticket/65749

@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

  1. Repo → Settings → Secrets and variables → Actions → Variables.
  2. New repository variable → Name: PHPUNIT_RUNNER, Value: the runner label (e.g. release-runner).
  3. New PHPUnit runs pick it up immediately. In-flight runs are unaffected; re-run if you need them moved.

Turn it off

  1. Same page → delete the PHPUNIT_RUNNER variable.
  2. 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.

#3 @lancewillett
14 hours ago

  • Owner set to lancewillett
  • Resolutionfixed
  • Status newclosed

In 62891:

Build/Test Tools: Allow the PHPUnit runner to be set by a repository variable.

Change runs-on in the reusable PHPUnit workflow to ${{ vars.PHPUNIT_RUNNER || inputs.os }}. With the variable unset (the default), jobs run exactly as before.

When a maintainer sets PHPUNIT_RUNNER to 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.

No input is added or made required, so every branch that calls this workflow at @trunk stays compatible.

Developed in: https://github.com/WordPress/wordpress-develop/pull/12745

Props barry.
Fixes #65749.

#4 @lancewillett
14 hours ago

  • Milestone Awaiting Review7.1
Note: See TracTickets for help on using tickets.