We have a pipeline in Azure Devops where, in addition to compiling, test cases are executed and their coverage is obtained. In the coverage.xml file there are some parts where it says coverage=yes but then it doesn’t appear in SonarCloud.
Example:
This is a fragment of the coverage.xml file where it can be seen that this line of code is covered
The information that show the logs is the following:
INFO: Sensor C# Tests Coverage Report Import [csharp]
INFO: Parsing the Visual Studio coverage XML report /agent/_work/1/a/coverage/coverage.xml
INFO: Adding this code coverage report to the cache for later reuse: /agent/_work/1/a/coverage/coverage.xml
INFO: Coverage Report Statistics: 340 files, 238 main files, 238 main files with coverage, 102 test files, 0 project excluded files, 0 other language files.
INFO: Sensor C# Tests Coverage Report Import [csharp] (done) | time=1101ms
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=14ms
I think the information in the coverage file is correct, but it doesn’t show all the coverage because possibly the compilation of the project is not complete and that’s why it appears - in the Code tab under the Lines of code column.