I’m getting the following warning on a project which is causing the Quality Gate check to always fail during PR. Any advice on what might cause this? Any help would be greatly appreciated.
INFO: Parsing the Visual Studio coverage XML report d:\a_temp\TestResults\ac23fd75-44a9-4129-9808-322f1111bbfc\VssAdministrator_fv-az686 2019-10-31 16_26_23.coveragexml
INFO: Adding this code coverage report to the cache for later reuse: d:\a_temp\TestResults\ac23fd75-44a9-4129-9808-322f1111bbfc\VssAdministrator_fv-az686 2019-10-31 16_26_23.coveragexml
INFO: Coverage Report Statistics: 3 files, 0 main files, 0 main files with coverage, 3 test files, 0 project excluded files, 0 other language files. WARN: The Code Coverage report doesn’t contain any coverage data for the included files. For troubleshooting hints, please refer to https://docs.sonarqube.org/x/CoBh
What is the configuration of your VSTest task ? Do you have checked ‘Enable code coverage’ or added the --collect:“Code Coverage” if it is a dotnet task ?
Hi @mickaelcaro. I am having the same issue as the original poster with a similar tech stack. The correct number of unit tests show up in the sonar cloud dashboard but the coverage percentage is 0.
Build Pipeline on Azure Devops
SonarCloud extension by SonarSource
Languages: .NET Core and Angular
On the dotnet test task the arguments I have are --configuration $(BuildConfiguration) -p:CollectCoverage=true -p:CoverletOutputFormat=opencover -p:CoverletOutput=$(Common.TestResultsDirectory) --logger:trx --results-directory $(Common.TestResultsDirectory) --collect "Code coverage"
In the output of the Run Code Analysis step it finds the .trx and .coverage file 15:39:32.548 The following test results files were found: D:\a\1\TestResults\VssAdministrator_fv-az314_2019-11-05_15_39_30.trx 15:39:32.923 The following code coverage attachments were found from the trx files: D:\a\1\TestResults\VssAdministrator_fv-az314_2019-11-05_15_39_30\In\fv-az314\VssAdministrator_fv-az314_2019-11-05.15_39_25.coverage
Then the warning comes after the parsing the Visual Studio coverage XML INFO: Parsing the Visual Studio coverage XML report D:\a\1\TestResults\VssAdministrator_fv-az314_2019-11-05_15_39_30\In\fv-az314\VssAdministrator_fv-az314_2019-11-05.15_39_25.coveragexml INFO: Adding this code coverage report to the cache for later reuse: D:\a\1\TestResults\VssAdministrator_fv-az314_2019-11-05_15_39_30\In\fv-az314\VssAdministrator_fv-az314_2019-11-05.15_39_25.coveragexml INFO: Coverage Report Statistics: 1 files, 0 main files, 0 main files with coverage, 1 test files, 0 project excluded files, 0 other language files. WARN: The Code Coverage report doesn't contain any coverage data for the included files. For troubleshooting hints, please refer to https://docs.sonarqube.org/x/CoBh
I am receiving another error about an outdated version of TypeScript but I do not think that would impact the code coverage from C#. Any suggestions to move forward?
The issue seemed to be the Microsoft.NET.Test.Sdk package version we were using. Once we changed the version from 15.9.0 to 16.4.0 the coverage report started to pick up all test and coverage statistics.