question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Threshold value not working

See original GitHub issue

Hi,

I just upgraded to the latest v1.1.0 GA build. I’m using the new /p:Threshold=80 option to the build process yet the test run still returns ‘successful’ even if the coverage is below the threshold.

This is the command I run to build:

dotnet test --configuration Release --logger ‘trx;logfilename=mstest-results.trx’ /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:CoverletOutputDirectory=TestResults /p:Threshold=80

This is the output:

Microsoft (R) Test Execution Command Line Tool Version 15.3.0-preview-20170628-02
Copyright (c) Microsoft Corporation.  All rights reserved.

Starting test execution, please wait...
[xUnit.net 00:00:01.5821864]   Discovering: UnitTests
[xUnit.net 00:00:01.7179983]   Discovered:  UnitTests
[xUnit.net 00:00:01.7245869]   Starting:    UnitTests
[xUnit.net 00:00:01.9276830]     AuthResponsesOperationFilter does not add 401 response to operation without AuthoriseAttribute [SKIP]
[xUnit.net 00:00:01.9282262]       Cannot yet mock ApiDescription objects
Skipped  AuthResponsesOperationFilter does not add 401 response to operation without AuthoriseAttribute
Standard Output Messages:
 Cannot yet mock ApiDescription objects
[xUnit.net 00:00:01.9862873]     AuthResponsesOperationFilter Adds 401 response to operation with AuthoriseAttribute [SKIP]
[xUnit.net 00:00:01.9863816]       Cannot yet mock ApiDescription objects
Skipped  AuthResponsesOperationFilter Adds 401 response to operation with AuthoriseAttribute
Standard Output Messages:
 Cannot yet mock ApiDescription objects
[xUnit.net 00:00:02.3872529]   Finished:    UnitTests

Total tests: 33. Passed: 31. Failed: 0. Skipped: 2.
Test Run Successful.
Test execution time: 3.8409 Seconds
WARNING: Overwriting results file: /home/jenkins/agent/workspace/an-updated-coverage-process-7N7FVRFUDPWSNYEY7B7OE6IM5VJ26KCY5NFVLTNHW4HURJ65KZAQ/tests/UnitTests/TestResults/mstest-results.trx
Results File: /home/jenkins/agent/workspace/an-updated-coverage-process-7N7FVRFUDPWSNYEY7B7OE6IM5VJ26KCY5NFVLTNHW4HURJ65KZAQ/tests/UnitTests/TestResults/mstest-results.trx

Calculating coverage result...
  Generating report 'TestResults/coverage.xml'

| Module                 | Coverage |
|------------------------|----------|
| ApplicationCore        | 75%      |
| Infrastructure         | 37.8%    |
| Nedbank.Authentication | 0%       |
| Web                    | 42.9%    |

Am I missing something or is this not working right now.

Also my build environment is:

Microsoft ® Build Engine version 15.3.409.57025 for .NET Core We’re running .NET Core 2.0 on Linux. (Install .NET Core SDK 2.1.104 Package)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9

github_iconTop GitHub Comments

1reaction
daveMuellercommented, Dec 21, 2022

@DhavalAlbiorix the issue with msbuild was fixed by the microsoft guys with sdk 7.0.101 that was released last week https://github.com/microsoft/vstest/issues/4014. I just checked it with a repro from another related issue and it works fine. Please give it a try again.

0reactions
petlicommented, Dec 15, 2022

@DhavalAlbiorix Sorry, I forgot about the threshold part, I was just thinking about the command line parameter passing. The vstest driver doesn’t support thresholds, you would need to extend the CI script to process the reports from coverlet with e.g. https://reportgenerator.io/ and check that in the script.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Log4net appender threshold not working
The Threshold is only used to set a lower limit on the level appended. A threshold of ERROR will actually receive ERROR and...
Read more >
Threshold value not working · Issue #48
Hi,. I just upgraded to the latest v1.1.0 GA build. I'm using the new /p:Threshold=80 option to the build process yet the test...
Read more >
Threshold value is not working properly in my code
setting dynamic threshold value in matlab, what i am finding, below threshold value also variables get dynamic memorry allocation.
Read more >
Action variable context.threshold doesn't work for warning ...
The issue I'm having is that condition0 always reports the alert threshold value not the warning threshold value. It should be 1 and...
Read more >
Unable to set threshold on Fiji - Usage & Issues
Hello! I am new to Fiji, and I am following a protocol where I am supposed to adjust the threshold of my TIF...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found