Missing Code Coverage

  • ALM used Azure DevOps (Azure repos)
  • CI system used Azure DevOps
  • Languages of the repository: ASP.NET core
  • Only if the Sonar Cloud project is public, the URL : Private

Our organization uses sonar cloud paid plan for static code analysis. We setup sonar integration using Azure Devops for REST API projects. Integration for code coverage is done and everything was working as expected however we are noticing there is no code coverage report generated in logs or either in soar cloud dashboard for all our.

Please find attached logs and also pipeline configuration:
logs_20496.zip (281.1 KB)
WIS_CustomerApp_RestAPI-CI-PR.zip (282.1 KB)

Please guide us with the issue here.

Thank you!

Hi,

Here’s your problem:

2023-01-17T18:02:55.0033945Z INFO: Sensor C# Tests Coverage Report Import [csharp]
2023-01-17T18:02:55.0300134Z WARN: Could not find any coverage report file matching the pattern 'D:\a\1\s/**/coverage.opencover.xml'. Troubleshooting guide: https://community.sonarsource.com/t/37151

You’ve specified a path with a wildcard in it. That’s not supported.

 
HTH,
Ann

Hi @ganncamp

It was working fine earlier nothing has been updated in properties. I see this error as well in logs does this effect code coverage?

/p:CollectCoverage=true /p:CoverletOutputFormat=opencover --logger trx --collect "code coverage"
2023-01-27T18:31:43.6641640Z C:\Users\VssAdministrator\.nuget\packages\coverlet.msbuild\3.1.2\build\coverlet.msbuild.targets(39,5): error : Module test path 'D:\a\1\s\WIS_CustomerApp_RestAPI\Tests\bin\Debug\netcoreapp3.1\Tests.dll' not found [D:\a\1\s\WIS_CustomerApp_RestAPI\Tests\Tests.csproj]
2023-01-27T18:31:43.6646475Z C:\Users\VssAdministrator\.nuget\packages\coverlet.msbuild\3.1.2\build\coverlet.msbuild.targets(39,5): error :    at Coverlet.Core.Helpers.SourceRootTranslator..ctor(String moduleTestPath, ILogger logger, IFileSystem fileSystem) in /_/src/coverlet.core/Helpers/SourceRootTranslator.cs:line 42 [D:\a\1\s\WIS_CustomerApp_RestAPI\Tests\Tests.csproj]
2023-01-27T18:31:43.6649599Z C:\Users\VssAdministrator\.nuget\packages\coverlet.msbuild\3.1.2\build\coverlet.msbuild.targets(39,5): error :    at Coverlet.MSbuild.Tasks.InstrumentationTask.<Execute>b__59_1(IServiceProvider serviceProvider) in /_/src/coverlet.msbuild.tasks/InstrumentationTask.cs:line 75 [D:\a\1\s\WIS_CustomerApp_RestAPI\Tests\Tests.csproj]
2023-01-27T18:31:43.6654495Z C:\Users\VssAdministrator\.nuget\packages\coverlet.msbuild\3.1.2\build\coverlet.msbuild.targets(39,5): error :    at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitFactory(FactoryCallSite factoryCallSite, ServiceProviderEngineScope scope) [D:\a\1\s\WIS_CustomerApp_RestAPI\Tests\Tests.csproj]
2023-01-27T18:31:43.6658026Z C:\Users\VssAdministrator\.nuget\packages\coverlet.msbuild\3.1.2\build\coverlet.msbuild.targets(39,5): error :    at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(IServiceCallSite callSite, TArgument argument) [D:\a\1\s\WIS_CustomerApp_RestAPI\Tests\Tests.csproj]
2023-01-27T18:31:43.6663535Z C:\Users\VssAdministrator\.nuget\packages\coverlet.msbuild\3.1.2\build\coverlet.msbuild.targets(39,5): error :    at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProviderEngineScope scope) [D:\a\1\s\WIS_CustomerApp_RestAPI\Tests\Tests.csproj]
2023-01-27T18:31:43.6667282Z C:\Users\VssAdministrator\.nuget\packages\coverlet.msbuild\3.1.2\build\coverlet.msbuild.targets(39,5): error :    at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitSingleton(SingletonCallSite singletonCallSite, ServiceProviderEngineScope scope) [D:\a\1\s\WIS_CustomerApp_RestAPI\Tests\Tests.csproj]
2023-01-27T18:31:43.6671639Z C:\Users\VssAdministrator\.nuget\packages\coverlet.msbuild\3.1.2\build\coverlet.msbuild.targets(39,5): error :    at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(IServiceCallSite callSite, TArgument argument) [D:\a\1\s\WIS_CustomerApp_RestAPI\Tests\Tests.csproj]
2023-01-27T18:31:43.6676173Z C:\Users\VssAdministrator\.nuget\packages\coverlet.msbuild\3.1.2\build\coverlet.msbuild.targets(39,5): error :    at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, ServiceProviderEngineScope scope) [D:\a\1\s\WIS_CustomerApp_RestAPI\Tests\Tests.csproj]
2023-01-27T18:31:43.6680080Z C:\Users\VssAdministrator\.nuget\packages\coverlet.msbuild\3.1.2\build\coverlet.msbuild.targets(39,5): error :    at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(IServiceCallSite callSite, TArgument argument) [D:\a\1\s\WIS_CustomerApp_RestAPI\Tests\Tests.csproj]
2023-01-27T18:31:43.6684581Z C:\Users\VssAdministrator\.nuget\packages\coverlet.msbuild\3.1.2\build\coverlet.msbuild.targets(39,5): error :    at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProviderEngineScope scope) [D:\a\1\s\WIS_CustomerApp_RestAPI\Tests\Tests.csproj]
2023-01-27T18:31:43.6691152Z C:\Users\VssAdministrator\.nuget\packages\coverlet.msbuild\3.1.2\build\coverlet.msbuild.targets(39,5): error :    at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitSingleton(SingletonCallSite singletonCallSite, ServiceProviderEngineScope scope) [D:\a\1\s\WIS_CustomerApp_RestAPI\Tests\Tests.csproj]
2023-01-27T18:31:43.6696202Z C:\Users\VssAdministrator\.nuget\packages\coverlet.msbuild\3.1.2\build\coverlet.msbuild.targets(39,5): error :    at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(IServiceCallSite callSite, TArgument argument) [D:\a\1\s\WIS_CustomerApp_RestAPI\Tests\Tests.csproj]
2023-01-27T18:31:43.6698989Z C:\Users\VssAdministrator\.nuget\packages\coverlet.msbuild\3.1.2\build\coverlet.msbuild.targets(39,5): error :    at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(IServiceCallSite callSite, ServiceProviderEngineScope scope) [D:\a\1\s\WIS_CustomerApp_RestAPI\Tests\Tests.csproj]
2023-01-27T18:31:43.6703010Z C:\Users\VssAdministrator\.nuget\packages\coverlet.msbuild\3.1.2\build\coverlet.msbuild.targets(39,5): error :    at Microsoft.Extensions.DependencyInjection.ServiceLookup.DynamicServiceProviderEngine.<>c__DisplayClass1_0.<RealizeService>b__0(ServiceProviderEngineScope scope) [D:\a\1\s\WIS_CustomerApp_RestAPI\Tests\Tests.csproj]
2023-01-27T18:31:43.6706433Z C:\Users\VssAdministrator\.nuget\packages\coverlet.msbuild\3.1.2\build\coverlet.msbuild.targets(39,5): error :    at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngine.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope) [D:\a\1\s\WIS_CustomerApp_RestAPI\Tests\Tests.csproj]
2023-01-27T18:31:43.6709218Z C:\Users\VssAdministrator\.nuget\packages\coverlet.msbuild\3.1.2\build\coverlet.msbuild.targets(39,5): error :    at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngine.GetService(Type serviceType) [D:\a\1\s\WIS_CustomerApp_RestAPI\Tests\Tests.csproj]

Thanks,
Kavya

Hi Kavya,

Well that error could have an impact if it’s preventing the generation of your coverage report…?

 
Ann