Azure DevOps 管道测试失败......但我如何轻松识别哪些测试?

Azure DevOps pipeline tests fail...but how can I easily identify which tests?

我的 Azure DevOps 构建管道中有一个 VSTest@2 步骤。

我在输出中得到以下内容:

 Results File:
 d:\a\_temp\TestResults\VssAdministrator_xx-az678_2020-02-25_18_50_38.trx
 Total tests: 7132
      Passed: 7108
      Failed: 2
     Skipped: 22
 ##[error]Test Run Failed.
....
##[warning]Vstest failed with error. Check logs for failures. There might be failed tests.
##[error]Error: The process 'd:\a\_tasks\VSTest_{SomeGuid}.165.2\Modules\DTAExecutionHost.exe' failed with exit code 1
##[error]Vstest failed with error. Check logs for failures. There might be failed tests.

好的,所以有两个测试失败了(总共 7,132 个)。据我所知,"Here are the two tests that failed" 没有任何帮助。输出量很大,需要

how can I easily identify which tests

对于此问题,您可以在测试 选项卡中查看测试报告。测试报告提供了一种有效且一致的方式来查看使用不同测试框架执行的测试结果,以衡量管道质量、审查可追溯性、排除故障并推动故障归属。

可以使用以下选项之一在“测试”选项卡中显示测试结果:

  • 自动推断测试结果。默认情况下,您的管道可以自动推断一些流行测试的测试输出 跑步者。这是通过解析在 构建操作,然后检查测试失败的签名。
  • 测试执行任务。内置测试执行任务,例如 Visual Studio Test 自动发布测试结果到 管道,或其他如 Ant、Maven、Gulp、Grunt 和 Xcode 提供此功能作为任务中的选项。
  • 发布测试结果任务。使用您选择的执行测试时将测试结果发布到 Azure Pipelines 或 TFS 的任务 跑步者,结果可在任何 支持的测试中获得 结果格式.
  • API(s)。使用Test Management API(s).
  • 直接发布测试结果

详情可以参考这篇document