Questions tagged [coverlet]

Coverlet is a .Net code coverage collector that can be used with MSTest. Use this tags for questions regarding the coverlet collector and it's usage and/or output.

75 questions
0
votes
0 answers

What unit tests generate coverage of a specific line?

Coverlet has a great xml report of line/function/class coverage. My question is what unit test generated the coverage of a function/line? Is there a coverlet setting for that?
MartinN
  • 51
  • 1
  • 6
0
votes
0 answers

why dotnet test --collect requires obj folder

I have two projects in my solution, a class library and a test library (lets call them Library and Tests.Library). My library project targets .NETStandard2.0 and my test project is based on the visual studio NUnit project template (using coverlet),…
fharreau
  • 2,105
  • 1
  • 23
  • 46
0
votes
1 answer

coverlet: Unable to instrument module (ArgumentException)

I faced an issue when some projects from solution (NOT ALL) are not being instrumented (have zero coverage, though have active unit tests). All projects in solution have the same package refs and settings: coverlet: 3.2.0 xUnit:…
0
votes
0 answers

When calculate C# solution code coverage, how to include projects not covered by test at all?

I'm using C# to develop a software which contains multiple projects in a Visual Studio solution, and I'm begin adding some unit tests. Solution hierarchy as below, 3 projects for production code, 2 projects which only tests Project1 and Project2,…
YuWea
  • 165
  • 9
0
votes
0 answers
0
votes
0 answers

Azure Pipeline is using old version of ReportGenerator

my Azure Pipeline keeps using an old version of ReportGenerator even after installing the latest version in the YAML script. I have an application on Net6 that uses the nuget package coverlet.collector version 3.1.2. I have a yaml pipeline that…
Glynn Bacanto
  • 439
  • 2
  • 6
  • 12
0
votes
0 answers

Coverlet doesn't appear to respect Function Exclusions in my .runsettings file

I have a .runsettings file which excludes autogenerated methods that are typically associated with async/await code, i.e. MoveNext() in my case. This is my .runsettings file:
ilitirit
  • 16,016
  • 18
  • 72
  • 111
0
votes
1 answer

Cannot exclude assemblies when using coverlet 3.2.0 and a .runsettings file

I am trying to run unit tests using NUnit and coverlet but exclude assemblies that end with the name .Testing from the coverage report. However, whatever I do the file (for example MyProj.Testing.dll) is being added in the coverage report (other…
bytedev
  • 8,252
  • 4
  • 48
  • 56
0
votes
0 answers

dotnet test --collect:"XPlat Code Coverage" not consider Api project

I am trying to generate Code coverage report in 2 ways. Using Fine Code Coverage. There i see all 3 projects of me covered & its % of coverage. Using Azure devops Pipeline where i use DotNetCoreCLI@2& PublishCodeCoverageResults@1 to build &…
lokanath das
  • 736
  • 1
  • 10
  • 35
0
votes
0 answers

Run dotnet tests without excluding ExcludeFromCoverageAttribute (i.e. consider all code coverable)

I am running test using dotnet test (dotnet SDK version: 6.0.402) the command looks like this "C:/Program Files/dotnet/dotnet.exe" test "D:\MyRepo\MyProj.csproj" /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura /p:SolutionDir=D:\MyRepo…
Sebastian Slutzky
  • 382
  • 1
  • 5
  • 22
0
votes
1 answer

Can't produce coverage in Docker container

I'm having trouble getting coverlet to run in my docker container. My problems seems similar to this issue, although the problem persists, and there are some differences. Setup .NET 6 tests project. References have Microsoft.NET.Test.Sdk v17.2.0…
RPM1984
  • 72,246
  • 58
  • 225
  • 350
0
votes
1 answer

Sonarqube: Test coverage comes as 0

I am using sonar integration for the c# x unit test project. But always test coverage is coming as 0. How can I resolve this
0
votes
1 answer

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.Test.Sdk as nuget references. T has a .runsettings file with no include include/exclude paths (all assemblies included, non…
hexcode
  • 393
  • 1
  • 4
  • 13
0
votes
1 answer

C# - Exclude lambda expression from code coverage

I have a particular third party class that has an event handler. I have setup MyEventHandler method which I am able to test using reflection, so I know that is well tested. However I am getting a missing line coverage where I setup the handler…
touchofevil
  • 595
  • 4
  • 21
0
votes
1 answer

Coverlet generated coverage.cobertura.xml empty source full path in filename

It works fine in most of my projects, but I have one where the coverage.cobertura.xml is generating like:
Lee Tickett
  • 5,847
  • 8
  • 31
  • 55