“如何使用 TFS 2018 API 从特定版本获取测试运行 ID" [英] "How to get test run id from a specific release using TFS 2018 API"

查看:19
本文介绍了“如何使用 TFS 2018 API 从特定版本获取测试运行 ID"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的发布管道中有一个运行 Seleniumtests(Visual Studio 测试任务)的任务.selenium 测试运行,我们可以在运行后手动向测试运行添加附件.我们还设法添加了带有 api 的附件,但我们没有一个很好的方法来提取上传所需的 testrunid.

We have a task in our release pipeline that runs Seleniumtests(Visual studio test task). The selenium tests run and we can after the run add an attachment to the testrun manually. We also manage to add an attachment with the api but we don't have a good way to extract the testrunid that is necessary for the upload.

我们如何以一种好的方式从发布中获取测试运行 ID,以便我们可以将附件绑定到正确的测试运行.我们只设法使用 api 进行所有测试运行,这很多.

How do we in a good way get the test run id from a release so we can bind the attachment to the right testrun. We only manage to get all test runs with the api, which is alot.

我们希望使用 api 上传附件的位置

推荐答案

您可以从特定版本的测试日志中查看测试运行 ID.

You can see test run id from the test log for a specific release.

因此,最简单的方法是使用 REST API 从日志中获取特定的测试运行 ID.

So, the simplest way is getting the specific test run id with the REST API from the log.

GET https://{instance}/{project}/_apis/release/releases/{releaseId}/environments/{environmentId}/deployPhases/{releaseDeployPhaseId}/tasks/{taskId}/logs?api-version={version}

参见获取任务日志 了解详情.

编辑 获取任务日志 v5

这篇关于“如何使用 TFS 2018 API 从特定版本获取测试运行 ID"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