Try: Build WP once for PHPUnit test suite. - #12779
Conversation
|
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 Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
There was a problem hiding this comment.
Re-reviewed fc3173e. The coverage workflow now uses the shared WordPress build artifact: both coverage jobs downloaded and applied it, then skipped their local builds. The latest PHPUnit matrix and workflow lint checks pass. No further findings.
No other blockers to land this.
Adversarial code review using gpt-5.6-sol
|
@lancewillett I wanted to see what happened to the tests if they were re-run after the artifacts expired and did so on PHP 7.4 / MySQL 9.7. The test fails at the step attempting to download the Gutenberg artifact but the same would occur in the equivalent step for applying the WP-Dev build artifact.
Tests are now failing following my attempt to re-run the single event, they should work on a full run. |
|
Yes, and it is cheaper than it looks, because the Gutenberg fallback already exists. Suggested shape, tolerating the miss only on re-runs so attempt 1 still fails loudly on a real - name: Download WordPress build
id: download-wordpress
if: inputs.wordpress-build-artifact != ''
continue-on-error: ${{ github.run_attempt != '1' }}
uses: actions/download-artifact@... # unchanged
- name: Apply WordPress build
if: steps.download-wordpress.outcome == 'success'
run: tar -xzf /tmp/wordpress-build/wordpress-build.tar.gz # unchanged
- name: Build WordPress
if: steps.download-wordpress.outcome != 'success'
run: npm run build:dev
env:
GUTENBERG_EXPECTED_SHA: ${{ inputs.gutenberg-sha }}Same treatment on the Gutenberg download. A skipped step reports Raising retention is the wrong lever: 35 MB of Gutenberg plus 15 MB of build, on every push. One aside. The Gutenberg download may be unnecessary in matrix jobs once the build artifact is applied, since I found no runtime reference to |
|
I haven't gotten to review this in depth just yet (which I would love a chance to do), but I wanted to note that the PHPUnit test jobs previously had a prepare step prior to the It was removed in r50441 when switching back to running the PHPUnit test suite against the |
c69b241 to
ceee051
Compare
Runs
npm run build:devin the newly createdprepare-gutenbergreusable workflow for the PHPUnit tests.This allows the step to be bypassed in each test, saving about 30 seconds of runtime.
As the local environment uses NPM for the docker pull and configuration, the
npm cistep is still required. That can be a project for another time.Trac ticket: https://core.trac.wordpress.org/ticket/65770
Use of AI Tools
AI assistance: Yes
Tool(s): GitHub Copilot
Used for: Initial drafting of this in another PR that also included some docker changes. The creation of this PR built upon portions of that but is much reduced in scope. AI was not used for the generation of this PR per se.
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.