The Test Coverage Results Displayed in SonarCloud are Wrong
- versions used : I am using SonarCloud
- error observed: The Test Coverage Results Displayed in SonarCloud are Wrong
- steps to reproduce
- Run Analyze Test Coverage for all tests in Visual Studio
- Run Sonar Cloud on the same Branch
Results: The Sonar Cloud Test Coverage Result is 2.41% and the Visual Studio Enterprise Edition Test Coverage Result is 14.86%
So, what do we know so far:
- VS.Net Counts the number of lines differently then sonar cloud.
- Sonar Cloud uses its line count and the line coverage in each record from the vs.net report.
- On the develop branch, the resulting percentage from sonar cloud and vs.net are different by about a factor of 4, which is much greater than the factor of line count differences, which is less then 2. This means that we are missing something. My guess is that some of records from the vs.net report are not counted.
- The configurations were wrong for doing code coverage on pr’s until yesterday – I do not know if that is relevant for the develop branch itself.
- There is no workaround