如何使用自定义构建任务扩展将测试结果文件添加到 vtsts 构建

How to add test result file to vtsts build using custom build task extension

我是 VSTS 的新手,在线资源对我应该从哪里开始帮助不大。

VSTS 中的 REST API 支持 updating a build. You can use PAT (Personal Access Token) to authenticate with the VSTS REST API. But if you are running script with build to access REST API you can just enable "" 您可以使用 PowerShell 并使用 rest API 调用请求来更新 VSTS 中的许多内容(使用 PowerShell Invoke-RestMethod)。要获取构建中的当前构建号等,您可以使用 build variables,如下所示。

$collectionUri = $Env:SYSTEM_TEAMFOUNDATIONCOLLECTIONURI
$TeamProject = $Env:SYSTEM_TEAMPROJECT
$BuildName = $Env:BUILD_DEFINITIONNAME
$BuildId = $Env:BUILD_BUILDID
$BuildNumber = $Env:BUILD_BUILDNUMBER