Closed renepardon closed 3 years ago
From https://github.com/krakjoe/pcov/tree/v1.0.9#notes:
When
pcov.directory
is left unset, PCOV will attempt to findsrc
,lib
or,app
in the current working directory, in that order; If none are found the current directory will be used, which may waste resources storing coverage information for the test suite.
So you have to set pcov.directory
or rename app
to something else.
@kubawerlos amazing. Thanks! I set it within /etc/php/8.0/cli/conf.d/20-pcov.ini
as the absolute path to my application. So I just need to find a way to provide it as PHP cli parameter to the artisan command. Thank you!
Summary
I execute PHPUnit Unit/Feature tests within the scope of my laravel application based on the following composer script:
php artisan config:clear ; ./vendor/bin/phing init ; XDEBUG_MODE=coverage php artisan test --parallel --colors ; php artisan config: clear
The config:clear is to read proper .env.testing file and deleting the config cache afterwards.
phing init
just creates the required directories.artisan test --parallel
executes tests in parallel. (https://github.com/nunomaduro/collision/blob/stable/src/Adapters/Laravel/Commands/TestCommand.php)Current behavior
No code coverage is being generated for Modules/ folder but corresponding tests are executed. (At all 218)
How to reproduce
See summary.
Expected behavior
Code coverage should be calculated for all folders defined in:
Composer packages
phpunit.xml
This is the PHPUnit XML configuration I use https://gist.github.com/renepardon/2d926cc091c1dc84eddc927d54df5d87 Filter is no longer available in PHPUnit 9. Therefore commented.