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

Cannot get code coverage reports for SpecFlow to generate #2732

Open
jwenger100 opened this issue Jan 9, 2024 · 0 comments
Open

Cannot get code coverage reports for SpecFlow to generate #2732

jwenger100 opened this issue Jan 9, 2024 · 0 comments
Labels

Comments

@jwenger100
Copy link

jwenger100 commented Jan 9, 2024

SpecFlow Version

3.9.74"

Which test runner are you using?

xUnit

Test Runner Version Number

<PackageReference Include="xunit" Version="2.4.2" />

.NET Implementation

.NET 6.0

Project Format of the SpecFlow project

Sdk-style project format

.feature.cs files are generated using

SpecFlow.Tools.MsBuild.Generation NuGet package

Test Execution Method

Visual Studio Test Explorer

SpecFlow Section in app.config or content of specflow.json

N/A

Issue Description

I am trying to generate a code coverage report, I am interested to find out what % of lines are covered in each one of my projects within this solution. I have tried using the built in code coverage with Xunit, along with coverlet nuget package and I cannot get reports to generate with any data in them. They generate but are empty. Is there a recommended approach for accomplishing this?

Steps to Reproduce

  1. Run this command to execute the specflow tests, coverage should be generated but is not accurate.
  2. dotnet test --filter "FullyQualifiedName~IntTests" -p:CollectCoverage=true -p:CoverletOutputFormat=\"json,opencover\" -p:MergeWith="pwd/coverage.json" --logger "trx;LogFileName=TestResults.trx"

Link to Repro Project

No response

@jwenger100 jwenger100 added the Bug label Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant