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

Code coverage not generated #5

Open
iPlexor opened this issue May 22, 2024 · 0 comments
Open

Code coverage not generated #5

iPlexor opened this issue May 22, 2024 · 0 comments

Comments

@iPlexor
Copy link
Owner

iPlexor commented May 22, 2024

Describe the bug
Steps in README.md fail to produce code coverage report file.

To Reproduce
Steps (from README.md) to reproduce the behavior:

  1. Add the Coverlet.MSBuild NuGet package to the both projects.

    dotnet add package coverlet.msbuild
  2. Install the ReportGenerator tool:

    dotnet tool install -g dotnet-reportgenerator-globaltool
  3. Run the tests and collect coverage using the dotnet test command with an absolute path.

    dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:CoverletOutput="$(pwd)/coverage/"
  4. Run the ReportGenerator tool:

    dotnet reportgenerator "-reports:HelloWorld.Tests/coverage.opencover.xml" "-targetdir:coveragereport" "-reporttypes:Html"

Expected behavior
There should be a /coverage/coverage.opencover.xml file with some code coverage generated.

Additional context
The coveragereport folder is generated, but since coverage.opencover.xml isn't, neither is the report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant