Skip to content

Commit

Permalink
doc: Add version restriction to PHPUnit xml (#198)
Browse files Browse the repository at this point in the history
PHPUnit xml format changed after version 4. And this tool does not support newer versions.
To use this tool with newer versions, users should use the flag `--coverage-clover` and send the report using the clover format.

Add troubleshooting note about PHPUnit xml
  • Loading branch information
Francisco Duarte authored Apr 16, 2020
1 parent 276bc71 commit 64809e7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ The following table contains the formats supported and which coverage tools gene
| Scala | [sbt-jacoco](https://www.scala-sbt.org/sbt-jacoco/) <br> [scoverage](http://scoverage.org/) | JaCoCo <br> Cobertura | jacoco*.xml <br> cobertura.xml |
| Javascript | [Istanbul](https://github.com/gotwarlost/istanbul) <br> [Poncho](https://github.com/deepsweet/poncho) <br> [Mocha](http://mochajs.org/) + [Blanket.js](https://github.com/alex-seville/blanket) | LCOV | lcov.info, lcov.dat, *.lcov |
| Python | [Coverage.py](https://coverage.readthedocs.io/en/coverage-5.0.3/) | Cobertura | cobertura.xml |
| PHP | [PHPUnit](https://phpunit.readthedocs.io/en/8.5/code-coverage-analysis.html) | PHPUnit XML <br> [Clover](https://confluence.atlassian.com/clover/using-clover-for-php-420973033.html) | coverage-xml/index.xml <br> clover.xml |
| PHP | [PHPUnit](https://phpunit.readthedocs.io/en/8.5/code-coverage-analysis.html) | PHPUnit XML (version <= 4) <br> [Clover](https://confluence.atlassian.com/clover/using-clover-for-php-420973033.html) | coverage-xml/index.xml <br> clover.xml |
| Ruby | [SimpleCov](https://github.com/colszowka/simplecov) | [Cobertura](https://github.com/dashingrocket/simplecov-cobertura) <br> [LCOV](https://github.com/fortissimo1997/simplecov-lcov) | cobertura.xml <br> lcov.info, lcov.dat, *.lcov |
| C# | [OpenCover](https://github.com/OpenCover/opencover) <br> [DotCover CLI](https://www.jetbrains.com/dotcover/) | OpenCover <br> DotCover-DetailedXML | opencover.xml <br> dotcover.xml |
| Swift/Objective-C | XCode Coverage | [Check here information about reports for this language](docs/swift_objectivec.md) | |
Expand Down Expand Up @@ -179,6 +179,13 @@ If you are experiencing segmentation faults uploading the coverage (due to [orac
echo "$(dig +short api.codacy.com | tail -n1) api.codacy.com" >> /etc/hosts
```

### `coverage-xml/index.xml generated an empty result`

If you are using PHPUnit version 5 or above to generate your coverage report, you must output the report using the clover format. The codacy-coverage-reporter supports the PHPUnit xml format only for versions equal or lower than 4.
You can change the output format by replacing the `--coverage-xml <dir>` flag by `--coverage-clover <file>`.

For more information on the PHPUnit command line check [here](https://phpunit.readthedocs.io/en/9.1/textui.html).

## What is Codacy?

[Codacy](https://www.codacy.com/) is an Automated Code Review Tool that monitors your technical debt, helps you improve your code quality, teaches best practices to your developers, and helps you save time in Code Reviews.
Expand Down

0 comments on commit 64809e7

Please sign in to comment.