Conversation
Checks the required software, asks for the database credentials and the report API key, tests the database connection with mysqli, and writes .env from .env.default. WPT_TEST_DIR is set to WPT_PREPARE_DIR, which a local run requires. --non-interactive takes the values from the environment. Part of WordPress#257.
|
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
This was referenced Oct 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #257 (the first idea: set up
.envwith prompts instead of vim). The one-step run script is in #346 for #260.Purpose
Hosts say that the runner install is tedious. Today, they clone the repo, copy
.env.default, edit it in vim, and find out on the first run whether the database credentials work. This script does those steps and checks them.What
host-tools/setup.shdoesphp git rsync wget unzip node npm.composeris optional. It prints the Node.js and npm versions and stops with a list if something is missing.wpt_runner_parse_db_host()andmysqli, usingWPT_PHP_EXECUTABLE. If the connection fails,.envis not changed..envfrom.env.default. It changes only the lines it asks about. It quotes each value safely, sets the file mode to600, and saves the old.envas.env.bak-<timestamp>.Also:
WPT_TEST_DIRtoWPT_PREPARE_DIR. With.env.defaultas it is, the two are different (wp-test-runnerand/tmp/wp-test-runner), so a local run stops incheck_required_env()with "WPT_TEST_DIR must be the same as WPT_PREPARE_DIR".--non-interactivetakes the values from the environment, for provisioning tools.--skip-checksand--skip-db-checkskip those steps.The README "Configuring the Runner" section now mentions the script first, before the manual steps.
Testing
Tested against a real MySQL 9.6 server with PHP 8.4:
--non-interactive, correct credentials.env(mode 600), exit 0source .env, thencheck_required_env().envunchanged, exit 1WPT_DB_HOST.envunchanged',#,$and spacessource .env.envnode,npmorwgetmissingContributed at WordCamp Contributor Day.