Phpunit: Coverage includeUncoveredFiles defaults to false since 9.3?

Created on 10 Aug 2020  ·  4Comments  ·  Source: sebastianbergmann/phpunit

| Q | A
| --------------------| ---------------
| PHPUnit version | 9.3.5
| PHP version | 7.4.9
| Installation Method | Composer

Summary

It seems that the default setting for the includeUncoveredFiles attribute in the <coverage> element was changed from true to false even though the xsd schema file for 9.3 says true in the default attribute.
I noticed it when running the tests on a large codebase and the coverage increased significantly 🙃

At first glance it seems that this was introduced in this commit: https://github.com/sebastianbergmann/phpunit/commit/111f2305b114ec7771dd32ddce5136a4b5387c71#diff-2ca98deb18566460d93ce70e3ad20779R383

Current behavior

When producing coverage, uncovered files are ignored.

How to reproduce

Omit the includeUncoveredFiles attribute in the coverage element and run a testsuite which doesn't cover all files.

Expected behavior

Whe omitting the attribute, it should default to true.

featurcode-coverage featurtest-runner typbug

All 4 comments

I just noticed in the code (did not test it) that the default also seems to have changed when using the old pre-9.3 schema (i.e. filter/whitelist instead of coverage): https://github.com/sebastianbergmann/phpunit/commit/111f2305b114ec7771dd32ddce5136a4b5387c71#diff-2ca98deb18566460d93ce70e3ad20779R512
Should I test it and open another issue for that?
Thanks!

https://github.com/sebastianbergmann/phpunit/blob/9.3/src/TextUI/XmlConfiguration/Loader.php#L574 looks correct to me.

right. sorry, I was looking at an old commit 🤦‍♂️

No worries! Thank you for reporting and checking.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

TiMESPLiNTER picture TiMESPLiNTER  ·  3Comments

joubertredrat picture joubertredrat  ·  4Comments

rentalhost picture rentalhost  ·  4Comments

keradus picture keradus  ·  3Comments

nicklevett picture nicklevett  ·  4Comments