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.

run coverlet as global tool with vstest

See original GitHub issue

I try to run coverlet as global tool with vstest. My command line is:

coverlet {path to test .dll} --target "dotnet" --targetargs "vstest {path to test .dll} --logger:trx" --format cobertura --threshold 80 --verbosity detailed

coverlet response:

..
Hits file:'C:\Users\user\AppData\Local\Temp\Pom2_98c0d86c-7f21-4f7a-9ba5-f3690201c1ae' not found for module: 'Pom2'
Hits file:'C:\Users\user\AppData\Local\Temp\Services_98c0d86c-7f21-4f7a-9ba5-f3690201c1ae' not found for module: 'Services'
Hits file:'C:\Users\user\AppData\Local\Temp\Visualization_98c0d86c-7f21-4f7a-9ba5-f3690201c1ae' not found for module: 'Visualization'
..

for every single referenced assemblies that coverlet collect before:

..
Instrumented module: 'D:\IMSHH\IMSHH\bin\ptc\Release\Pom2.dll'
Instrumented module: 'D:\IMSHH\IMSHH\bin\ptc\Release\Services.dll'
Instrumented module: 'D:\IMSHH\IMSHH\bin\ptc\Release\Visualization.dll'
..

coverlet version: Cross platform .NET Core code coverage tool 1.5.0.0 (installed is dotnet tool install --global coverlet.console --version 1.5.3)

Whats going wrong here?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:20

github_iconTop GitHub Comments

1reaction
Nusserdtcommented, Aug 14, 2019

@MarcoRossignoli tears in my eyes. That was the missing part of the puzzle.

Finally coverlet Project.UnitTests.dll --target "vstest.console.exe" --targetargs "Project.UnitTests.dll /Logger:trx" --verbosity detailed --include "[Project]*" works well and returns solid results.

+---------+--------+--------+--------+
|         | Line   | Branch | Method |
+---------+--------+--------+--------+
| Total   | 89,92% | 82,12% | 90,82% |
+---------+--------+--------+--------+
| Average | 89,92% | 82,12% | 90,82% |
+---------+--------+--------+--------+

Thanks for your patience, keep going for your great project.

1reaction
Nusserdtcommented, Aug 9, 2019

That means I have to create a list with all unused .dll and pass them in a array to the --exclude-by-file variable? For example:

--exclude-by-file @("Pom2.dll", "Services.dll")

Read more comments on GitHub >

github_iconTop Results From Across the Web

coverlet-coverage/coverlet: Cross platform code ...
Quick Start. Coverlet can be used through three different drivers. VSTest engine integration; MSBuild task integration; As a .NET Global tool (supports ...
Read more >
NET Core Code Coverage as a Global Tool with coverlet
NET Core "global tool" that helps you find out what NuGet package reference you need to update. .NET Core Global Tools are really...
Read more >
Use code coverage for unit testing - .NET
There are two types of code coverage tools: DataCollectors: DataCollectors monitor test execution and collect information about test runs. They ...
Read more >
Generate Code Coverage Report For .NET Core & .NET ...
The coverlet tool is invoked by specifying the path to the assembly that contains the unit tests. You also need to specify the...
Read more >
How to view code coverage with Coverlet and Visual ...
We've seen how easy it is to run code coverage on .NET Core projects. The installation of the global tool and the extension...
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