Vstest: Support Code coverage for embedded pdb

Created on 23 Aug 2018  路  7Comments  路  Source: microsoft/vstest

Description

No code coverage data collected on dotnet test --collect "Code Coverage"

Steps to reproduce

Add <DebugType>Embedded</DebugType> to default test project.

  <Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>netcoreapp2.1</TargetFramework>
    <DebugType>Embedded</DebugType>
    <IsPackable>false</IsPackable>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.8.0" />
    <PackageReference Include="MSTest.TestAdapter" Version="1.2.1" />
    <PackageReference Include="MSTest.TestFramework" Version="1.2.1" />
  </ItemGroup>

</Project>

  • Run dotnet test --collect "Code Coverage"

    Expected behavior

Code coverage data should be collected

Actual behavior

No code coverage data collected

enhancement

Most helpful comment

Any new information when this will be available?

All 7 comments

Fix for this planned in VS 16.0

/cc @VCZYK

How's this coming?

Ping? What SDK/NuGet version is this in?

Any new information when this will be available?

We are waiting for that too.

It is enough to install newer version of Microsoft.CodeCoverage:

dotnet add package Microsoft.CodeCoverage --version 16.7.0

I will make sure that dotnet also uses newer version of this package. Currently it is installing 16.5.

It's enough to upgrade Microsoft.NET.Test.Sdk to 16.7.0 in csproj.

Was this page helpful?
0 / 5 - 0 ratings