Skip to content

Unable include code coverage for nunit unit test project in the coverlet and covertura configin azure pipeline with yml for .net 8 project #1687

Open
@bj-kbj

Description

@bj-kbj

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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions