We have sonarcloud integrated with azure devops, and we are using VSTest@2 to run the unit tests. We are facing a problem with code coverage not getting reflected after adding unit tests for some methods. We have noticed that this problem occurs only for async Tasks. I have to mention that we have verified and all the tests are executed and passing, the issue is that Sonar Cloud is not reflecting these changes and is seeing those lines of code uncovered by unit tests.
Wondering if some of you have had the same problem and if you managed to find a solution for this.
To be clear, the coverage from some of your tests are reflected in SonarCloud but others are not? And all tests are instrumented / executed with the same tools? I ask because I’m trying to verify that the covered/uncovered tests really are apples-to-apples. And if they’re not apples-to-apples, what are the differences?
Thank you for your response! Yes, the coverage from some tests is reflected in SonarCloud, but we’ve noticed that sometimes, some lines of code from async Tasks are not getting reflected as covered. We are using a yaml template for the CI/CD process for all our projects, and the VSTest@2 tool is used to execute the tests.