coverlet: Coverlet crashes VSTest
I’m getting errors when I’m trying to use the vstest integration to coverlet.
This is with the 2.2.300 SDK.
PS> dotnet test --no-build --no-restore --settings ..\CodeCoverage.runsettings --collect:"XPlat Code Coverage" -- RunConfiguration.DisableAppDomain=true
Test run for D:\dev\xUnit\visualstudio.xunit\test\test.xunit.runner.visualstudio\bin\Debug\net46\test.xunit.runner.visualstudio.dll(.NETFramework,Version=v4.6)
Microsoft (R) Test Execution Command Line Tool Version 16.1.1
Copyright (c) Microsoft Corporation. All rights reserved.
Starting test execution, please wait...
Attachments:
D:\dev\xUnit\visualstudio.xunit\test\test.xunit.runner.visualstudio\TestResults\730034da-8dc8-4a52-9bdf-db094514cf10\coverage.cobertura.xml
D:\dev\xUnit\visualstudio.xunit\test\test.xunit.runner.visualstudio\TestResults\730034da-8dc8-4a52-9bdf-db094514cf10\Oren_ATHENA_2019-06-25.16_25_17.coverage
Test Run Aborted.
To repro:
- clone https://github.com/xunit/visualstudio.xunit
- checkout the
coverletbranch - from a VS Command prompt, go to the
/test/test.xunit.runner.visualstudiodirectory - run
msbuild /restoreto build the test project (and the project it’s testing). You’ll need the Windows/UWP 16299 SDK installed to successfully build it. - From the same directory, run the following command
dotnet test --no-build --no-restore --settings ..\CodeCoverage.runsettings --collect:"XPlat Code Coverage" -- RunConfiguration.DisableAppDomain=true
It’ll start running the tests and then abort.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 16 (9 by maintainers)
@onovotny So I have looked at this. In your runsettings you define both data collectors “CodeCoverage” and “Xplat Code coverage” I tried both, and both of them are aborting the run. I don’t have an RCA on the CodeCoverage one but for xplat code coverage, here’s my analysis.
In test.xunit.runner.visualstudio, there’s a condition
This is causing it to refer to old objectmodel which does not work with coverlet. Getting this error when I looked at logs using
--diagoptionCan you try with updating the object model and disabling data collector for CodeCoverage and see if xplat code coverage works?
cc: @MarcoRossignoli
@MarcoRossignoli @onovotny I’ll try to repro the issue and get back.
I’m a bit confused since I was able to get the collector to work with .NET Framework with Ix Async:
https://dev.azure.com/dotnet/Rx.NET/_build/results?buildId=18615&view=logs&jobId=12f1170f-54f2-53f3-20dd-22fc7dff55f9&taskId=63465373-886e-5c09-88f2-acc826db3ddc&lineStart=59