Coverlet merged Test Report not in sync with SonarCloud Dashaboard

Template for a good new topic, formatted with Markdown:

  • ALM used (GitHub, Bitbucket Cloud, Azure DevOps)
  • CI system used (Bitbucket Cloud, Azure DevOps, Travis CI, Circle CI
  • Scanner command used when applicable (private details masked)
  • Languages of the repository
  • Error observed (wrap logs/code around with triple quotes ``` for proper formatting)

We use sonarcloud for maintaining code quality and identifying and fixing security hotspots with our code. We have a .NET solution with multiple Test projects and we would want to aggregate results from each of these projects and produce a single report. The test projects are run sequentially and the coverage reports are captured and merged using coverlet. Finally the coverage report is converted to opencover and submitted to SonarCloud. However the report(% of coverage) shown in the sonar dashboard is different from what the coverlet coverage produces. All these are computed from a branch. Please let me know if you have any additional questions. Any help is much appreciated.

Hi @dkesani,

How different the numbers are? Only the totals are different or also the line and branch coverage?

The computed percentage can be different since we push to cloud only the covered lines and branches and then re-compute the totals using a different formula on SonarCloud/SonarQube side.