-
Notifications
You must be signed in to change notification settings - Fork 389
run coverlet as global tool with vstest #513
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
We've issue with Unload event https://github.com/tonerdo/coverlet/blob/5a139b200f7bf51c21660b93f41906f4571c971b/src/coverlet.core/Coverage.cs#L231 that will be resolved with collectos. But before some question(maybe silly)
In case can you provide a repro(or project is open sorce and we can clone)? |
Hello @MarcoRossignoli thanks for your response.
|
The issue could be related to this...if you don't use that libs you should exclude from coverage(or better include only dll you're testing)...we don't have at the moment a way to exclude "unused" dll. |
That means I have to create a list with all unused .dll and pass them in a array to the
|
yep, global tool filter sample are here https://github.com/tonerdo/coverlet/blob/master/Documentation/GlobalTool.md#filters |
@MarcoRossignoli I try to switch to coverlet Version 1.2.0.0 and remarkable is that the coverlet execution stops immediately with the message:
What should that tell me? |
Mmm can you take a screenshot of command line?I don't understand if it's related to coverlet (seem that pdb are not aligned with compilation, try also to run |
@MarcoRossignoli Sorry that I have to mask some parts. I try both: and
it also fails without the |
Have installed |
@MarcoRossignoli As you knew before coverlet 1.2.0.0 returns on
--> So I do that with 1. Part Excluded module filter '[xunit*]*'
2. Part Calculating coverage result...
3. Part Generating report 'coverage.json' +--------------------------------------------------------------+------+--------+--------+
+---------+------+--------+--------+ To summarize: I think Part 2 and 3 of the log have nothing to do with my issue. But maybe the MSB4025 is related? If I open these particular UnitTest project ( |
Ok so I infer that this is a .NET framework project(no core) written in vb. |
@MarcoRossignoli One question for my general understanding. Which dll should be include for coverlet? All references I found inside the Project References? Is it important also include System References? Or should I only include the references which are the results from the imports of the test classes? Thanks a lot for your help. |
You should include only "your code" for instance suppose to have 3 project A,B,C that generates assemblies A.dll B.dll C.dll and suppose that B and C are libs and A is a WinForm project references B/C and System.Windows.Form(and other system libs). You've also a test project called D.dll. |
@MarcoRossignoli thanks a lot for you explanation, that helps a lot. I think I found something importent about this issue. First of all, I understand now that my particular UnitTest project only works with vstest/vstest.console. test or mstest fails and don't work. (I have a kind of an idea why, but it's hard to explain) so running running and that is exactly the feedback what I get, when I am running: so obviously |
I think you can try with
|
@MarcoRossignoli with: I get the error message (in red): after Step 1 I think. Coverlet intrument/exclude the dlls before Seems like |
Did some test on my repro...it works(missed .exe)
Remeber to build the test/solution before |
@MarcoRossignoli tears in my eyes. That was the missing part of the puzzle. Finally
Thanks for your patience, keep going for your great project. |
Glad to hear!Feel free to close the issue!
Credits goes to all contributors and to @tonerdo's idea. |
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:
for every single referenced assemblies that coverlet collect before:
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?
The text was updated successfully, but these errors were encountered: