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
Preliminary support for PCOV #667
Conversation
@@ -188,6 +188,8 @@ private function logRunningWithDebugger(): void | |||
$this->consoleOutput->logRunningWithDebugger(\PHP_SAPI); | |||
} elseif (\extension_loaded('xdebug')) { | |||
$this->consoleOutput->logRunningWithDebugger('Xdebug'); | |||
} elseif (\extension_loaded('pcov')) { | |||
$this->consoleOutput->logRunningWithDebugger('PCOV'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not entirely sure if we need this, but this may be a good idea in sake of verbosity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it need some more work (in progress label)?
Yes, there isn't a test that would work properly on CI. |
There's an E2E test one can run, but it is not used on CI yet. Hopefully we can add it later. |
Thank you @sanmai |
This PR:
Fixes #665
I can verify that Infection can indeed recognize PCOV and do not fail with an error. Looks like this:
Getting this new changes tested on CI is a bit tricky, because even though PCOV is kind of exclusive with xdebug, they both can be loaded at the same time, and it is not like PHPUnit is willing to report exactly what it is using for coverage. Extra care should be taken to be sure that PCOV does its thing, like by disabling and/or not installing xdebug in the first place. In Debian this is done by:
PCOV is supported only under PHPUnit 8, which only works under PHP 7.2 and later, therefore if we wish to test Infection under PHP 7.1, we can't upgrade to PHPUnit 8 yet. There's an option of pcov/clobber, but that's kind of gross in my opinion. I'd rather have a single E2E test for PCOV for time being, than to resort to pcov/clobber with no clear benefit (and it is not our job to test PCOV).