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.

IncludeTestAssembly should default to true

See original GitHub issue

I just enabled coverlet on a new repository, and the coverage reports were incomplete. The root cause turned out to be a setting IncludeTestAssembly, which confusingly excluded code from the coverage report even though that code was not part of any of the various exclude properties.

Test code is an essential part of a production code base, and should always be included in coverage collection. It’s fine to provide a property so it can be disabled, but the property should default to the value users are expected to use.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
MarcoRossignolicommented, Feb 21, 2021

Seems that exclude test project by default is the expected behavior for the majority.

1reaction
PureKromecommented, Dec 18, 2019

I know i’m late to this party - so I’m trying to understand what people are thinking here.

A test method tests some product assembly/method. Kewl. So why do we want coverage on a test method? The tests are there to verify the product assembly is working great. The coverage is used to make sure the product assembly is tested appropriately.

I don’t see why anyone would care if a test method is … covered? All I could see that this could highlight are some ‘orphaned’ methods in the test project which are called/used any more?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Code coverage gets generated only for Tests project
I've got a project (say A.csproj ) and a tests project (say T.csproj ). T has coverlet.msbuild and Microsoft.NET ...
Read more >
Failure to send coverage report to Sonarqube in .net Core 3.1
Net Core 3.1 project sonarqube. I tried many ways, but the result of the report is not visible in the sonarqube portal. Can...
Read more >
Documentation - GitHub
With correct reference in place you can run coverage through default dotnet test CLI verbs: ``` dotnet ... <IncludeTestAssembly>true</IncludeTestAssembly> ...
Read more >
Is it possible to get Code Coverage of .NET Framework Project ...
yes, you can can code coverage data from a asp.net project. and it's simple as @riqq suggested in this thread. the following content...
Read more >
Fine Code Coverage
IncludeTestAssembly Specifies whether to report code coverage of the test assembly IncludeReferencedProjects Set to true to add all referenced projects to ...
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