Skip to content

Build/Test Tools: Allow the reusable PHPUnit workflow to test another repository. - #12862

Draft
lucatume wants to merge 2 commits into
WordPress:trunkfrom
lucatume:reusable-phpunit-tests-extended-support
Draft

Build/Test Tools: Allow the reusable PHPUnit workflow to test another repository.#12862
lucatume wants to merge 2 commits into
WordPress:trunkfrom
lucatume:reusable-phpunit-tests-extended-support

Conversation

@lucatume

@lucatume lucatume commented Aug 5, 2026

Copy link
Copy Markdown

A reusable workflow checks out the repository that calls it, so reusable-phpunit-tests-v3.yml can only test a wordpress-develop checkout made by a wordpress-develop workflow run. A repository that wants to run this suite against a wordpress-develop checkout with its own test files layered in has no way to call it, and keeps a copy of the workflow instead. That copy then inherits none of the fixes that land here.

Three optional inputs remove the need for one: repository and ref for the checkout, and overlay-artifact, which unpacks a same-run artifact over the checkout for callers whose test files aren't part of the repository being tested.

What to check

All three inputs default to an empty string, so no existing caller changes behaviour:

  • repository: ${{ inputs.repository || github.repository }} falls back to github.repository, which is actions/checkout's own default.
  • ref: '' is already actions/checkout's default.
  • the overlay step is guarded by if: inputs.overlay-artifact != ''.

phpunit-tests.yml, test-coverage.yml and every 5.9+ branch calling this workflow at @trunk pass none of them.

The overlay is downloaded after the checkout and before the Gutenberg build, so a caller can't use it to swap out a prepared Gutenberg build. It reads through the same same-run artifact mechanism as gutenberg-artifact, so it can only reach artifacts from the run that called the workflow.

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5
Used for: analysing the constraint and proposing the diff; I applied and reviewed the change.

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

Trac Ticket Missing

This pull request is missing a link to a Trac ticket. For a contribution to be considered, there must be a corresponding ticket in Trac.

To attach a pull request to a Trac ticket, please include the ticket's full URL in your pull request description. More information about contributing to WordPress on GitHub can be found in the Core Handbook.

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props lucatume.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@lucatume
lucatume marked this pull request as draft August 5, 2026 15:04
… repository.

A reusable workflow checks out the repository that calls it, so a caller that is not wordpress-develop cannot use this workflow and ends up maintaining a copy of it.

Add optional `repository` and `ref` inputs so the checkout can point elsewhere, and an `overlay-artifact` input that unpacks a same-run artifact over the checkout, for callers whose test files are not part of the repository being tested.

All three default to empty, so existing callers are unaffected: repository falls back to the calling repository, an empty ref is already checkout's own default and the overlay step is skipped.
…ository.

The producer checks out the commit that started the calling workflow run, so a caller preparing a build for a branch of another repository always got the wrong one. Add optional `repository` and `ref` inputs, plus an `artifact-name` input for callers that prepare several builds in a single run and would otherwise collide on one artifact name.

Retry the download as well. On branches whose download.js predates the in-script retry the blob is streamed straight into tar in a single attempt, so an interrupted stream fails the job outright.

All three inputs default to the current behaviour, so existing callers are unaffected.
@lucatume
lucatume force-pushed the reusable-phpunit-tests-extended-support branch from 4a3955e to 5fdbb75 Compare August 6, 2026 13:45
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