Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 opened this issue Aug 16, 2024 · 1 comment
Labels
question This issue is a question stale

Comments

@bj-kbj
Copy link

bj-kbj commented Aug 16, 2024

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'
@github-actions github-actions bot added the untriaged To be investigated label Aug 16, 2024
@bj-kbj bj-kbj changed the title Unable include code coverage for nunit unit test project in the coverlet and covertura configin azure pipeline with yml Unable include code coverage for nunit unit test project in the coverlet and covertura configin azure pipeline with yml for .net 8 project Aug 16, 2024
@Bertk Bertk added question This issue is a question and removed untriaged To be investigated labels Aug 18, 2024
@Bertk
Copy link
Collaborator

Bertk commented Aug 18, 2024

Please set property IncludeTestAssembly in runsettings file and build the test assembly before executing the test.
see Advanced Options (Supported via runsettings)

image

@github-actions github-actions bot added the stale label Oct 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question This issue is a question stale
Projects
None yet
Development

No branches or pull requests

2 participants