Skip to content

Build/Test Tools: Run the smoke check on multisite installations - #16355

Open
adimoldovan wants to merge 2 commits into
WordPress:trunkfrom
adimoldovan:add/multisite-smoke-check
Open

adimoldovan wants to merge 2 commits into
WordPress:trunkfrom
adimoldovan:add/multisite-smoke-check

Conversation

@adimoldovan

@adimoldovan adimoldovan commented Nov 30, 2026 •

Copy link
Copy Markdown

Enable the smoke checks for multisite in Installation Tests and Upgrade Tests.

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

A network picks its site from the request's Host header. The script used to move the site to http://127.0.0.1:8889, so a network found no site. Now the site keeps its installed URL, http://localhost, and curl sends every request to the local server with --connect-to localhost:80:127.0.0.1:8889. Single sites no longer need the home and siteurl rewrite either. The site must be installed at http://localhost/, as both workflows do.

On a network, the script also loads /wp-admin/network/ after it logs in. It checks only the main site, because php -S does no URL rewrites for subsite paths.

The workflows now load the action with $/.github/actions/smoke-check instead of @trunk. A pull request that changes the script then runs its own copy. Release branches still get trunk's copy, because they call reusable-upgrade-testing.yml@trunk and $/ resolves to that workflow's commit. Their multisite upgrade jobs then run the check too. setup-wp-cli already uses the same reference. The upgrade workflows run again on pull requests that change the action.

Testing instructions

The Installation Tests and Upgrade Tests checks on this pull request run the step. Multisite rows print ok /wp-admin/network/. Single site rows print skip /wp-admin/network/ (not a network).

To run the script by hand:

docker run -d --name wp-smoke-db -p 33061:3306 -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=test_db mysql:8.4
mkdir wp && cd wp
wp core download --version=nightly
wp config create --dbname=test_db --dbuser=root --dbpass=root --dbhost=127.0.0.1:33061
wp core multisite-install --url=http://localhost/ --title="Install Test" --admin_user=admin \
  --admin_password=password --admin_email=me@example.org --skip-email
RUNNER_TEMP=/tmp WP_ADMIN_USER=admin WP_ADMIN_PASSWORD=password \
  bash /path/to/wordpress-develop/.github/actions/smoke-check/smoke-check.sh

Every check prints ok and the script exits 0. To check a single site, use wp core install instead. The network check then prints skip.

Testing done

  • CI on this pull request: the smoke step passed on every job, including 232 multisite jobs, in Installation Tests, Upgrade Tests and Upgrade Develop Version Tests. Multisite jobs print ok /wp-admin/network/.
  • Locally, in Docker: WordPress 4.7, WP-CLI 2.4.0 and MySQL 5.7, on PHP 5.6 and PHP 7.1, as a network and as a single site. Every check passed. Pull request runs of Installation Tests install only nightly, so this covers an old release.

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: The script and workflow changes, local testing, and iterative code review.


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.

Requests keep the installed host name, `localhost`, so a network finds its main site. A new check loads the network admin. The workflows load the action from their own commit, so a pull request runs its own copy.
@adimoldovan adimoldovan self-assigned this Dec 1, 2026
@adimoldovan
adimoldovan marked this pull request as ready for review December 1, 2026 11:23
@github-actions

github-actions Bot commented Dec 1, 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.

Core Committers: Use this line as a base for the props when committing in SVN:

Props adrianmoldovanwp.

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


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub or WordPress.org user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

@adimoldovan
adimoldovan requested a review from a team December 1, 2026 11:25
@@ -20,9 +22,7 @@ http_code=''

version="$(wp core version)"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The script now relies on the site being installed at http://localhost/, but nothing checks it. With another URL, the run would fail later with a vague error, such as "the REST index was not the expected JSON". An early check would give a clear message:

Suggested change
version="$(wp core version)"
version="$(wp core version)"
# Every request sends Host: localhost, so another install URL would fail later with a vague error.
installed_url="$(wp option get siteurl)"
[ "${installed_url%/}" = "${site_url}" ] \
|| { echo "::error::the site must be installed at ${site_url}/, not ${installed_url}"; exit 1; }

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