Coverage Not Be Calculated

*SonarQube :7.4 , Scanner : scanner-3.3, Plugin :SonarC# 7.7

Hi,
We have been using SonarQube for a long time.
There is a problem with calculation of coverage .
I trigged a build request for a project from jenkins the day before, it couldn’t pass the gate because of quality gate criteria.
Today i have again trigged a request for the same project, the project could passed the gate
although it doesn’t provide the criterias.

#bug:fault
On the dashboard you can see the result.

Thank you in advance.

Best Regards.
Cemile K.

Hello. From what I understand, you mention two problems:

  1. Code coverage does not get uploaded to SQ anymore
  2. SQ , even if it does not receive code coverage, it passes the quality gate

For the first problem, can you please

  • tell us what changed in the way you run your CI - when did the code coverage stopped being produced?
  • what are the commands of the CI script to run the build & analysis?
  • can you share the verbose logs of the begin step, build step and end step with us? (please run SonarScanner.MSBuild.exe begin /k:“MyProject” /d:sonar.verbose=true as the begin step, and please attach the output of END step)
  • is the code coverage file produced correctly?

Hi @Andrei_Epure

1- There was no change in CI pipline, and on both of two analysis the coverage has been calculated, report was generated.


2-Here is out CI script for SonarQube stage

image

3-I run analysis for same project the same issue didn’t occur. Because it doesn’t occur always.
4-Yes, code coverage file produced correctly.

Hi @ckonca

In order to have the coverage report imported correctly the generation should be done between the build step and the scanner end. In the attached snippet this seems to be done at another moment.

At the bottom of this page: https://docs.sonarqube.org/latest/analysis/coverage/ you can find a few notes about how to import the reports.

Please let us know if this solves your issue.

Thank you,
Costin