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)
    GitHub
  • CI system used (Bitbucket Cloud, Azure DevOps, Travis CI, Circle CI
    CircleCI
  • Scanner command used when applicable (private details masked)
    dotnet-scanner
  • Languages of the repository
    C#
  • 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.