Does SonarQube code Coverage fail if there is no reports imported

I am writing to ask about code coverage in SonarQube Developer Edition.
If I don’t import the code coverage generated by doCover, is the Quality gate going to fail?
I am asking this because, for the same project, I noticed that sometimes it fails and sometimes it is not failing depending on the file I add the code to.

  • cs class code - > fails.
  • cs Interface code → pass
    maybe in the case of the interface, it is ignored because there is no functionality that requires test coverage. However, when I read the sonarQube documentation, it says that if there is no code coverage report, the code coverage analysis will not run.
    so please help me understand this.

I am currently running:

  • SonarQube Developer Edition Version 9.4 (build 54424) on Windows.
  • Tool ‘dotnet-sonarscanner’ (version ‘5.13.0’)
  • SonarScanner for MSBuild 5.13.
    Quality gate metrics: | Coverage | is less than | 70.0%

Hi @Ahmed_Ghareeb ,

I recommend you look into upgrading your SonarQube instance minimally to version 9.9.X, the latest LTS to take advantage of all of the latest enhancements.

Generally, if you have a coverage condition and you do not import coverage, you will fail the condition.
If your coverage condition is focused on new code, it will only consider the added or changed lines of code for coverage, so the first analysis will typically pass (as it is not new code).

If you believe there is an issue, can you share some details of your results?