devcon5io / mutation-analysis-plugin

Plugin for SonarQube to process mutation analysis results.
GNU Lesser General Public License v3.0
30 stars 17 forks source link

Pitest 1.7.0 support #52

Closed KTannenberg closed 2 years ago

KTannenberg commented 2 years ago

Pitest merged support for pluggable mutators in v1.7.0 and as part of this change they renamed some of built-in mutators. This results in mutation-analysis-plugin not being able to recognize mutations when parsing Pitest reports:

[INFO] Sensor Mutation Analysis [mutationanalysis]
[INFO] Pitest Sensor [java, kotlin] running on [key=com.revere.basics:commons] in /home/agrigorov02/git/basics/commons
[WARNING] Found unknown mutation operator: org.pitest.mutationtest.engine.gregor.mutators.returns.NullReturnValsMutator
[WARNING] Found unknown mutation operator: org.pitest.mutationtest.engine.gregor.mutators.returns.EmptyObjectReturnValsMutator
[WARNING] Found unknown mutation operator: org.pitest.mutationtest.engine.gregor.mutators.returns.BooleanFalseReturnValsMutator
[WARNING] Found unknown mutation operator: org.pitest.mutationtest.engine.gregor.mutators.returns.BooleanTrueReturnValsMutator
...

At the same time just updating class names wouldn't work for my usecase, as some projects are still using older versions of pitest (mostly v1.6.9, but some are still on v1.5.2).

This PR changes MutationOperator class to support specifying multiple class names, updates mutagen-def.xml and tests accordingly and then adds new class names for Pitest v1.7.0 mutators in separate commit.

I tested these changes on my instance of Sonarqube and all seems good so far.