I want to check test cases passed(highlighted in below snap) value and compare with some threshold and if test case passed value is more than threshold then run next task from build
Asked
Active
Viewed 553 times
-1

Himalay Kondekar
- 146
- 14
-
1Have you tried looking in the VSTS Marketplace yet for a task do what you are looking for? https://marketplace.visualstudio.com/vsts – tj-cappelletti Feb 24 '18 at 13:23
-
@DanielMann The goal is the set custom condition in build definition to check test cases pass percentage up to the threshold. – Himalay Kondekar Feb 25 '18 at 03:31
-
@virusstorm I will check in Marketplace extension – Himalay Kondekar Feb 25 '18 at 03:32
1 Answers
1
There isn’t the built-in variable that can get the details of test result.
There are some ways can do it during the build:
- Analysis the test result file (e.g. trx file in TestResults folder) through PowerShell or other script
- Retrieve the test run through Test Run REST API with buildUri (format like
vstfs:///Build/Build/{build id}
filter, then get the necessary information (e.g. totoalTests, passedTests)
After that, you can set the variable value through Logging Command (##vso[task.setvariable]value
)

starian chen-MSFT
- 33,174
- 2
- 29
- 53