which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
SQ-8.9.8.54436
SS-SonarScanner 4.7.0.2747
what are you trying to achieve
My sonarQube doesn’t appears the number about quantity of unit test(image 1) on measure should have appeared about unit tests, but doesn’t show anything.I am used Jacoco XML Reporte on SQ and appeared about test coverage normally, I did some configuration wrong?
I attached too as should appears when works fine unit tests(image-2)
what have you tried so far to achieve this
I checked the variable about Jacoco XML Reporter
You have to make sure that Unit Test Execution data (this is not coverage data) is passed to sonar.junit.reportPaths.
And, I’m pretty confused by your screenshots. It looks like in the second set (for the same project), Unit Tests are being reported correctly. What am I missing?
In fact, after I reviewed your answer checked my log attached and appeared this error after surefire sensor:
this params sonar.junit.reportPaths is default path is right, as log attached
2022-09-20T00:22:37.1947101Z 00:22:37.194 INFO: parsing [/home/vsts/work/1/s/target/surefire-reports]
2022-09-20T00:22:37.2557614Z 00:22:37.255 DEBUG: Class not found in resource cache : com.company.app.transactions.service.appmentsConfirmationServiceTest
2022-09-20T00:22:37.2568989Z 00:22:37.256 DEBUG: Class not found in resource cache : com.company.app.transactions.service.appmentsConfirmationServiceTest
2022-09-20T00:22:37.2573824Z 00:22:37.257 DEBUG: Class not found in resource cache : com.company.app.transactions.service.appmentsConfirmationServiceTest
My screenshots seem the same project because I used the same project with maven using sonar:sonar.
however my prod environment doesn’t show anything about quantity unit test, the diference between them that my prod enviroment I used sonnar scanner with CLI and my local enviroment I used the maven extension for sonar.
… I suppose the real question for me is – why not use the Scanner for Maven with your Production environment? We don’t recommend using the Scanner CLI for analyzing Java when you can use the Scanner for Maven – which is far more likely to produce accurate analysis results (having the full context of the build).
In fact, you’re doing exactly what you should be doing in your local environment (and getting the best results). You should mirror this in your Production environment.
So my prod environment is consumed by pipeline, I can’t change pipeline because the step about sonnar is used by other languages, because it we used sonnar scanner cli with params on sonar-project.properties.Could you help me in this case using Sonar CLI for show unit tests?