Hi François,
The measures that are reported are not related to the Quality Gate itself. Even if “New Coverage” is not a condition for failing a Quality Gate, it should still show up if you submit a jacoco report.
I suggest we take this again from the top, as there seem to be multiple issues here.
If I’m reading all this correctly, the main issue is that you do not get any coverage info for MRs, whereas you do get this information for regular branches. Correct?
If yes:
- When you analyze them manually (using
./mvnw
), do you see your MRs in the SonarQube UI? - Do you see the line for Coverage and Duplication? Is it “0%”, or a dash (“–”)?
- Do these MRs have other metrics except Coverage (Bugs, Code Smells, etc)?
- If so, could you double check that, when you analyze your MR (still manually using
./mvnw
), you get a meaningful report in one of the following paths:target/site/jacoco/jacoco.xml
target/site/jacoco-it/jacoco.xml
build/reports/jacoco/test/jacocoTestReport.xml
- If you have several, it could mean an incorrect report is being picked up. Perhaps delete them manually, and retry.
- If you have none of the above, but another one (seems unlikely, as it should be the same as for your branch), try setting
-Dsonar.coverage.jacoco.xmlReportPaths=./path/to/xml
. - If you have only one, could you check:
- If its content is OK?
- Do you even have any coverage for new files? For instance, if you write a new test, that covers an existing, unchanged file, coverage will be “0%”, because you’re not increasing coverage on “new code”, but on “existing code” (as far as the MR is concerned).
- If so, could you double check that, when you analyze your MR (still manually using