问题
From the ADO Rest API, https://docs.microsoft.com/en-us/rest/api/azure/devops/?view=azure-devops-rest-6.1,can you please tell me how can I get the list of tests and their results of a specific build?
In summary, I am looking for the information in 'test' tab of a particular build via REST API:
回答1:
First, use Runs - Query api and pass the optional build id to get the test run ID in the build:
GET https://dev.azure.com/{organization}/{project}/_apis/test/runs?minLastUpdatedDate={minLastUpdatedDate}&maxLastUpdatedDate={maxLastUpdatedDate}&buildIds={buildIds}&api-version=6.0
Then use Results - List api to get the test results of the test run:
GET https://dev.azure.com/{organization}/{project}/_apis/test/Runs/{runId}/results?api-version=6.0
来源:https://stackoverflow.com/questions/65299846/how-to-use-ado-rest-api-to-get-the-list-of-test-run-in-a-specific-build