-1

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


enter image description here

1 Answers1

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:

  1. Analysis the test result file (e.g. trx file in TestResults folder) through PowerShell or other script
  2. 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