question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Merge Coverage Files generated using collectors integration

See original GitHub issue

We’re suffering from the first issue mentioned here, we see 0% code coverage when running integration tests (The tests use the asp.net core WebApplicationFactory/testhost method for spinning up an in-memory web hostserver)

Example: dotnet test src\Project.IntegrationTests -c Release --no-build --logger:trx ^ --results-directory %testresults%/IntegrationTests ^ /p:CollectCoverage=true ^ /p:CoverletOutput=%testresults%\Coverage\ ^ /p:\"CoverletOutputFormat=cobertura,json\"

This sadly produces the 0% coverage on all lines/methods/classes etc as mentioned in the known issue document.

The suggested fix in the Known Issues document works a charm, using

dotnet test src\Project.IntegrationTests -c Release --no-build --logger:trx --results-directory %testresults%/IntegrationTests --collect:"XPlat Code Coverage"

Produces plenty of code coverage metrics as expected, and can see those when we feed the coverage.cobertura.xml file into reportgenerator.

However as far as I know, the above dotnet test ONLY produces test coverage data in the coverage.cobertura.xml format, which can’t be merged with coverage.coberatura.xml files from further test projects (e.g see this error).

Is there a way to achieve any of the following:

  1. Have collect:"XPlat Code Coverage spit out JSON coverage data to merge future dotnet tests with?
  2. Merge the coverage.cobertura.xml files instead? (n.b. we are also relying on the

    | Total | 100% | 100% | 100% | getting spat out in the console to ensure 100% coverage)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
nedgradycommented, Dec 30, 2020

Thanks I’ll give that a real go, couldn’t seem to get the code coverage happening in proc the last time but will try with confidence this time.

Will close if no further issues

0reactions
MarcoRossignolicommented, Jan 16, 2022

Closing for stale conversation, feel free to reopen if needed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to merge coverage reports from different jest test runs ...
Collect multiple coverage reports using coverage reporter "json"; Put them all in one directory (which in my case required renaming multiple ...
Read more >
Go 1.20: Combined Unit and Integration Code Coverage
This post demonstrates Go 1.20's new tooling to merge and convert the binary format into the text format. Create a sample Go program....
Read more >
Merging Integration, Unit and functional test reports with ...
We would see how to merge Integration and Unit test reports with JaCoCo. Along with that functional test reports too into one single...
Read more >
Test coverage visualization | GitLab
Collecting the coverage information is done by using the GitLab CI/CD artifacts reports feature. You can specify one or more coverage reports to...
Read more >
Combining multiple code coverage results in Azure DevOps
Learn how to easily combine your code coverage results into one report in an Azure DevOps CI/CD pipeline with this simple tool.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found