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

Mutation analysis Link/Report not showing on SonarQube 7.9.5 LTS Post Updating from 6.7 LTS #49

Closed milindbangar79 closed 2 years ago

milindbangar79 commented 3 years ago

Hi,

Thanks for the plugin , we have bee using it for sometime and has helped the teams to understand the Unite Test gaps.

We have recently updated SonarQube from 6.7 to 7.9 LTS . The Mutation plugin is not generating the report on it , even though site says its compatible.

Environment:

SonarQube Version : Version 7.9.5 (build 38598) Edition --> DataCenter PITest Plugin Version : 1.6.3 Junit : 5 Mutation analysis Plugin Version : 1.5

While analyzing the code in Local SonarQube setup , the Mutation Analysis report is available for the same version as mentioned, but while running the analysis through Jenkins , its somehow missing , even though I can see the exact same logs on local and Jenkins. Is there any additional property(ies) need to be set for the report generation?

Plugin Logs :

[INFO] 09:27:38.830 Sensor Mutation Analysis [mutationanalysis]
[DEBUG] 09:27:38.830 Enabled Languages for Pitest: [java, kotlin]
[DEBUG] 09:27:38.830 Enabled Languages for Pitest: [java, kotlin]
[INFO] 09:27:38.830 Pitest Sensor [java, kotlin] running on [key=com.mycompany.sample:simpleinterest-microservice] in I:\Dev\ssh-repo\simpleinterest-microservice
[DEBUG] 09:27:38.831 Reading mutants
[DEBUG] 09:27:38.832 Searching pit reports in I:\Dev\ssh-repo\simpleinterest-microservice\target\pit-reports
[DEBUG] 09:27:38.904 Found mutant Mutant [sourceFile=SimpleInterestService.java, mutatedClass=com.mycompany.sample.service.SimpleInterestService, mutatedMethod=simpleInterestCalculation, methodDescription=(Lcom/mycompany/sample/domain/SimpleInterestDTO;)Ljava/lang/Double;, lineNumber=16, state=KILLED, mutationOperator=Empty Object Return Vals Mutator, numberOfTestsRun=1, killingTest=com.mycompany.sample.controller.SimpleInterestControllerIntegrationTest.simpleInterestCalculationTest(), description=replaced Double return value with 0 for com/mycompany/sample/service/SimpleInterestService::simpleInterestCalculation]
[DEBUG] 09:27:38.906 Found mutant Mutant [sourceFile=SimpleInterestService.java, mutatedClass=com.mycompany.sample.service.SimpleInterestService, mutatedMethod=simpleInterestCalculation, methodDescription=(Lcom/mycompany/sample/domain/SimpleInterestDTO;)Ljava/lang/Double;, lineNumber=16, state=KILLED, mutationOperator=Math Mutator, numberOfTestsRun=1, killingTest=com.mycompany.sample.controller.SimpleInterestControllerIntegrationTest.simpleInterestCalculationTest(), description=Replaced double multiplication with division]
[DEBUG] 09:27:38.907 Found mutant Mutant [sourceFile=SimpleInterestService.java, mutatedClass=com.mycompany.sample.service.SimpleInterestService, mutatedMethod=simpleInterestCalculation, methodDescription=(Lcom/mycompany/sample/domain/SimpleInterestDTO;)Ljava/lang/Double;, lineNumber=16, state=KILLED, mutationOperator=Math Mutator, numberOfTestsRun=1, killingTest=com.mycompany.sample.controller.SimpleInterestControllerIntegrationTest.simpleInterestCalculationTest(), description=Replaced double multiplication with division]
[DEBUG] 09:27:38.908 Found mutant Mutant [sourceFile=SimpleInterestService.java, mutatedClass=com.mycompany.sample.service.SimpleInterestService, mutatedMethod=simpleInterestCalculation, methodDescription=(Lcom/mycompany/sample/domain/SimpleInterestDTO;)Ljava/lang/Double;, lineNumber=16, state=KILLED, mutationOperator=Math Mutator, numberOfTestsRun=1, killingTest=com.mycompany.sample.controller.SimpleInterestControllerIntegrationTest.simpleInterestCalculationTest(), description=Replaced double division with multiplication]
[DEBUG] 09:27:38.910 Found mutant Mutant [sourceFile=SimpleInterestService.java, mutatedClass=com.mycompany.sample.service.SimpleInterestService, mutatedMethod=simpleInterestCalculation, methodDescription=(Lcom/mycompany/sample/domain/SimpleInterestDTO;)Ljava/lang/Double;, lineNumber=12, state=KILLED, mutationOperator=Negate Conditionals Mutator, numberOfTestsRun=1, killingTest=com.mycompany.sample.controller.SimpleInterestControllerIntegrationTest.simpleInterestCalculationTest(), description=negated conditional]
[DEBUG] 09:27:38.911 Found mutant Mutant [sourceFile=SimpleInterestController.java, mutatedClass=com.mycompany.sample.controller.SimpleInterestController, mutatedMethod=calculateSimpleInterest, methodDescription=(Lcom/mycompany/sample/domain/SimpleInterestDTO;)Ljava/lang/Double;, lineNumber=36, state=KILLED, mutationOperator=Empty Object Return Vals Mutator, numberOfTestsRun=1, killingTest=com.mycompany.sample.controller.SimpleInterestControllerTest.Simple Interest Test Is good, description=replaced Double return value with 0 for com/mycompany/sample/controller/SimpleInterestController::calculateSimpleInterest]
[DEBUG] 09:27:38.913 Found mutant Mutant [sourceFile=SimpleInterestController.java, mutatedClass=com.mycompany.sample.controller.SimpleInterestController, mutatedMethod=calculateSimpleInterest, methodDescription=(Lcom/mycompany/sample/domain/SimpleInterestDTO;)Ljava/lang/Double;, lineNumber=32, state=KILLED, mutationOperator=Negate Conditionals Mutator, numberOfTestsRun=1, killingTest=com.mycompany.sample.controller.SimpleInterestControllerTest.Simple Interest Test Is good, description=negated conditional]
[DEBUG] 09:27:38.914 Found mutant Mutant [sourceFile=SimpleInterestController.java, mutatedClass=com.mycompany.sample.controller.SimpleInterestController, mutatedMethod=hello, methodDescription=(Ljava/lang/String;)Ljava/lang/String;, lineNumber=43, state=KILLED, mutationOperator=Empty Object Return Vals Mutator, numberOfTestsRun=2, killingTest=com.mycompany.sample.controller.SimpleInterestControllerIntegrationTest.getHelloTest(), description=replaced return value with "" for com/mycompany/sample/controller/SimpleInterestController::hello]
[DEBUG] 09:27:38.916 Found mutant Mutant [sourceFile=SimpleInterestDTO.java, mutatedClass=com.mycompany.sample.domain.SimpleInterestDTO, mutatedMethod=getPrincipal, methodDescription=()D, lineNumber=12, state=KILLED, mutationOperator=Primitive Returns Mutator, numberOfTestsRun=1, killingTest=com.mycompany.sample.controller.SimpleInterestControllerIntegrationTest.simpleInterestCalculationTest(), description=replaced double return with 0.0d for com/mycompany/sample/domain/SimpleInterestDTO::getPrincipal]
[DEBUG] 09:27:38.918 Found mutant Mutant [sourceFile=SimpleInterestDTO.java, mutatedClass=com.mycompany.sample.domain.SimpleInterestDTO, mutatedMethod=getRate, methodDescription=()F, lineNumber=20, state=KILLED, mutationOperator=Primitive Returns Mutator, numberOfTestsRun=1, killingTest=com.mycompany.sample.controller.SimpleInterestControllerIntegrationTest.simpleInterestCalculationTest(), description=replaced float return with 0.0f for com/mycompany/sample/domain/SimpleInterestDTO::getRate]
[DEBUG] 09:27:38.919 Found mutant Mutant [sourceFile=SimpleInterestDTO.java, mutatedClass=com.mycompany.sample.domain.SimpleInterestDTO, mutatedMethod=getYears, methodDescription=()I, lineNumber=28, state=KILLED, mutationOperator=Primitive Returns Mutator, numberOfTestsRun=1, killingTest=com.mycompany.sample.controller.SimpleInterestControllerIntegrationTest.simpleInterestCalculationTest(), description=replaced int return with 0 for com/mycompany/sample/domain/SimpleInterestDTO::getYears]
[DEBUG] 09:27:38.921 collecting metrics
[DEBUG] 09:27:38.925 Enabled Languages for Pitest: [java, kotlin]
[DEBUG] 09:27:38.925 applying java rules
[DEBUG] 09:27:38.927 applying kotlin rules
[WARNING] 09:27:38.927 /!\ At least one Mutation Analysis rule needs to be activated the current profile.
[DEBUG] 09:27:38.927 saving metrics
[DEBUG] 09:27:38.933 Saving resource metrics for src/main/java/com/mycompany/sample/controller/SimpleInterestController.java
[DEBUG] 09:27:38.949 Saving resource metrics for src/main/java/com/mycompany/sample/service/SimpleInterestService.java
[DEBUG] 09:27:38.956 Saving resource metrics for src/main/java/com/mycompany/sample/domain/SimpleInterestDTO.java
[DEBUG] 09:27:38.965 Experimental features disabled
[DEBUG] 09:27:38.965 Done
[INFO] 09:27:38.965 Sensor Mutation Analysis [mutationanalysis] (done) | time=135ms

EDIT Update : when I appended &metric=dc5_mutationAnalysis_mutations_detected in the WebURL on Server , I can see the BUGS which are Alive Mutants.

"Mutation Analysis" Link on "Measures" Page is not showing.

Can you help?

Thanks in advance

Regards Milind

gmuecke commented 2 years ago

Hi Milind, There are two reasons I can't help you with this case, at first, I don't have resources to maintain backwards compatibility to older versions of Sonarqube. The latest LTS is 8.9.2, maybe you should consider upgrading to this version. Second, you're running the DataCenter edition of Sonarqube, right? The commercial editions are not "officially" supported, mostly because I don't have any option of reproducing the issues locally, as I don't have access to any of these editions. So I can't offer you "free" support. In case you find the root cause and probably a fix for the issue, I'd be happy if you provide a PR.

Regards, Gerald

milindbangar79 commented 2 years ago

Hi Gerald,

Thanks for your response .

I will work with my SonarQube team on the commercial version to see the issues and publish back here , possibly with the fix.

Will close this issue for the time being.

Regards Milind