我们正在构建一个设置,在构建应用程序时将统计信息发送到外部服务器。有以下包含几个步骤的构建配置。
- 第一步构建应用程序并运行单元测试。
- 结果,创建了一组 xml 文件(nUnit 运行的结果)
- 第二步发布消息
Write-Host "##teamcity[importData type='nunit' path='%report.monitoring.rules%' parseOutOfDate='true' verbose='true']"
以处理它们 - 第三步需要从测试运行中访问统计信息。通过变量或 REST api。现在使用以下调用请求它
Invoke-WebRequest -uri http://[host]/httpAuth/app/rest/builds/id:$buildId/statistics -Credential $creds -Headers @{"accept"="application/json"}
问题是在第三步中,即使添加了暂停,我也无法获得统计信息。但是,一旦构建完成,就会出现统计信息(例如响应中的这一行
<property name="TotalTestCount" value="2"/>
)
问题:是否可以在构建期间访问有关测试运行的信息?