Repository navigation
Closes #1346: Respect WP_ENV_PORT in dev-start.sh and test-e2e.sh - #1354
Conversation
dev-start.sh prints the real Site/Admin port, and test-e2e.sh builds and exports IMAGIFY_BASE_URL from WP_ENV_PORT, so the reachability check and Playwright use the same site. The default stays 8888. Refs #1346 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Coverage variation | Report missing for 89848811 |
| Diff coverage | ✅ ∅ diff coverage (50.00%) |
Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (8984881) Report Missing Report Missing Report Missing Head commit (6b86404) 20602 2948 14.31% Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>
Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#1354) 0 0 ∅ (not applicable) Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%
1 Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Description
Closes #1346
Follow-up to #1351, which made
bin/dev-up.shprint the port wp-env really runs on. Two local-dev scripts still hardcoded 8888:bin/dev-start.shprintedhttp://localhost:8888Site/Admin URLs even when started withWP_ENV_PORT=8950.bin/test-e2e.shchecked that wp-env was reachable athttp://localhost:8888. With a custom port, the check failed. Even without the check, Playwright would have run against the defaultIMAGIFY_BASE_URL(http://localhost:8888), which is the wrong site.Developers only see a difference when they run wp-env on a non-default port. Without
WP_ENV_PORT, both scripts behave as before.Type of change
Detailed scenario
What was tested
Manual runs. Another wp-env was already using 8888 on the test machine, so
docker,npx,composerandnpmwere replaced onPATHby stand-ins that do nothing. The scripts' own logic ran for real; no containers were started and nothing was installed.bin/dev-start.sh --no-seedSite: http://localhost:8888,Admin: http://localhost:8888/wp-admin(unchanged)WP_ENV_PORT=8950 bin/dev-start.sh --no-seedSite: http://localhost:8950,Admin: http://localhost:8950/wp-adminbin/dev-start.sh --helpbin/test-e2e.sh specs/smoke(8888 up)IMAGIFY_BASE_URL=http://localhost:8888WP_ENV_PORT=8950 bin/test-e2e.sh(nothing on 8950)wp-env doesn't seem to be running on http://localhost:8950WP_ENV_PORT=8895 bin/test-e2e.sh(8895 up)IMAGIFY_BASE_URL=http://localhost:8895WP_ENV_PORT=8950 IMAGIFY_BASE_URL=http://localhost:8888 bin/test-e2e.shIMAGIFY_BASE_URLwins: 8888bash -npasses on both scripts.shellcheckwas not available.How to test
WP_ENV_PORT=8950 WP_ENV_TESTS_PORT=8951 bin/dev-start.sh --no-seed. The closing message must showhttp://localhost:8950.WP_ENV_PORT=8950 bin/test-e2e.sh specs/smoke. The suite must run against port 8950.WP_ENV_PORT, both scripts must use 8888 as before.Affected Features & Quality Assurance Scope
Local development scripts only (
bin/dev-start.sh,bin/test-e2e.sh) anddocs/E2E_TESTING.md. No plugin code. CI does not call these scripts.Technical description
Documentation
bin/dev-start.sh: same pattern asbin/dev-up.shin Closes #1346: Print the actual wp-env port in dev-up.sh #1351. It setsWP_ENV_PORT="${WP_ENV_PORT:-8888}"once, without exporting it, because wp-env reads the variable on its own. The closing URLs use it. The header documents the override, and the--helpline range now covers the whole header.bin/test-e2e.sh: Playwright reads its base URL fromIMAGIFY_BASE_URL(Tests/e2e/playwright.config.ts). When that variable is unset, the script now builds it fromWP_ENV_PORT(default 8888) and exports it, so the reachability check and the Playwright run use the same URL. IfIMAGIFY_BASE_URLis set, it is used unchanged.docs/E2E_TESTING.md: addsWP_ENV_PORTto the environment-variables table.New dependencies
None.
Risks
None for users. Without
WP_ENV_PORTandIMAGIFY_BASE_URL, the default behaviour is the same as before.Mandatory Checklist
Code validation
Code style
Unticked items justification
There are no automated tests: the repo has no test harness for its shell scripts. The changes were verified with the manual runs above.
Additional Checks
🤖 Generated with Claude Code