Quality Gate Passed Despite Test Coverage on New Code Below Minimum Required

Hi,

I encountered an issue with our recent pull request analysis where the quality gate passed even though the test coverage on the new code does not meet the required minimum of 80%.

As per our quality gate configuration, the test coverage on new code must be at least 80%, but in this case, it is only 73.3%, yet the quality gate is marked as passed.

Could anyone provide insights or suggest possible reasons why this might be happening? Has anyone else faced a similar issue? Any advice on how to ensure the quality gate correctly enforces the test coverage threshold would be greatly appreciated.

Thank you!

1 Like

Hi,

You’ve run afoul of what I call the “fudge factor”. When there are fewer than 20 new lines (that’s lines, not lines of code) conditions on new coverage and duplication are not applied. Why? In our own use of the products we found that you can get into a situation of diminishing returns with such small changes.

In SonarQube, there’s a control to turn that off, but it hasn’t made its way to SonarCloud yet.

 
HTH,
Ann

1 Like

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