0

I am trying to generate Code coverage report in 2 ways.

  1. Using Fine Code Coverage. There i see all 3 projects of me covered & its % of coverage.
  2. Using Azure devops Pipeline where i use DotNetCoreCLI@2& PublishCodeCoverageResults@1 to build & generate the report. But the issue is API project is not considered in the report. both in trx & xml file.

So i tried MSBuild commands to repro the issue. To run the test cases & to build the xml file i am using below command.

dotnet test --collect:"XPlat Code Coverage"   

After that to publish the coverage using below command.

dotnet test /p:CollectCoverage=true

Issue:- In above command also , i don't see my Api Project is getting into report, where as i see the API layer unit test are running.

Below is my project structure( using clean code architecture/Onion architecture)

enter image description here

Why only API is getting excluded , where as all unit test are running for the same.

lokanath das
  • 736
  • 1
  • 10
  • 35
  • Does your webapi project add nuget reference? – Chen Nov 21 '22 at 06:50
  • Yes it have all reference, i.e., Webapi.csproj,Infrastructure.csproj & Application.csproj. When i am running test suite from Local, i can see API layer execution , same when i run it from Pipeline, also i can see the Run for API layer. – lokanath das Nov 21 '22 at 08:06

0 Answers0