Azure Pipeline: How to save Visual Studio "Test Results" to use with other tasks in the pipeline?

Daniel Gomon 21 Reputation points
2021-02-28T16:00:01.753+00:00

Hello,
I have a pipeline with the task "Visual Studio Test", with task version "2.*"
After the task completes I can see that it prints in the log the test results:

**************** Completed test execution *********************
Result Attachments will be stored in LogStore
Publishing test results to test run '3528'.
TestResults To Publish 237, Test run id:3528
Test results publishing 237, remaining: 0. Test run id: 3528
Published test case results: 237
Result Attachments will be stored in LogStore
Run Attachments will be stored in LogStore
Received the command : Stop
TestExecutionHost.ProcessCommand. Stop Command handled
SliceFetch Aborted. Moving to the TestHostEnd phase
Please use this link to analyze the test run : https://dev.azure.com/----/---/_TestManagement/Runs#_a=resultQuery&runId=3528&queryPath=Recent+Run%2FRun3528
Test run '3528' is in 'Completed' state with 'Total Tests' : 237 and 'Passed Tests' : 221.

How can I save 'Total Tests' and 'Passed Tests' in variables to use with further tasks of the pipeline?
I tried extracting the .trx file but it gets deleted after the task completes.

Kind regards,
Daniel

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
36,982 questions
0 comments No comments
{count} votes

Accepted answer
  1. Dave Patrick 426.3K Reputation points MVP
    2021-03-14T13:19:32.217+00:00

2 additional answers

Sort by: Most helpful
  1. Dave Patrick 426.3K Reputation points MVP
    2021-02-28T16:26:26.503+00:00

    Devops / TFS is not currently supported here on QnA. The product group for Azure DevOps / TFS actively monitors questions over at
    https://developercommunity.visualstudio.com/spaces/21/index.html
    https://developercommunity.visualstudio.com/spaces/22/index.html

    --please don't forget to Accept as answer if the reply is helpful--


  2. Dave Patrick 426.3K Reputation points MVP
    2021-03-04T13:49:59.94+00:00

    Sounds like you just need to complete your profile over there.

    74381-image.png

    --please don't forget to Accept as answer if the reply is helpful--