我正在Azure Devops中使用新的yaml管道。如何在管道运行的“测试摘要”页面中显示测试结果中的StdOut日志?
trigger:
- master
stages:
- stage: Tests
jobs:
- job: Tests
steps:
- script: dotnet test ./TestProject/ --logger "trx;LogFileName=TEST-results.trx"
- task: PublishTestResults@2
inputs:
testResultsFiles: '**/*.trx'
failTaskOnFailedTests: true
testResultsFormat: 'VSTest'
publishRunAttachments: true
testRunTitle: 'Test Results'
需要trx文件中的stdout出现在测试摘要页面中,如下例所示。
<?xml version="1.0" encoding="utf-8"?>
<TestRun xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
<Results>
<UnitTestResult>
<Output>
<StdOut>
Console logs appear here.
</StdOut>
</Output>
</UnitTestResult>
</Results>
</TestRun>