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

时间秒杀一切 提交于 2021-01-28 11:22:43

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!