feat(e2e): replace PHP server and DDEV with wp-env#15
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request modernizes the end-to-end testing infrastructure by migrating from a custom PHP server/DDEV setup to the standardized @wordpress/env package. This change streamlines the testing environment, improves consistency across different WordPress versions and multisite configurations, and reduces the maintenance burden of the reusable workflow by offloading environment configuration to the consuming repositories. Highlights
Ignored Files
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. The server was old and quite slow, / We needed a better way to go. / With wp-env now in the lead, / Our tests have the speed that we need. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request updates the reusable-wp-e2e.yml workflow to use wp-env instead of the PHP built-in server or DDEV, resulting in the removal of several inputs including php-version and project-mode. Documentation across README.md, CLAUDE.md, and CHANGELOG.md has been updated to reflect this transition. The review feedback recommends explicitly documenting the new default environment port and credentials in the README to assist users with the breaking changes, and suggests adding examples for the wp-versions input to improve documentation consistency.
The inline run value contained a colon inside JSON which broke YAML parsing, causing startup_failure.
Starts Mailpit in Docker, connects it to the wp-env network, and injects a mu-plugin that routes wp_mail through SMTP. Tests receive MAILPIT_API_URL env var when enabled.
|
Testing from agency-pass PR #1 (run): WSAL installs and activates fine. But Mailpit inbox is empty — The mu-plugin is injected but emails are not arriving. Possible issues:
The non-Mailpit tests (login form UI, admin notice, etc.) also have failures that need investigation — |
Verifies SMTP port reachable from WordPress container, sends a test email via wp_mail, and checks Mailpit API received it.
Show mu-plugin path, load status, phpmailer_init hook registration, and PHPMailer error info.
PHPMailer rejects wordpress@localhost in SMTP mode. Replace localhost From with a valid domain. Also set siteurl/home so WP derives a proper default sender.
wp_mail() validates the From address via setFrom() BEFORE phpmailer_init fires. If the address is invalid (e.g. wordpress@localhost), wp_mail bails out and phpmailer_init never runs. Use the wp_mail_from filter instead, which runs before setFrom validation.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request updates the reusable-wp-e2e.yml workflow to use wp-env instead of the PHP built-in server and DDEV. Key changes include the removal of the php-version, project-mode, and use-ddev inputs, and the addition of a mailpit input for mail catching. Documentation and the changelog have been updated to reflect these breaking changes. Feedback suggests adding a copy-pasteable .wp-env.json example to the README to assist users with the migration.
There was a problem hiding this comment.
Pull request overview
This PR updates the reusable WordPress E2E GitHub Actions workflow to run Playwright against a Dockerized @wordpress/env (wp-env) environment instead of the prior PHP built-in server / DDEV paths, and updates repository documentation/changelog accordingly.
Changes:
- Replaced E2E environment provisioning with
wp-envand adjusted the matrix to support WP version × multisite runs. - Added optional Mailpit support via a new
mailpitworkflow input and related SMTP configuration. - Updated README/CLAUDE/CHANGELOG to reflect the new E2E approach and breaking changes.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
README.md |
Updates E2E workflow documentation for wp-env, port/credentials, matrix guidance, and Mailpit input. |
CLAUDE.md |
Updates workflow inventory description for the E2E workflow to reference wp-env. |
CHANGELOG.md |
Adds 0.3.0 entry documenting the wp-env migration and input changes. |
.github/workflows/reusable-wp-e2e.yml |
Reworks the E2E job to start wp-env, supports multisite conversion, adds Mailpit option, and changes artifact naming. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Validate .wp-env.json exists before wp-env start - Pin Mailpit image to v1 major tag - Use docker-compose label for container detection - Add .wp-env.json example to README - Remove undocumented beta from wp-versions docs
|
wp-env starts fine but the Mailpit step fails to find the WordPress container: wp-env containers don't use the docker ps -q --filter "name=wordpress-develop" --no-trunc | head -1Or use Also: consider adding |
wp-env containers don't carry docker-compose labels. Revert to name-based filter.
|
Good catch — the Re |
|
The Mailpit image tag `v1` doesn't exist: Mailpit doesn't publish major-version tags. Use `axllent/mailpit:latest` or a specific version like `axllent/mailpit:v1.24`. |
|
Released as v0.3.0 |
Summary
@wordpress/env(wp-env) approachphp-version,project-mode, anduse-ddevinputs — wp-env handles PHP, DB, and project mounting viathe caller's
.wp-env.jsonCloses #14
Breaking changes for consumers
.wp-env.jsonin repo rootadminpasswordphp-versioninputproject-modeinput.wp-env.jsonconfiguse-ddev: trueTest plan
@feature/wp-env-e2eand verify wp-env startslocalhost:8888