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
<function block_coverage="100.00" line_coverage="100.00" blocks_covered="3" blocks_not_covered="0" lines_covered="3" lines_partially_covered="0" lines_not_covered="0" id="8796" token="0x6000013" name="AddAzureStorage(Microsoft.Extensions.DependencyInjection.IServiceCollection, string, string)" namespace="XXXX.Core.Files.AzureStorage" type_name="AzureStorageExtension">
<ranges>
<range start_line="9" start_column="9" end_line="9" end_column="10" covered="yes" source_id="2" />
<range start_line="10" start_column="13" end_line="10" end_column="133" covered="yes" source_id="2" />
<range start_line="11" start_column="9" end_line="11" end_column="10" covered="yes" source_id="2" />
</ranges>
</function>
If we see the HTML generated by an external tool it also appears covered
But instead, in SonarCloud it does not appear in green cover.
Why? Why in SonarCloud some blocks yes and others no if in the coverage.xml file is correct?
Thanks!!
Regards