Some projects are passing Quality Gate although coverage not calculate

Hi community,

My SonarQube is Community Edition 8.1 and SonarScanner is MSBuild 4.6 .
In gate profile, although i define coverage like below, some projects which didn’t have coverage measure could pass the gate.

Coverage is less than 90.0%

As I observed that the projects which tests are failed could get passed sometimes.
Or if the the project has no test, it could be passing too.

Like below example the developer has writed some test codes but commented them out.
image

On projects tab view, you can see there is no coverage measure.

Thank you in advance.

Hi @ckonca,

You need some coverage information (at least 0%) for the QG rule to apply. If there’s no coverage, then the condition cannot apply.

Imagine a PR in a project with 100% coverage, where you just update your readme.md file. No lines of code were changed, therefore no coverage is applied for changed files. It’s not desired for QG to fail when Coverage is not defined.