Skip to content

Coverlet with MTP 2 doesn't show test coverage statistic in console #1907

@vadim-96

Description

@vadim-96

Describe the bug
The coverlet 10 with MTP 2 (xunit.v3.mtp-v2 v3.2.2) doesn't show any information about test coverage in console after dotnet test.
But the coverlet.msbuild 10 without mtp (xunit.v3 v3.2.2) shows the coverage information in console.

To Reproduce
Run commands on any test project:
dotnet test --project ./tests.csproj --no-restore --coverlet --coverlet-exclude-assemblies-without-sources MissingAll --coverlet-output-format teamcity
OR
dotnet test --project ./tests.csproj /p:CollectCoverage=true /p:CoverletOutputFormat=teamcity /p:ExcludeAssembliesWithoutSources=MissingAll

Expected behavior
Expect coverage results in console.

Actual behavior
No reports from the coverlet in console.

Configuration:
csproj:

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

  <PropertyGroup>
    <TargetFramework>net10.0</TargetFramework>
    <OutputType>Exe</OutputType>
    <LangVersion>latest</LangVersion>
    <UseMicrosoftTestingPlatformRunner>true</UseMicrosoftTestingPlatformRunner>
    <Nullable>enable</Nullable>
    <IsPackable>false</IsPackable>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="coverlet.MTP" Version="10.0.0" />
    <PackageReference Include="Microsoft.Testing.Platform" Version="2.2.1" />
    <PackageReference Include="Moq" Version="4.20.72" />
    <PackageReference Include="xunit.v3.mtp-v2" Version="3.2.2" />
  </ItemGroup>
  
</Project>

global.json:

{
    "test": {
        "runner": "Microsoft.Testing.Platform"
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    driver-MTPIssue related to Microsoft Testing Platform driverquestionThis issue is a question

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions