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.

Add support for executing coverage via SLN

See original GitHub issue

It’s possible to construct a SLN that contains only test csproj files and then use that to execute all of those csprojs at once. When you then run dotnet test all_my_tests.sln, it will execute your test csprojs in parallel - which is an order of magnitude faster than iterating through, say, a list of all the test projects individually.

I would love to be able to collect coverage this way as well, using the stand-alone tool. Ideally something like: coverlet \tests.sln --target "dotnet" --targetargs "test tests.sln --no-build"

It SORT of works now in that tests start executing. However, it has hiccups when it tries to generate the coverage.json files - probably because they do not have a unique nomenclature. The run abruptly ends with

Calculating coverage result...
  Generating report 'C:\Users\mbenua\Documents\GitHub\server\coverage.json'

+--------+--------+--------+--------+
| Module | Line   | Branch | Method |
+--------+--------+--------+--------+

I suspect there’s not a lot of work to get this scenario working, which would be an ENORMOUS perf improvement. Perhaps only as much as having the option to generate unique coverage filenames?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

1reaction
ardaliscommented, Jun 27, 2019

Merging results seems to have been done 10 months ago. Now would like to be able to specify a single output file for a .sln so that I can run this from solution root:

dotnet test /p:CollectCoverage=true /p:MergeWith=CoverageResult.json

This would:

  • Discover all tests
  • Run all tests
  • Collect coverage for all tests (and maybe drop the results into their respective folders as it does today)
  • New Merge all test results into CoverageResult.json specified.
0reactions
MarcoRossignolicommented, Sep 14, 2019
Read more comments on GitHub >

github_iconTop Results From Across the Web

Use code coverage for unit testing - .NET
This article discusses the usage of code coverage for unit testing with Coverlet and report generation using ReportGenerator.
Read more >
Solution wide coverage · Issue #357 · coverlet ...
Coverlet should be able to get coverage for all test projects in a specified solution ... Add support for executing coverage via SLN...
Read more >
Code coverage report for .Net not working on Linux agent
I have an issue with this when I want to run it on linux agent. In the example .NET Test Coverage | SonarCloud...
Read more >
Dotnet Unit test with Coverlet- How to get coverage for ...
Reference coverlet.msbuild in each test project in your solution. · In your CI script, navigate to the directory containing your solution file.
Read more >
Collecting test coverage using Coverlet and SonarQube for ...
First, we'll need to have a piece of code that represents logic which should be submitted to unit testing. I've created a repository...
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