File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -201,13 +201,28 @@ jobs:
201201 - name : Install WordPress
202202 run : npm run env:install
203203
204+ # Installs PCOV as the code coverage driver for the PHPUnit run below.
205+ #
206+ # The INI directives tune PCOV for WordPress's codebase:
207+ # - `pcov.enabled` keeps the Zend hooks active (this is the default, but
208+ # stated explicitly for clarity).
209+ # - `pcov.directory` restricts instrumentation to `src/`, so PCOV does not
210+ # record hits for `vendor/`, `tests/`, or WordPress test fixtures that
211+ # PHPUnit would discard at report time anyway.
212+ # - `pcov.initial.files` pre-sizes the internal file tracking array for
213+ # the thousands of files under `src/`, avoiding reallocation churn
214+ # during test warmup. The default of 64 is far too low here.
204215 - name : Install PCOV coverage driver
205216 if : ${{ inputs.coverage-report }}
206217 run : |
207218 docker compose exec -T -u 0 php sh -c '
208219 pecl install pcov &&
209220 docker-php-ext-enable pcov &&
210- echo "pcov.directory=/var/www/src" >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini &&
221+ {
222+ echo "pcov.enabled=1"
223+ echo "pcov.directory=/var/www/src"
224+ echo "pcov.initial.files=2000"
225+ } >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini &&
211226 php -m | grep -i pcov
212227 '
213228
You can’t perform that action at this time.
0 commit comments