.Net Build is not failing when the test coverage is low using Coverlet

joymon's Avatar

joymon

29 Jan, 2020 10:54 PM

Hi There,
I am trying to fail my build in below project
https://ci.appveyor.com/project/joymon/dotnet-helpers

I am using the below command. When I try locally it works as usual. But from the AppVeyor it is not failing. There is only a message saying"has a line coverage '92.9%' below specified threshold '100%'"

dotnet test "DotNet.Helpers.Tests\DotNet.Helpers.Tests.csproj" /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Threshold=100 /p:ThresholdType=line --configuration Debug --no-build

This issue seems there in Azure DevOps too. There they use a Task but not sure how to get the same working in AppVeyor

I appreciate any help with this.
Joy George

  1. 1 Posted by joymon on 31 Jan, 2020 01:09 AM

    joymon's Avatar

    I was able to fail the build on low coverage by manually failing it.
    Below post was helpful.

    https://help.appveyor.com/discussions/problems/4498-powershell-exception-in-test_script-does-not-fail-build

    This issue can be closed

  2. Support Staff 2 Posted by Feodor Fitsner on 31 Jan, 2020 01:10 AM

    Feodor Fitsner's Avatar

    Hi Joy,

    This is the right approach. Thanks for the update!

  3. Feodor Fitsner closed this discussion on 03 Apr, 2020 06:47 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac