'Get build/release specific test results from Azure Devops in C#

I'm trying to write little WinForms application that will list names of all the automated unit-tests that have failed in our nightly runs, so we can then run another release using only those tests.

What we have:

  • Azure DevOps 2019 (?)
  • pipeline/build(s) that is executed in our build PC each night
  • when the build has finished, several (7 - 8?) releases/environments (separate test PC) are triggered and they will use binaries/artifacts from the build
  • each of those releases/environments will execute unit-tests

What I have:

  • I'm using Microsoft.TeamFoundationServer.ExtendedClient nuGet
  • I can select the TFS project using TeamProjectPicker
  • I can select build/pipeline
  • I can select release

But then I hit the wall. I tried to use TestManagementHttpClient.GetTestResultsByBuildAsync2 but it didn't return anything.

I guess I should somehow enumerate all the releases in specific build?!? How on earth I do that? Documentation for the nuget...well let's just say that it could be better. And the gitHub sample code repo for the TFS client didn't seem to contains anything useful.

Cheers and thank you



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source