Code coverage report from Jacoco are not taken into account anymore by Sonar.
In version 6.3.0, Sonar config was change to use XML report instead of .exec binary report file.
However pom.xml config does not match the config in sonar-project.properties. Sonar config expect jacoco.xml files but the pom.xml is still configure with .exec files.
Also it seems that now if we try to skip tests, the builds fails because it is trying to get the jacoco report.
Please align pom config with:
<jacoco.utReportFile>${jacoco.utReportFolder}/jacoco.xml</jacoco.utReportFile>
...
<jacoco.itReportFile>${jacoco.itReportFolder}/jacoco.xml</jacoco.itReportFile>
JHipster 6.3.0+
@jfougere : looks like you know how to fix this. Do you want to contribute and PR ?
About this comment "Also it seems that now if we try to skip tests, the builds fails because it is trying to get the jacoco report.".
I retested again and in fact consecutive builds without a first clean step will result in the following error:
[ERROR] Failed to execute goal org.jacoco:jacoco-maven-plugin:0.8.4:report (post-unit-test) on project payment-manager: An error has occurred in JaCoCo report generation.: Error while creating report: Invalid execution data file. -> [Help 1]
Not sure what can be done except always perform a clean... (But for information it wasn't the case before with the .exec files)
@pascalgrimaud just pushed a PR but only on the report file names which are incorrect.
wow so fast, thanks @jfougere !
@pascalgrimaud seems the build is failing and from what I see because of the second issue I was raising about the jacoco complaining about previous reports...
I'll try to have a look into that but I don't have many ideas
Congrats for your first ticket & PR @jfougere !! We worked on the same project more than 10 years ago, world is small :-D
@jdubois Indeed it is! Wow 10 years.... feeling old all of a sudden!
@jfougere it's all in your head, now that you're a jhipster you are probably younger than many millennials !
Yes, it seems related to https://github.com/jhipster/generator-jhipster/pull/10293
Maybe @clement26695 you have time to have a look plz ?
OK so first @jdubois my sincere appologies for this first ticket and PR.... I'll do better next time. You can actually close this issue and declined the PR!
I promise as punishment I'll try to pick an issue and fix it :)
ok so some explanations:
-1) about the build issue it is actually because of my "fix" in the pom. The jacoco plugin is still producing binary file in .exec format and then in the post-unit-test step will use them to produce a report in XML. So the config in the POM with .exec is actually correct ! Sorry for that
-2) still I couldn't get code coverage in our Sonar instance and it it because for Sonar to be able to process the XML report the SonarQube instance needs this JaCoCo Plugin
This plugin is now by default in 7.4+ (our instance was in 6.7.7)
(More info here and there)
@jfougere : no problem ! I'd prefer someone who opened a ticket, tried to fix an issue and was wrong than someone else who found a real bug and didn't share it...
So thank you for sharing what you encountered and the solution behind this.