-
Notifications
You must be signed in to change notification settings - Fork 389
Unable to get coverlet to work with vstest #595
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
If you cannot touch project dependency I propose to use .net tool and not collectors/msbuild. something like
|
BTW if you hit know issue https://github.com/tonerdo/coverlet/blob/master/Documentation/KnowIssues.md#1-vstest-stops-process-execution-earlydotnet-test using .net tool driver, you must use collectors. The approach you suggested is doable but ugly/fragile at the moment.
Runsettings(there is an open bug on vstest at the moment..so we need to specify inproc collector by hand microsoft/vstest#2205)
|
That night I thought that I might try to migrate all related projects to the new csproj format. This made |
I'm using
coverlet.msbuild
on several modernnetstandard2.0
nunit test projects. A simpledotnet test Some.csproj /p:CollectCoverage=true
together with smartDirectory.Build.Targets
like thiscreates SonarQube compatible coverage files. This works really well.
However, one of my test projects is ugly, has many dependencies (full net472 framework), and a ton of native libraries as a bonus. The tests are important, but I don't own the dependencies and the owners are very conservative - so I can't change this situation right now. In this case
dotnet test
doesn't work, butdotnet vstest
does work fine (and thevstest.console.exe
as well).Problem: I can't get coverlet to work with VSTest. Following coverlet's
Readme.md
I referencedcoverlet.collector
instead of its msbuild brother. Since I have to target adll
instead of a project, I have to build first. I'm using msbuild here, notdotnet publish
for the same reasonsdotnet test
doesn't work. Thendotnet vstest SomeUglyTest.dll
runs my tests as expected. However, all of the following attempts to collect coverage failed:dotnet vstest SomeUglyTest.dll --settings:coverletArgs.runsettings
(with a unmodified example from somewhere here in the repository) prints the warningData collection : Could not find data collector 'XPlat Code Coverage'
and obviously doesn't create any coverage output.dotnet vstest SomeUglyTest.dll --collect:"XPlat Code Coverage"
prints the same warning, no output file.related: #395 #190
vstest is very difficult to understand... but I think that it requires some kind of "collector.dll", which should be satisfied by referencing the
coverlet.collector
nuget package. However, just referencing the package does not mean msbuild will copy something tobin\debug\
. In fact, I haven't found such a dll.dotnet publish
might do things differently, but I can't use it.Any ideas?
The text was updated successfully, but these errors were encountered: