Quality Gate should fail if Code coverage for even 1 projects in a solution is empty or 0

Must-share information:

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    Version 6.7.4 (build 38452)
  • what are you trying to achieve
    Quality Gate should fail if Code coverage for projects are empty or 0
  • what have you tried so far to achieve this
    NA

Detailed Info:
We set Quality gate for Code coverage as 90. I have a Dot net project(solution) which contains 6 *.csproj in it. Unit test was written only for 2 csproj. Unit test was success and code coverage for that 2 csproj was 95%. Due to this, the quality gate was success. However for the remaining project (4 *.csproj), there are no unit tests. Due to that coverage was empty. WHY Quality gate for coverage is not detecting if unit tests are not written or coverage is empty for a specific project ?

Hi @ChidambaraGandhi,

Sorry for this late answer.

We detect all lines that could be covered by a test and we use this information to calculate the code coverage. If you really want those projects never to be covered then I suggest to exclude them from code coverage in the settings of your project.

Cheers,
Amaury