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.

1.5.0 instruments and reports on the unit test project in addition to the assembly under test.

See original GitHub issue

With the exact same command-line, coverlet console 1.5.0 is instrumenting and reporting coverage for the unit test project itself, where in 1.4.1 it only instrumented the project under test as expected.

coverlet TestProject1/bin/Debug/netcoreapp2.1/TestProject1.dll --target "dotnet" --targetargs "test --no-build"

coverlet console 1.4.1

Calculating coverage result...
  Generating report '/projects/customer/coverage.json'
+-------------------------+--------+--------+--------+
| Module                 | Line   | Branch | Method |
+-------------------------+--------+--------+--------+
| customer              | 29%    | 23.1%  | 47.1%  |
+-------------------------+--------+--------+--------+

+---------+--------+--------+--------+
|         | Line   | Branch | Method |
+---------+--------+--------+--------+
| Total        | 29%    | 23.1%  | 47.1%  |
+---------+--------+--------+--------+
| Average  | 29%    | 23.1%  | 47.1%  |
+---------+--------+--------+--------+

coverlet console 1.5.0

Calculating coverage result...
  Generating report '/projects/customer/coverage.json'
+-------------------------+-------+--------+--------+
| Module                  | Line  | Branch | Method |
+-------------------------+-------+--------+--------+
| customer | 29%   | 23.1%  | 47.1%  |
+-------------------------+-------+--------+--------+
| TestProject1            | 81.6% | 16.7%  | 71.4%  |
+-------------------------+-------+--------+--------+

+---------+--------+--------+--------+
|         | Line   | Branch | Method |
+---------+--------+--------+--------+
| Total   | 36.7%  | 22.9%  | 48.3%  |
+---------+--------+--------+--------+
| Average | 18.35% | 11.45% | 24.15% |
+---------+--------+--------+--------+

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
tonerdocommented, Mar 28, 2019

@derhally @MarcoRossignoli That error is because Coverlet is unconditionally trying to restore the pdb file for an assembly that has it embedded. I’m also in agreement with @derhally with respect to including test assemblies by default and I’ll work on putting this feature behind a flag that will be turned off by default. Will address this weekend

2reactions
derhallycommented, Mar 28, 2019

I don’t agree. I personally never want to instrument my unit tests. My unit test runner tells me which tests are run, skipped or failed. That should not be the default behavior of coverlet. I expect that most people care only about the SUT not what is testing the SUT.

At this point I cannot use coverlet 2.5. or later. I’m having to exclude 5 or 6 external assemblies from one project. I work with dozens of projects and having to do this on each one and everytime I add a 3rd party nuget package is quite silly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

1.5.0 instruments and reports on the unit test project in ...
1.5.0 instruments and reports on the unit test project in addition to the assembly under test. #372.
Read more >
No test found. Make sure that installed test discoverers & ...
I am in the process of upgrading our existing solution to .Net 4.6.1 and have been unable to get our unit tests to...
Read more >
How To Resolve Issue Of Test Project Not Running The ...
Introduction. I was upgrading the .NET Core 3.1 project to .NET 6 and faced issues running test cases in my test projects.
Read more >
dotnet test command - .NET CLI
The dotnet test command is used to execute unit tests in a given project.
Read more >
Get started with unit testing - Visual Studio (Windows)
This section describes how to create a unit test project. Open the project that you want to test in Visual Studio.
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