Skip to content

date: 2026-06-11 tags: [pest, coverage, pcov, web-env, ci] status: active graduated_to:

Pest coverage reports 0.0% for every file in the remote container while pcov works standalone

Symptom — in the Claude Code remote container (PHP 8.5.6, pest 4.7, pcov 1.0.12), composer ci:check fails its coverage step with Total: 0.0% — every app/ class at 0.0% (interfaces at 100%, i.e. no executable lines), including files the diff never touched, while all 1160 tests pass.

Root cause — not pinned down (time-boxed). Isolated to the pest/phpunit run path: raw \pcov\start()/collect() counts lines correctly, and php-code-coverage's Selector::forLineCoverage + pcov driver works standalone in the same process; only collection during a pest run returns empty. Ruled out: pcov disabled (enabled, correct pcov.directory), opcache (enable_cli=Off), symlinked paths (none), laravel/pao output wrapper (cosmetic stdout capture only), pcov.directory scope (widening changed nothing). Clover output confirms zero collected statements, so it's collection, not reporting.

Fix — none locally. Shipped PR #402 with the env defect declared and the self-hosted CI runner (green on main) as the authoritative coverage/mutation verdict.

Guard — a uniform 0.0% across the whole codebase — untouched files included — is an environment signal, not a coverage regression; prove the driver with a standalone \pcov\collect() probe, declare the gap honestly on the PR, and let CI arbitrate. Don't burn the session chasing it past a time-box, and never "fix" it by lowering the threshold. If it recurs in this env, file a Harness issue.