如何使用 ADO Rest API 获取特定构建中的测试列表 运行

How to use ADO Rest API to get the list of test run in a specific build

来自 ADO Rest API,https://docs.microsoft.com/en-us/rest/api/azure/devops/?view=azure-devops-rest-6.1,can 请告诉我如何获取特定构建的测试列表及其结果?

总而言之,我正在通过 REST API:

在特定构建的 'test' 选项卡中查找信息

首先,使用 Runs - Query api 并传递可选的构建 ID 以获取构建中的测试 运行 ID:

GET https://dev.azure.com/{organization}/{project}/_apis/test/runs?minLastUpdatedDate={minLastUpdatedDate}&maxLastUpdatedDate={maxLastUpdatedDate}&buildIds={buildIds}&api-version=6.0

然后用Results - Listapi得到测试的测试结果运行:

GET https://dev.azure.com/{organization}/{project}/_apis/test/Runs/{runId}/results?api-version=6.0