Hi Nicolas,
I have the same problem as @eraonel here who started this thread. I am able to get all the coverage information except Coverage per Test which you have mentioned above, that it is deprecated.
I read another thread on this forum which was dated this year and the person could successfully get the information on what tests covered particular line of code by clicking on the green bar on the side.
I would really like this information in my sonarqube project.
I am using the following:
sonarqube-6.7.6
sonar-scanner-cli-3.2.0.1227.jar
jacocoant.jar from jacoco v0.8.2
The unit tests are run as part of an Ant build.
I have wrapped the junit tests with jacoco coverage tags:
<jacoco:coverage enabled="{coverage.enabled}" destfile="{jacoco.dir}/steps_jacoco.report">
<junit maxmemory="1024M"
fork="true"
forkmode="perBatch"
haltonfailure="false"
failureproperty="tests.failed"
printsummary="withOutAndErr"
showoutput="true">
<formatter type="xml" />
<classpath>
<path refid="additional-junit-classpath" />
<fileset refid="fileset:third-party_jars-for-tests" />
<pathelement path="${project.build.dir}/acceptanceTest-classes" />
<pathelement path="${project.build.dir}/test-classes" />
<pathelement path="${project.build.dir}/../core/test-classes" />
</classpath>
<batchtest todir="${test.result.dir}">
<fileset dir="${project.build.dir}/../core/acceptanceTest-classes">
<include name="**/blah.class" />
<include name="**/blah.class" />
</fileset>
<fileset dir="${project.build.dir}/acceptanceTest-classes">
<include name="**/*Test.class" />
<exclude name="**/blah.class" />
</fileset>
</batchtest>
</junit>
</jacoco:coverage>
The jacoco report is successfully created after running the Ant build with the above code.
After this I run the sonar-scanner on a linux environment using the following command line command:
sonar-scanner -Dproject.settings=$locationOfPropertyFile
Some properties from the sonarqube.properties file:
sonar.junit.reportPaths={env.blah}/test-results
sonar.java.coveragePlugin=jacoco
sonar.surefire.reportsPath={env.blah}/test-results
sonar.jacoco.reportPaths=${env.blah}/jacoco_steps_report/steps_jacoco.report
Is there anyway I can get the coverage per test information?
Your help with be highly appreciated
Regards,
Dhawal