infection / infection

PHP Mutation Testing library
https://infection.github.io
BSD 3-Clause "New" or "Revised" License
2.05k stars 161 forks source link

JUnit report format (compatible with GitLab CI) #1500

Open ancarda opened 3 years ago

ancarda commented 3 years ago

Is your feature request related to a problem? Please describe. I would like to be able to integrate Infection into GitLab the same way I am able to integrate PHP Code Sniffer and PHPUnit. The latter two tools are able to output reports in JUnit format, which GitLab recognizes and displays inside a Merge Request. This makes it easier for people to see where defects are.

Describe the solution you'd like A format option, such as JUnit, that I can use with GitLab. For instance, I would like to be able to do this in my infection.json:

{
    "logs": {
        "junit": "var/infection.junit.xml"
    }
}

Describe alternatives you've considered Writing a tool that can convert Infection's JSON format to JUnit, if that's possible?

maks-rafalko commented 3 years ago

Hello @ancarda

I don't use GitLab personally, but from the first look - sounds like a good idea.

Would you mind creating a PR? It shouldn't be hard to implement. JSON logger can be used as an example of implementation: https://github.com/infection/infection/pull/1278/files

wickedOne commented 1 year ago

willing to work on this.