Skip to content

Build/Test Tools: Limit PHPUnit for Core asset-only PRs - #13523

Closed
lancewillett wants to merge 3 commits into
WordPress:trunkfrom
lancewillett:ci/65889-core-assets-only
Closed

lancewillett wants to merge 3 commits into
WordPress:trunkfrom
lancewillett:ci/65889-core-assets-only

Conversation

@lancewillett

@lancewillett lancewillett commented Sep 14, 2026 •

Copy link
Copy Markdown
Member

Core asset-only pull requests normally start the PHPUnit matrix. This selects one PHP 8.3/MySQL 8.4 job running --group assets when the changes contain audited Core assets and no other relevant files.

The classifier accepts CSS/JS under src/js/, admin CSS and color SCSS, includes CSS, and tracked JavaScript under src/wp-includes/build/. Documentation, QUnit tests, typings, and selected JavaScript lint configuration can accompany asset changes. Explicit workflow inclusions—including SECURITY.md, PHPUnit files, and relevant build tools—retain normal coverage.

A depth-2 checkout compares the tested PR merge result with its base parent. NUL-delimited filenames and disabled rename detection preserve unusual names and both sides of renames. Empty or failed diffs retain normal coverage. Selection has a five-minute timeout and logs fallback reasons with safely quoted filenames.

The Full PHPUnit Matrix label bypasses reduced coverage. Other events retain their existing matrix selection. The asset job is single-site; asset tests must not also belong to groups excluded by phpunit.xml.dist. Grouped PHPUnit runs fail if no tests are selected.

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

Validation

  • 78 cases passed against the exact inline classifier, including companion-file ordering, explicit inclusions, SCSS, empty/failed diffs, more than 300 files, and filename log escaping.
  • Two real depth-2 Git merge checks passed: an audited nested asset selects reduced coverage; a cross-boundary rename retains normal coverage.
  • Actionlint passed both changed workflows. Zizmor 1.30.1 reported nine low-severity self-repository syntax suggestions, compared with eight on trunk; the added job follows the existing reusable-workflow syntax. No other findings.
  • The prerequisite asset tests landed in r63628 through Tests: Group tests that depend on Core assets #13522.
  • On PHPUnit 9.6.36, the assets group passed 33 tests / 301 assertions in normal order and random seed 13523 with the empty-suite guard.
  • A nonexistent group exited 0 without the guard and 1 with it, confirming that empty coverage fails.

Live GitHub routing for an asset-only PR still needs verification. This workflow-changing PR itself selects normal coverage.

Asset-only PR examples

These open PRs provide two concrete examples for verifying reduced coverage:

The exact inline classifier returned assets-only=true for both PRs’ actual merge diffs, using depth-2 checkouts and Linux Bash. Their branches were not changed. Live GitHub routing remains to be verified after this workflow lands: expect one Core assets job and the normal PHPUnit matrix to be skipped, unless the Full PHPUnit Matrix label is present.

Use of AI tools

AI assistance: Yes.
Tool: Codex.
Model: GPT-6.
Used for: Workflow implementation, review, and validation. I reviewed the changes and take responsibility for them.

@github-actions

github-actions Bot commented Sep 14, 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 lancewillett, adrianmoldovanwp, lucatume.

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

@adimoldovan adimoldovan left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The approach is good. I left some inline comments.

Comment thread .github/workflows/phpunit-tests.yml Resolved
Comment thread .github/workflows/phpunit-tests.yml Resolved
Comment thread .github/workflows/phpunit-tests.yml Resolved
Comment thread .github/workflows/phpunit-tests.yml Resolved
Comment thread .github/workflows/phpunit-tests.yml Resolved
Comment thread .github/workflows/phpunit-tests.yml Resolved
Fail grouped PHPUnit runs when no tests are selected. Bound coverage selection to five minutes and log why normal coverage is retained.

Allow admin color SCSS and unrelated documentation or JavaScript test files alongside audited assets, while preserving the workflow's explicit path inclusions. Remove generated-path patterns and document the single-site test-group constraint.
wporg-sync pushed a commit that referenced this pull request Sep 21, 2026
Run the assets group on PHP 8.3 and MySQL 8.4 when a pull request changes only audited Core assets and unrelated companion files. Preserve normal coverage for other changes, non-PR events, and pull requests with the Full PHPUnit Matrix label.

Compare the tested merge commit with its base parent, account for both sides of renames, and retain normal coverage when changed paths are unavailable or empty. Fail grouped PHPUnit runs when no tests are selected.

Developed in: #13523

Props adrianmoldovanwp, afercia, johnbillion, lucatume, westonruter.
Fixes #65889.


git-svn-id: https://develop.svn.wordpress.org/trunk@63778 602fd350-edb4-49c9-b593-d223f7449a82
@github-actions

Copy link
Copy Markdown

A commit was made that fixes the Trac ticket referenced in the description of this pull request.

SVN changeset: 63778
GitHub commit: b3637c4

This PR will be closed, but please confirm the accuracy of this and reopen if there is more work to be done.

@github-actions github-actions Bot closed this Sep 21, 2026
wporg-sync pushed a commit to WordPress/WordPress that referenced this pull request Sep 21, 2026
Run the assets group on PHP 8.3 and MySQL 8.4 when a pull request changes only audited Core assets and unrelated companion files. Preserve normal coverage for other changes, non-PR events, and pull requests with the Full PHPUnit Matrix label.

Compare the tested merge commit with its base parent, account for both sides of renames, and retain normal coverage when changed paths are unavailable or empty. Fail grouped PHPUnit runs when no tests are selected.

Developed in: WordPress/wordpress-develop#13523

Props adrianmoldovanwp, afercia, johnbillion, lucatume, westonruter.
Fixes #65889.

Built from https://develop.svn.wordpress.org/trunk@63778


git-svn-id: http://core.svn.wordpress.org/trunk@62950 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

3 participants