phpunit icon indicating copy to clipboard operation
phpunit copied to clipboard

coverage php output is ignoring both filter whitelists and coverage include tags

Open Pi-George opened this issue 4 years ago • 2 comments

With either of these two (minimal) formats in the config files:

  <coverage processUncoveredFiles="true">
    <include>
      <file>../../application/modules/provider-api/code/Controller/ProviderApiController.php</file>
    </include>
  </coverage>
  <filter>
    <whitelist addUncoveredFilesFromWhitelist="true">
      <file>../../application/modules/provider-api/code/Controller/ProviderApiController.php</file>
    </whitelist>
  </filter>

If I output the coverage as php then I get a whole load of files I didn't ask for included in the coverage. If I output as html then I correctly only get the coverage for the files I've asked for.

vendor/bin/phpunit -d memory_limit=2G --coverage-php tmp/coverages/unit.php --coverage-html tmp/coverages/html --bootstrap tests/unit/bootstrap.php --configuration tests/unit/codecoverage.xml tests/unit

This is a problem for me as I need to take the coverage php output from multiple sources of integration tests and the unit tests. Then I merge it all together to output a html report. And in particular I'm trying to get the total line % coverage of a certain subset of files.

Pi-George avatar Jul 19 '21 14:07 Pi-George

Thank you for your report.

Please provide a minimal, self-contained, reproducing test case that shows the problem you are reporting.

Without such a minimal, self-contained, reproducing test case I will not be able to investigate this issue.

sebastianbergmann avatar Jul 19 '21 15:07 sebastianbergmann

Can you link to a page which describes how I can go about creating one?

Pi-George avatar Jul 19 '21 15:07 Pi-George

No feedback, closing.

sebastianbergmann avatar Sep 25 '22 10:09 sebastianbergmann