Skip to content

Build/Test Tools: Preserve PHPUnit timing results for use in metrics - #13070

Open
lancewillett wants to merge 5 commits into
WordPress:trunkfrom
lancewillett:feat/65887-publish-phpunit-results
Open

Build/Test Tools: Preserve PHPUnit timing results for use in metrics#13070
lancewillett wants to merge 5 commits into
WordPress:trunkfrom
lancewillett:feat/65887-publish-phpunit-results

Conversation

@lancewillett

@lancewillett lancewillett commented Aug 16, 2026

Copy link
Copy Markdown
Member

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

What this changes

The PHPUnit workflow uploads the existing JUnit report after every push to trunk from one canonical job:

  • PHP 8.5;
  • MySQL 8.4;
  • single site;
  • default domain and cache configuration.

The upload happens immediately after the main test suite, before later test-group runs replace the configured JUnit file.

Each trunk push produces one artifact named phpunit-timing-results. The artifact contains junit.xml with per-test timing data. Other events and matrix jobs do not upload timing artifacts.

Why one artifact

One stable environment provides comparable results and the raw data needed to find slow tests. Collecting every test segment from every matrix job adds storage, naming, and analysis work without helping the first use case.

GitHub uses the repository default retention period. CodeVitals and aggregate trend reporting are handled separately in #13083.

How to validate

An end-to-end test temporarily allowed PR #13070 to run the upload step from the canonical job:

The downloaded artifact contained an 8,909,462-byte, well-formed junit.xml file with timing for 30,871 test cases. The final condition limits uploads to pushes on trunk.

After merge, open the latest trunk push:

https://github.com/WordPress/wordpress-develop/actions/workflows/phpunit-tests.yml?query=event%3Apush+branch%3Atrunk

The Artifacts section should contain phpunit-timing-results. Download it with GitHub CLI:

gh run download <run-id> --repo WordPress/wordpress-develop --name phpunit-timing-results

Reviewers can confirm that the existing configuration creates the uploaded file:

npm run test:php -- --filter Tests_Functions::test_wp_parse_args_object
test -s tests/phpunit/build/logs/junit.xml

Testing

  • actionlint passed.
  • The targeted PHPUnit command above passed with one test and two assertions and wrote its timing to junit.xml.
  • The end-to-end test uploaded, downloaded, and parsed phpunit-timing-results successfully.

@lancewillett

Copy link
Copy Markdown
Member Author

End-to-end artifact validation passed.

The canonical PHPUnit job temporarily allowed the pull request event to exercise the exact upload step:

The downloaded artifact contained a well-formed, 8,909,462-byte junit.xml file with timing for 30,871 test cases. The upload and download both completed successfully.

Commit 8ccbcd4 restored the scheduled-only condition after the test. The final workflow also passed actionlint, and zizmor reported zero findings.

@lancewillett
lancewillett marked this pull request as ready for review August 16, 2026 20:47
@github-actions

github-actions Bot commented Aug 16, 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, desrosj.

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

@lancewillett lancewillett changed the title Build/Test Tools: Preserve scheduled PHPUnit timing results Build/Test Tools: Preserve scheduled PHPUnit timing results for use in metrics Aug 16, 2026
Comment thread .github/workflows/reusable-phpunit-tests-v3.yml
Comment thread .github/workflows/reusable-phpunit-tests-v3.yml Outdated
Comment thread .github/workflows/reusable-phpunit-tests-v3.yml Outdated
Comment thread .github/workflows/reusable-phpunit-tests-v3.yml Outdated
Comment thread .github/workflows/reusable-phpunit-tests-v3.yml Outdated
@lancewillett lancewillett changed the title Build/Test Tools: Preserve scheduled PHPUnit timing results for use in metrics Build/Test Tools: Preserve PHPUnit timing results for use in metrics Aug 17, 2026
@lancewillett

Copy link
Copy Markdown
Member Author

3ff9c19 addresses review feedback.

We are limiting the metrics to trunk runs to prove the concept before adding all PR commits which can come later. For now, they'd add more storage and might not create an apples-to-apples comparison for an early look at slow tests.

@lancewillett
lancewillett requested a review from desrosj August 17, 2026 01:05
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.

2 participants