Skip to content

Run the development build during prepare - #351

Merged
kittenkamala merged 2 commits into
WordPress:masterfrom
ekamran:shifteq/350-build-dev
Oct 7, 2026
Merged

kittenkamala merged 2 commits into
WordPress:masterfrom
ekamran:shifteq/350-build-dev

Conversation

@ekamran

@ekamran ekamran commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Fixes #350.

Problem

Since core r63983, host reports fail four tests: Tests_Dependencies_jQuery::test_jquery_files_exist for jquery.js, jquery.min.js, jquery-migrate.js and jquery-migrate.min.js.

On the results site, r63982 has 22 passed and 2 failed reports. r63983 has 3 passed and 27 failed, and r64091 is still at 3 and 24. Only core's own reporter passes.

prepare.php runs npm run build, which writes the built files to build/. The test suite runs against src/, which is ABSPATH in the generated wp-tests-config.php. The new test asserts that the jQuery files exist under src/wp-includes/js/jquery/, and only the development build creates that directory.

Fix

Run npm run build:dev instead. It writes the built files into src/, and it is the build that core's own PHPUnit workflow runs: npm ci, then npm run build:dev.

What changes for hosts

  • The four jQuery tests pass.
  • Tests_Basic::test_build_wp_version_does_not_end_with_src is now skipped, because build/ is no longer produced. Core's own workflow skips it for the same reason.
  • Prepare gets a little lighter. There is no build/ directory, which was 152 MB in my run.

Verification

Real end to end runs of prepare.php and test.php against trunk r64092, PHP 8.5, MySQL 9.7.

  • master: src/wp-includes/js/jquery/ does not exist after prepare, and the four tests fail with the same messages as in host-tests failing since r63983 (missing/invalid jQuery paths?) #350.
  • This branch: the four files exist in src/, and Tests_Dependencies_jQuery passes with 7 tests and 48 assertions.
  • Same comparison across the groups most likely to care about built files (dependencies, scripts, blocks, restapi, and the five test files that reference built paths, about 4,800 tests): the only differences are the four fixed tests and the one skipped test above.
  • Full suite, 25,703 tests: master ends with 4 failures, the same four tests, and 73 skipped. This branch ends with no failures and 74 skipped. The extra skip is the build version test above.
  • php -l, phpcs and git diff --check are clean.

Notes

Use of AI

AI assistance: Yes
Tool(s): Claude Code and Codex
Used for: Investigation, implementation, verification harness, and PR wording. I reviewed the reasoning and test results, and I take responsibility for the contribution.

prepare.php ran `npm run build`, which writes the built files to build/,
while the test suite runs against src/. Since core r63983 a test asserts
that the jQuery files exist under src/wp-includes/js/jquery/, so every
host using the runner fails four tests.

Run `npm run build:dev` instead. It writes the built files into src/ and
is the same build that WordPress core's own PHPUnit workflow runs.

Fixes WordPress#350.
@github-actions

github-actions Bot commented Oct 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.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: ekamran <ekamran@git.wordpress.org>
Co-authored-by: kittenkamala <amykamala@git.wordpress.org>
Co-authored-by: chrisdavidmiles <chrisdavidmiles@git.wordpress.org>
Co-authored-by: iarif4u <iarif4u@git.wordpress.org>
Co-authored-by: kmott <mywp459@git.wordpress.org>

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

@kittenkamala

Copy link
Copy Markdown
Collaborator

Thank you so much for catching this. Would be great to have some hosts test on their systems to confirm the change to using build:dev is effective.

Maybe @jazzsequence and @chrisdavidmiles could test on Pantheon and BlueHost systems

@iarif4u

iarif4u commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Tested on an xCloud server, as a host test of the build:dev change.

Environment

  • Ubuntu 24.04.5, provisioned by xCloud (nginx + MySQL stack). 2 vCPU, 1.8 GB RAM, with 4 GB swap (the 1 GB xCloud swapfile plus 3 GB that I added as headroom for the build).
  • PHP 8.4.26 (ondrej PPA), MySQL 8.0.46, Node.js 24.21.0 / npm 11.19.0 from NodeSource setup_24.x, Composer 2.10.3.
  • Runner master (d974e38) and this branch (d32c0f2), both set up by a non-root user. Both checkouts were the same WordPress trunk, r64225 (702a0d0).
  • Outbound HTTPS to ghcr.io and pkg-containers.githubusercontent.com works. The Gutenberg download needs both.

Results (prepare.php, then --filter "Tests_Dependencies_jQuery|test_build_wp_version_does_not_end_with_src")

