Skip to content

Code coverage not generated #5

@iPlexor

Description

@iPlexor

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions