-
-
Notifications
You must be signed in to change notification settings - Fork 376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Coverage not working on closures in PHPDBG #945
Comments
Note: I reported this here, because I don't know if the problem is in I don't really know the underlying protocol, so any help is welcome 👍 |
I have never used PHPDBG in production and can only recommend to not use it. Use PCOV if you only need line coverage and Xdebug if you also want branch and path coverage. The code coverage functionality provided by PHPDBG is not really maintained, as far as I know. To be honest, the right thing to do would probably be to remove support for it from this library. |
Makes sense: I used phpdbg because it comes with php-src, and I didn't want to add more dependencies to my stack (in general), but I can live with this decision, and adapt to it long-term 👍 |
Removed support for PHPDBG in c304be7 for php-code-coverage v10 (to be released alongside PHPUnit 10 in February 2023). |
That was quick and decisive 💪 I'll make sure to upgrade my downstream projects before PHPUnit 10 hits us :) |
This is a potential breaking change, but note that PHPUnit v10 no longer supports PHPDBG for coverage, which was the only use-case for PHPDBG in this container, thus far. We instead install `pcov`, which is considered precise enough for coverage reports by PHPUnit. Fixes laminas#130 Ref: laminas#130 Ref: sebastianbergmann/php-code-coverage#945 Ref: sebastianbergmann/php-code-coverage@c304be7
This patch reduces code size, therefore leading to generally lower scores. Until we completely switch to `pcov` and the upstream issues with `sebastianbergmann/php-code-coverage` are resolved, we will keep having sub-100% mutation test scores. Ref: sebastianbergmann/php-code-coverage#945 Ref: sebastianbergmann/php-code-coverage@c304be7 Ref: laminas/laminas-continuous-integration-action#130 Ref: sebastianbergmann/php-code-coverage#953
…coverage support Ref: https://github.com/laminas/laminas-ci-matrix-action/blob/7f7976e6faf1ee8fcfca77cf0487cc4d0b486f11/laminas-ci.schema.json Ref: Ocramius/DoctrineBatchUtils#392 Ref: Roave/BackwardCompatibilityCheck#741 Ref: laminas/laminas-continuous-integration-action#130 Ref: laminas/laminas-ci-matrix-action#189 Ref: sebastianbergmann/php-code-coverage#945 Ref: sebastianbergmann/php-code-coverage@c304be7
As investigated in infection/infection#1736, coverage for closures doesn't seem to be picked up correctly, when using PHPDBG.
Specifically,
PCOV
works as expected:A coverage report done with
phpdbg -qrr
will instead produce partial coverage:Reproducible example
PHPDBG output
PCOV output
PHPDBG + PCOV = 💥
Note: running
phpdbg
withpcov
installed will lead to a segfault:The text was updated successfully, but these errors were encountered: