AzureDevops C# opencover coverage not visible in SonarQube

Hi Marvin:

Your logs are insightful. The analyze log from line 10172 says:

INFO: Sensor C# Tests Coverage Report Import [csharp]
DEBUG: Analyzing coverage with wildcardPatternFileProvider with base dir 'D:\a\1\.' and file separator '\'.
DEBUG: Pattern matcher extracted prefix/absolute path 'D:\a\1' from the given pattern 'D:\a\1\s/**/TestResults/**/coverage.opencover.xml'.
DEBUG: Gathering files for wildcardPattern 's/**/TestResults/**/coverage.opencover.xml'.
DEBUG: Pattern matcher returns '0' files.
WARN: Could not find any coverage report file matching the pattern 'D:\a\1\s/**/TestResults/**/coverage.opencover.xml'. Troubleshooting guide: https://community.sonarsource.com/t/37151
DEBUG: Analyzing coverage after aggregate found '0' coverage files.
DEBUG: The total number of file count statistics is '0'.
INFO: Sensor C# Tests Coverage Report Import [csharp] (done) | time=183ms

INFO: Sensor C# Unit Test Results Import [csharp]
DEBUG: Pattern matcher extracted prefix/absolute path 'D:\a\1' from the given pattern 'D:\a\1\s/**/TestResults/*.trx'.
DEBUG: Gathering files for wildcardPattern 's/**/TestResults/*.trx'.
DEBUG: Pattern matcher returns '0' files.
INFO: Sensor C# Unit Test Results Import [csharp] (done) | time=188ms
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=93ms

It seems the error is in your reportsPaths assignments: the warn statement said it could not find a report file, and referred to the troubleshooting guide [Coverage] Troubleshooting guide for .NET code coverage import

Let me know how Joe’s advice in this troubleshooting guide helps.


Regards,
Monty

1 Like