Quality Gate passed despite coverage condition not reached

Hi everyone

  • version 7.9.1 LTS
    Sometimes, the quality gates passed to green despite coverage condition not reached. In my case, I have 44% on coverage but I should have 60% to pass to green… With 44 % it’s currently green. That’s not the first time I saw this problem and I cannot determine how it appends…

Can I get help please ?

Hey there.

What are the exact conditions in your Quality Gate? Sharing a screenshot of your Quality Gate may be helpful.

Is there anything I can check in logs ?

Hi @Cyril035
There are different possible conditions on Coverage in the doc : [Metric Definitions | SonarQube Docs]
(Metric Definitions | SonarQube Docs). Look at the definitions there, that should help selecting the good criteria.
The one you put in your Quality Gate seems to be “Condition Coverage”. I would put the “Coverage New Code” in your QG to check the coverage.
Can you try?


Hi @Carine_Bayon
I agree with that is the coverage on new code that is not reached…
But it’s this setting which is setup on QG config (see first line on second screenshot => Condition coverage on New Code => is less than 60%)

Hey @Cyril035

Carine is right – “Coverage on New Code” and “Condition Coverage on New Code” are two separate metrics – (the overall “Coverage” metric is a combination of line and condition coverage).

The metric you’re seeing on your overview is Coverage on New Code, rather than Condition Coverage.

ooh dear, I understand now :slight_smile: effectively I didn’t noticed this “little” but important difference…
Ok it looks good for me so.
Thanks to you 2 @Carine_Bayon @Colin_SonarSource :wink:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.