Search code examples
javamaventestingsonarqubemutation-testing

Warnings importing PITEST reports into Sonarqube


Sorry for the cross posting:

https://community.sonarsource.com/t/importing-mutation-tests-with-pitest/52285/3

I am very new to Sonarqube and QA and I am making sure the code (and unit tests) a contractor is providing is of a good quality.

I am running maven to run pitests:

mvn clean install org.pitest:pitest-maven:mutationCoverage -DtimeoutConstant=10000 -DoutputFormats=XML

and I import the reports into Sonarqube community edition but I get a bunch of warnings that I don´t know if they mean that there are mutation tests that are not imported

WARN: Found unknown mutation operator: org.pitest.mutationtest.engine.gregor.mutators.returns.NullReturnValsMutator

or

WARN: Found unknown mutation operator: WARN: Found unknown mutation operator: org.pitest.mutationtest.engine.gregor.mutators.returns.EmptyObjectReturnValsMutator

I run sonar scanner this way (I have anonimiced info):

"C:\route_to_sonar\sonar-scanner-4.6.0.2311-windows\bin\sonar-scanner.bat" -D"sonar.projectKey=Gestor2CNegro" -D"sonar.sources=." -D"sonar.host.url=http://localhost:9000" -D"sonar.login=ffffffffffffffffffffffffffffffffff" -D"sonar.dependencyCheck.htmlReportPath=.\myproject\dependency-check-report.html" -D"sonar.dependencyCheck.xmlReportPath=.\myproject\dependency-check-report.xml" -D"sonar.coverage.jacoco.xmlReportPaths=.\myproject\jacoco.xml" -D"dc5.mutationAnalysis.pitest.sensor.reports.directory=.\myproject\target\pit-reports\202111151408" "-Dhttp.proxyHost=myproxy" "-Dhttp.proxyPort=8080"

I have enabled debug mode but I don´t see any log reporting those warnings and giving me any clue.


Solution

  • Apparently it was an issue of importing some mutators that were changed names in latest pitest versions:

    https://github.com/devcon5io/mutation-analysis-plugin/pull/52

    https://github.com/devcon5io/mutation-analysis-plugin/issues/55