Test coverage causing some misleading data in the reports

We are using SonarQube enterprise edition 10.2 (recently upgraded from9.3 to 10.2)

We have installed SonarQube in a linux stand alone machine and we are using SonarQube task in Azure Devops to analyze and scan the code for coverage.

Issue :

There are some projects in SonarQube which keep randomly fluctuating to 0% test coverage causing some misleading data in the reports. But when we redeploy the pipeline it shows 80 %. (Screen shot attached for reference).

Any reason for this fluctuation, please advice how to read data in the Graph.

////////////////////////////////////////////////////
We have a another service who’s graph look more readable, please advice what could cause this variation

It looks like between analyses, different code might be analyzed or different tests might be run.

If you have two builds that produce wildly different results in SonarQube, my first suggestion would be to compare them (even a simple diff can help) and see if a different number of files are being indexed, and different warnings are being raised in the logs.

Awesome Colin,

You are right, we have two pipeline one for PR analysis and one for Sonarqube analyzes (Both were analyzing the same branch) . The PR analyzes pipeline had some issues so we fixed the PR pipeline in turn it fixed our issue.

Thanks again Colin.

Awesome Colin,

You are right, we have two pipeline one for PR analysis and one for Sonarqube analyzes (Both were analyzing the same branch) . The PR analyzes pipeline had some issues so we fixed the PR pipeline in turn it fixed our issue.

Issue resolved . Thanks again Colin.

1 Like