Conversation
The v1 and v2 reusable PHPUnit workflows always check out the calling repository, so a caller in another repository builds WordPress from its own tree. Only v3 accepts a repository, a ref, and an overlay artifact. Add the four inputs v3 already carries (repository, ref, overlay-artifact and phpunit-test-groups) with v3's descriptions and its guard against a repository given without a ref. Steps with a hard-coded group are skipped when the caller names its own groups. So are the PHP < 7 steps: they exclude the slow groups, which would silently drop the caller's tests in those groups. Caller-named groups run in the single step on every PHP version, as v3 does.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Trac ticket: https://core.trac.wordpress.org/ticket/66149
The v1 and v2 reusable PHPUnit workflows always check out the calling repository, so a caller in another repository builds WordPress from its own tree. Only v3 accepts a
repository, arefand an overlay artifact, which leaves a caller wanting to test a branch on an older major with the v1 or v2 workflow no option but to keep a copy of the workflow, and that copy inherits none of the fixes that land here.This adds to v1 and v2 the four inputs v3 already carries, with v3's descriptions and its guard against a
repositorygiven without aref:repositoryandreffor the checkoutoverlay-artifact, unpacked over the checkout for callers whose test files are not part of the repository being testedphpunit-test-groups, a list of groups to runWhat to check
All four inputs default to an empty string, so no existing caller changes behaviour:
repository: ${{ inputs.repository || github.repository }}falls back togithub.repository, which isactions/checkout's own default.ref: ''is alreadyactions/checkout's default.if: inputs.overlay-artifact != ''.! inputs.phpunit-test-groupscondition is true when the input is unset, so each step keeps its currentif.The
repository-without-refguard matters becauseactions/checkoutwould otherwise fall back to the other repository's default branch: a job labelled for an older branch would silently test trunk and report green.The group handling is the part worth the closest look. Steps with a hard-coded group (
ajax,ms-files,external-http,xdebug, the slow-test split) are skipped when the caller names its own groups, since those steps would run tests the caller did not ask for. The PHP < 7 steps are skipped for the same reason in reverse: they run with--exclude-group, which would silently drop the caller's tests if they fall in an excluded group. Caller-named groups therefore run in the single "Run PHPUnit tests" step on every PHP version, which is how v3 behaves.The group list reaches PHPUnit through an
env:var rather than direct interpolation into therun:line.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.
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.