coverlet
coverlet copied to clipboard
Unable include code coverage for nunit unit test project in the coverlet and covertura configin azure pipeline with yml for .net 8 project
I have 3 projects in my solution including the test project. I get only 2 project in code coverage result in the azure pipeline and also same in local coverage.cobertura.xml file which excludes the test project. I want to include the test project also in the code coverage.I am trying to get the code coverage in the azure pipeline for the solution which should include the code coverage for my nunit test project also. However it's not working below is my yml change.
Run tests with Coverlet code coverage and include the test project in coverage results
- task: DotNetCoreCLI@2 displayName: 'Run Tests' inputs: command: 'test' projects: '**/Warsy.Fulto.Test.csproj' arguments: | --configuration $(buildConfiguration) --collect:"XPlat Code Coverage" /p:Include="[Warsy.Fulto.Test]*" --verbosity detailed
Publish code coverage results
- task: PublishCodeCoverageResults@2 displayName: 'Publish CodeCoverage' inputs: codeCoverageTool: 'Cobertura' summaryFileLocation: '$(Agent.TempDirectory)/**/coverage.cobertura.xml'
Please set property IncludeTestAssembly in runsettings file and build the test assembly before executing the test.
see Advanced Options (Supported via runsettings)