IncludeTestAssembly should default to true
See original GitHub issueI 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:
- Created 4 years ago
- Comments:10 (5 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Seems that exclude test project by default is the expected behavior for the majority.
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?