You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We use PCOV to collect code coverage. However, we only enable PCOV when we are running tests(using -d pcov.enabled=1), so that it doesn't slow down any other running of the code. This has worked fine with collision 6 / phpunit 9, but it doesn't work any more for collision 7 / phpunit 10. This seems to have to do with the -d argument not being passed on to the phpunit/paratest command.
We use PCOV to collect code coverage. However, we only enable PCOV when we are running tests(using
-d pcov.enabled=1
), so that it doesn't slow down any other running of the code. This has worked fine with collision 6 / phpunit 9, but it doesn't work any more for collision 7 / phpunit 10. This seems to have to do with the-d
argument not being passed on to the phpunit/paratest command.This works fine:
php -d pcov.enabled=1 vendor/bin/phpunit --coverage-text
but
php -d pcov.enabled=1 artisan test --coverage
starts it's output with
WARN No code coverage driver available
.Apparently, this check passed and it is PHPUnit itself that is giving the warning.
When I change
return array_merge([PHP_BINARY], $command);
toreturn array_merge([PHP_BINARY, '-d pcov.enabled=1'], $command);
(https://github.com/nunomaduro/collision/blob/v7.x/src/Adapters/Laravel/Commands/TestCommand.php#L179), coverage works just fine.The challenge here seems to be to find an elegant way to set options like this. I think this would be the easiest way:
php -d pcov.enabled=1 artisan test --coverage -d pcov.enabled=1
All
-d
arguments would be passed directly to PHP.What are your thoughts on this? I'd be willing to make a PR.
The text was updated successfully, but these errors were encountered: