-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pitest info do not show up in Sonarqube #29
Comments
@mosser thank you for the feedback. |
Hi @bradflood and @mosser, Since I've been pursuing this topic, I've tested the functionalities of the plugin in almost every latest version of SonarQube.
I'm personally interested if this change of behaviour is caused by changes in SonarQube or version 0.9 of the sonar-pitest plugin? Is there a possibility that I can help with that? Cheers, Marijn |
@marijnvermeulen-adobe Yes, I would welcome the help. Much appreciated. Regarding measures, the capability was temporarily removed from plugin 0.9 because it caused an analysis failure. This would be a good place to start. Regarding issues, I did not intentionally change their categorization. If you could provide a specific example, perhaps I could dig further to find what changed. |
We run sonarqube Version 7.1 (build 11001). After downgrading pitest plugin from 0.9 to 0.8 mutation analysis shows up in SQ again (with results) |
@rhdietrich @marijnvermeulen-adobe @mosser I have reintroduced measures
@VinodAnandan would you be able to release 0.9.1 from master? |
Hi @bradflood , Sorry for the late reply. Sure, I will do that in a couple of days, hope that's fine? If it's urgent please let me know. Thank you, Vinod |
Hi, @VinodAnandan Maybe useful: |
Hi, Cheers, |
@marijnvermeulen-adobe in what version of SQ? |
@VinodAnandan could you please release 0.9.1? @marijnvermeulen-adobe - we are going to stop working on this plugin at some point, and allow the mutation-analysis-plugin to be the preferred tool for processing pitest output for SonarQube. There are a few gaps (kotlin support being the primary one), so we'll keep this going until such time that the user community is fully behind the mutation-analysis-plugin. cc: @gmuecke, the primary developer of the mutation-analysis-plugin. |
Did you enable any mutation related rule in your active quality profile? see also https://github.com/devcon5io/mutation-analysis-plugin/wiki/Installation#quality-profile |
Did you check if the quality profile with the activated pitest / mutation analysis rule (looks like its named "copy of Sonarqube way" or similar) is either set as default or explicitly assigned to your analysis project? If that is the case and still no result show up, could you run the analysis in debug mode (mvn -X) and provide the log for the mutation analysis somehow? Btw. if you switch to the mutation-analysis-plugin, you don't need the pitest plugin anymore (with version 1.3 there is now also the kotlin support, so the mutation-analysis-plugin's features are now a complete superset of the pitest plugin. Using both plugins won't cause conflicts, only redundant measures and issues. |
Hi @gmuecke |
From the logfile I read, that you configured to have the pitest-reports written to the parent 's build directory (line 16904), but only the backend module contains java code & tests & actual mutations. So the problem that both plugins have here, that they do not find the pit report for backend because its in parent, which in return isn't analyzed, because parent has no Java file and analysis is skipped. Both plugins have the option to specify a report folder, though I'm not sure it works with ../ (parent folder), but it might be worth a try. Otherwise I strongly recommend to leave the mutation report in the module where the mutation took place (leave it the default folder). In addition to this, I opened a new issue devcon5io/mutation-analysis-plugin#23 to explore the feasibility of extracting the report directory from the maven configuration. But no promises made that this will actually been implemented. |
Cool :) Glad I could help. Btw. try out the experimental features for some more metrics, maybe they provide some additional insights to you |
Hi! I have several Projects under a folder. Since I am running sonarqube manually and not automatically just for scanning a project from time to time I use something like this (changed info for anonimity): Before I run Jacoco manually and Maven with:mvn org.pitest:pitest-maven:mutationCoverage -DtimeoutConstant=9000 -DoutputFormats=XML cd \projects\ "C.\route_to_sonar\sonar-scanner-4.6.0.2311-windows\bin\sonar-scanner.bat" -D"sonar.projectKey=MyProject" -D"sonar.sources=." -D"sonar.host.url=http://localhost:9000" -D"sonar.login=fffffffffffffffffffffffffffffffffffffffffffffffffff" -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\202110180914" Why do I have to override dc5.mutationAnalysis.pitest.sensor.reports.directory with the exact number of report? Couldn´t I able to use .\MyProject\target\pit-reports\ instead? Shouldn´t it take the latest? Or am I assuming something wrong? |
Hi,
I use Pitest on a bunch of legacy Java project. As I cannot change their POM file, I configure all the properties using CLI, but it should not matters. The point is to obtain in an automated way associated reports in Sonar, more specifically for tests.
First, I compile to code using the JaCoCo agent to compute coverage metrics
mvn org.jacoco:jacoco-maven-plugin:prepare-agent clean package
Then, I asks Pitest to generate an XML report for mutation testing analysis:
mvn -DoutputFormats=XML -Dthreads=4 org.pitest:pitest-maven:mutationCoverage
It creates a file in
target/pit-reports/YYYYMMDD____/mutations.xml
. If invoked with the HML output format, it generates the expected report (with the killed/survived ratio and so on).Then, I use the sonar-pitest plugin to upload it to sonarqube (Version 7.0 (build 36138)), started using Docker (image: sonarqube:alpine, latest version). I installed the plugin directly from the marketplace inside sonar.
mvn -Dsonar.host.url=http://localhost:9000 sonar:sonar
The Sonarqube adminsitration panel, w.r.t Pitest, use the default value for
sonar.pitest.reportsDirectory
(target/pit-reports
) andsonar.pitest.mode
(reuseReport
).Unfortunately, when running the last command, there is no mention of Pitest in the execution log (the [INFO] level displays information about Javasquid, surefire, JaCoCo, bu nothing about pitest).
When going to the project
Measures
tab, I did not find any information about mutation testing in any of the available measurements.Am I missing something, or is it a bug with sonarqube 7.
Thanks.
The text was updated successfully, but these errors were encountered: