Coverage report exclusion doesn't work

I have the following settings in the sonar-project.properties file:

sonar.php.coverage.reportPaths=admin/coverage.xml
sonar.sources=admin/app
sonar.tests=admin/tests
sonar.coverage.exclusions=admin/tests/**

However, when I check sonarclouds coverage report, the tests are included there

Note, as you can see, all other files / directories under the “admin” folder are not shown, which is correct. However I can’t get rid of the “tests” folder in the coverage report.

Hi,

Welcome to the community!

Yes, the tests directory shows up in the view. It has - line coverage (which we can read as null) and 0 uncovered lines on new code. So it’s not being treated as code, it’s being treated as tests & is just kinda automatically shown in the list of all directories.

 
HTH,
Ann