master this PR
prepare.php OK, 77 s OK, 70 s
src/wp-includes/js/jquery/ missing jquery.js, jquery.min.js, jquery-migrate.js, jquery-migrate.min.js
build/ created, 159 MB not created
Tests 8 tests, 4 failures (the four in #350) 8 tests, 48 assertions, 0 failures, 1 skipped (test_build_wp_version_does_not_end_with_src)

So the change fixes #350 on this stack too, with the same counts as in the PR description.

Full suite (25,936 tests, same server, same r64225, about 460 s each)

master this PR
Failures + errors 11 7
Skipped 30 31
  • Only on master: the four Tests_Dependencies_jQuery failures from host-tests failing since r63983 (missing/invalid jQuery paths?) #350.
  • Only on this PR: no new failures. The one extra skip is Tests_Basic::test_build_wp_version_does_not_end_with_src, as expected.
  • On both: the same 7 timezone tests (for example Tests_Date_wpTimezone::test_should_return_deprecated_timezone_string, and DateInvalidTimeZoneException for America/Buenos_Aires and Canada/Newfoundland). This comes from the server, not the runner: this PHP uses the system time zone database ("Olson" Timezone Database Version => 0.system), and Ubuntu 24.04 moves the deprecated zone names into the tzdata-legacy package, which was not installed. After apt install tzdata-legacy, those test classes pass (178 tests, 0 failures).

One follow-up: when this lands, I will update #347, which still names npm run build. Its "Extra work" note about build:dev will also no longer apply.

@ekamran

ekamran commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the thorough run, Arif. Same numbers as my local runs, and xCloud is a different stack from mine, so that is the host confirmation Amy asked for.

The tzdata-legacy note is useful on its own: the 7 timezone failures are a server package gap, not the runner, and apt install tzdata-legacy clears them.

Sounds good on #347, the build:dev wording there can follow once this lands.

@chrisdavidmiles chrisdavidmiles 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.

I confirmed this on a Bluehost server. I ran the same wordpress-develop checkout (c64de70) both ways: on master, src/wp-includes/js/jquery/ is absent and the four test_jquery_files_exist cases fail; on this branch, the four files build into src/ and pass, with test_build_wp_version_does_not_end_with_src skipped as expected. These results match the xCloud run.

@kittenkamala
kittenkamala merged commit 61491cb into WordPress:master Oct 7, 2026
7 checks passed
@ekamran
ekamran deleted the shifteq/350-build-dev branch October 8, 2026 07:14
iarif4u added a commit to iarif4u/phpunit-test-runner that referenced this pull request Oct 10, 2026
Since WordPress#351, prepare.php runs npm run build:dev, so name that command and
replace the note that compared it with the full build.
mindctrl pushed a commit that referenced this pull request Oct 23, 2026
* Document why NodeJS is needed to run the tests

Explains that the build step downloads the pinned Gutenberg artifact from
ghcr.io and copies the block editor files into src/, which the tests load.
Also notes engine-strict and that the production build is not needed for
PHPUnit.

Fixes #243.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Rework the Node.js section after review

Make it a standalone ### section, open with why a PHP suite needs Node.js,
list the Gutenberg steps in order, and add a summary sentence (from the
review). Keep the ghcr.io network requirement, the changeset and issue
references, and the build:dev note. Mention that devEngines also enforces
the npm version.

* Use the reviewed wording for the Node.js section

Base the section on the wording suggested in review, and use real
headings for Versions and Extra work (review suggestions). Keep the
facts hosts need: the build commands, changeset 61438, gutenberg.sha,
the ghcr.io connection, the routes.php example, devEngines with the
EBADDEVENGINES error, and Core's build:dev workflow.

* Name the ghcr.io download redirect domain

GHCR answers the blob request with a 307 to pkg-containers.githubusercontent.com,
so a host with an outbound allowlist needs both domains.

* Restore files deleted by mistake in 4814a42

4814a42 recorded the deletion of 22 files that were missing from my local
working copy. Restore them unchanged. The only change left from that
commit is the ghcr.io redirect sentence in README.md.

* Describe routes.php as a past case

routes.php is in version control again since r62118, so cite #292 as
something that happened instead of a current example.

* Describe the development build that prepare.php runs now

Since #351, prepare.php runs npm run build:dev, so name that command and
replace the note that compared it with the full build.

* Say that the development build still minifies

`grunt build --dev` runs build:js and build:css, which minify into src/.
It only skips build:files (the build/ directory), replace:source-maps
and verify:build.

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Amy Kamala <39748136+kittenkamala@users.noreply.github.com>
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.

host-tests failing since r63983 (missing/invalid jQuery paths?)

4 participants