phpunit: Error: Incorrect whitelist config, no code coverage will be generated.
Q | A |
---|---|
PHPUnit version | 6.5.3 |
PHP version | 7.1.4 |
Installation Method | Composer |
Recently (probably since updating to PHPUnit 6.5) PHPUnit started to print this error instead of code coverage. Is this a bug? I didn’t change anything regarding coverage recently. My whitelist configuration is very simple:
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">src</directory>
</whitelist>
</filter>
How can I find out what is wrong here? It worked just fine some time before.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 20 (2 by maintainers)
Phpunit should include specific error messages instead of saying incorrect whitelist configuration.
On Mar 1, 2018 10:45 AM, “Bouke Versteegh” notifications@github.com wrote:
@locojuhi,
🔧 Check your
filter
section onphpunit.xml
, everydirectory
value must be exist on you work directory.For example
⚠️ If
./src
don’t exist, you getIncorrect whitelist config, no code coverage will be generated.
Same issue, solved.
Not working :
Working:
@enumag Is that literally your entire PHPUnit configuration? The reason I ask is that we also get this message since 6.5, and it comes from having more than one
<whitelist>
section. I guess there could be multiple unrelated reasons that cause that error starting in 6.5, but it would be good to rule out that it’s the same issue.A minimal example of our issue is as follows:
So long as directories A and B do actually exist, this produces no error in <6.5, but produces “Incorrect whitelist config, no code coverage will be generated” in >=6.5 (not sure what the recommended way is now to have
processUncoveredFilesFromWhitelist
set differently for two dirs).I used https://github.com/ankurk91/phpunit-travis-ci-coverage-example as a reference.
On Mon, Mar 12, 2018, 7:16 PM COTE notifications@github.com wrote:
In case anyone else is looking, this error can also appear if you include
In your phpunit.xml, when there are no filter or whitelist elements present, so zero nodes is another trigger.
@Nenglish7 i tried that, but still not working for me… anyone could solve this issue?