Closed dkzkb closed 4 years ago
I self-solved.
I added a whitelist to phpunit.xml and it was done.
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true">
<testsuites>
<testsuite name="Test Suite">
<directory suffix="Test.php">php</directory>
</testsuite>
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./app</directory>
<directory suffix=".php">./src</directory>
➜ <directory suffix=".php">./add/test/target/dir</directory>
</whitelist>
</filter>
</phpunit>
Would you consider changing the error message?
Regards
The default PHPUnit configurations that are generated by pest --init
and artisan pest:install
already cover the most common modern paths for including (src
and app
), but I think this might be something that would be good to add to the docs somewhere. Regarding adding additional coverage directories.
Just a note to all people getting this error and having the directory included in coverage - you might get this error of xdebug.mode
in php.ini. This was already stated in the docs, but as you know - 2 hours of debugging save you 5 minutes of documentation reading.
I was getting in this environment: PHP: 8.0 pestphp/pest: 1.8.0 phpunit.xml:
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
>
<testsuites>
<testsuite name="Test Suite">
<directory>./tests</directory>
</testsuite>
</testsuites>
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./src</directory>
</include>
</coverage>
</phpunit>
Coverage not found in path: /root/vendor/pestphp/.temp/coverage.php.
Is coverage not available on docker container and aws ec2?
I installed pest from composer on a docker container. And I ran
./vendor/bin/pest --coverage
and got the error below.What should i try next?
if you need any further information to debug this or there is a critical error in what I'm doing please let me know. Thanks.