Skip to content

Unexpected Results for ThresholdStat=total #352

Closed
@leleSahil

Description

@leleSahil

I am trying to use the /p:ThresholdStat option to specify that the total coverage not dip below a certain number and I am seeing weird results

+----------------------------------------+--------+--------+--------+
| Module | Line | Branch | Method |
+----------------------------------------+--------+--------+--------+
| Module 1 | 26.1% | 21.6% | 46.6% |
+----------------------------------------+--------+--------+--------+
| Module 2 | 68.4% | 54.2% | 70.8% |
+----------------------------------------+--------+--------+--------+

/Users/sahil/.nuget/packages/coverlet.msbuild/2.3.0/build/netstandard2.0/coverlet.msbuild.targets(25,5): error : 'Module 1' has a method coverage '46.6%' below specified threshold '58%'

Here is the command I am using to run this:
dotnet test *********.csproj /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura /p:Threshold=58 /p:ThresholdType=method /p:ThresholdStat=total

The total method coverage definitely exceeds 58% is there something I am missing?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions