Support processing code coverage information in OpenClover XML format

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

I am the creator of PHPUnit and would like to see the DX of GitLab CI for PHP projects improved.

Background

AFAIK, GitLab CI can currently only consume code coverage information in Cobertura XML format. I have been told on the GitLab Discord that JaCoCo might also be supported, but to the best of my knowledge JaCoCo's XML format has issues similar to Cobertura's XML format.

I think the Cobertura XML format is problematic as, at least as far I was able to find out, it was never really standardized and/or documented. Furthermore, the Cobertura project seems to be dead.

PHPUnit can generate code coverage reports in Cobertura XML, Clover XML, and OpenClover XML formats. However, the Cobertura XML and Clover XML reporters have been a steady source of issues over the years. They either deviate from how the original tools would represent information and/or from what consumers such as GitLab CI expect.

The OpenClover project is actively maintained and provides a documented XML schema for its XML logfile format. Support for OpenClover XML was recently added to PHPUnit. In our tests for the OpenClover XML reporter, we validate each generated XML file against the XML schema for OpenClover XML. Other consumers of code coverage information, such as codecov.io, for example, process OpenClover XML generated by PHPUnit without problems.

Proposal

It would be great if GitLab CI would also be able to consume code coverage information in OpenClover XML format.

Edited by Sebastian Bergmann