Use PCOV preinstalled within PHP Docker container#11949
Conversation
|
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 Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
| ## | ||
| php: | ||
| image: wordpressdevelop/php:${LOCAL_PHP-latest} | ||
| image: ghcr.io/wordpress/wpdev-docker-images/php:${LOCAL_PHP-latest}-210 |
There was a problem hiding this comment.
This is temporary to test the upstream container PR and will not be included in the eventual commit.
| ## | ||
| cli: | ||
| image: wordpressdevelop/cli:${LOCAL_PHP-latest} | ||
| image: ghcr.io/wordpress/wpdev-docker-images/cli:${LOCAL_PHP-latest}-210 |
There was a problem hiding this comment.
This is temporary to test the upstream container PR and will not be included in the eventual commit.
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
There was a problem hiding this comment.
Pull request overview
This PR updates the local Docker environment and CI workflow to rely on PCOV being preinstalled in the Docker images (instead of installing it during GitHub Actions runs), and wires a LOCAL_PHP_PCOV flag through the environment to control coverage-related behavior.
Changes:
- Remove the GitHub Actions step that installs/enables PCOV via PECL, and instead pass a
LOCAL_PHP_PCOVflag when coverage is requested. - Add PCOV tuning (
pcov.initial.files) to the local PHP INI and injectpcov.directorywhen running PHPUnit with clover coverage. - Switch local-env Docker images to
ghcr.io/wordpress/wpdev-docker-images/*with a-210tag and exposeLOCAL_PHP_PCOVto containers.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/local-env/scripts/docker.js | Adds logic to inject pcov.directory into PHPUnit coverage runs (currently breaks the php ./vendor/bin/phpunit invocation pattern). |
| tools/local-env/php-config.ini | Adds pcov.initial.files=10000 to tune PCOV performance. |
| docker-compose.yml | Switches PHP/CLI images to ghcr.io/wordpress/wpdev-docker-images/* (tagged -210) and passes LOCAL_PHP_PCOV into containers. |
| .github/workflows/reusable-phpunit-tests-v3.yml | Passes LOCAL_PHP_PCOV for coverage runs and removes the manual PCOV install step. |
| .env.example | Documents the new LOCAL_PHP_PCOV environment variable. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

This switches from manually installing PCOV within the relevant GitHub Actions workflows to relying on the local Docker environment containers to have PCOV already pre-installed.
This is also being used to test WordPress/wpdev-docker-images#210, which adds PCOV to the containers.
Follow up to r62409.
Trac ticket: Core-644893.
Use of AI Tools
AI assistance: No
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.