在Azure云中创建管道发布后触发测试自动化。测试执行完成后,无法在azure中看到测试结果。查看错误日志,因为TestResult.xml与'NUnit‘测试结果格式不匹配。
技术堆栈: C#、NUnit、Selenium、Azure
2019-11-11T07:48:53.6045046Z ##[section]Starting: UI: Publish Test Results **\*.xml
2019-11-11T07:48:53.6045046Z ==============================================================================
2019-11-11T07:48:53.6045046Z Task : Publish Test Results
2019-11-11T07:48:53.6045046Z Description : Publish test results to Azure Pipelines
2019-11-11T07:48:53.6045046Z Version : 2.158.0
2019-11-11T07:48:53.6045046Z Author : Microsoft Corporation
2019-11-11T07:48:53.6045046Z Help : [Learn more about this task](https://go.microsoft.com/fwlink/?LinkID=613742)
2019-11-11T07:48:53.6045046Z ==============================================================================
2019-11-11T07:48:54.3203486Z [command]"C:\Program Files\dotnet\dotnet.exe" --version
2019-11-11T07:48:54.4922262Z 2.2.108
2019-11-11T07:48:54.4922262Z [command]C:\Vsts\Agent-1\_work\_tasks\PublishTestResults_0b0f01ed-7dde-43ff-9cbb-e48954daf9b1\2.158.0\modules\TestResultsPublisher.exe @C:\Vsts\Agent-1\_work\_temp\b5ad22b0-0457-11ea-9e79-9db0871d9ecd.txt
2019-11-11T07:49:36.6438230Z ##[warning]Invalid results file. Make sure the result format of the file 'C:\TestAutomation\QA\TestResult.xml' matches 'NUnit' test results format.
2019-11-11T07:49:36.6438230Z ##[section]Async Command Start: Publish test results
2019-11-11T07:49:36.6438230Z ##[section]Async Command End: Publish test results
2019-11-11T07:49:36.6438230Z ##[section]Finishing: UI: Publish Test Results **\*.xml发布于 2019-11-18 18:10:03
不知道您是否在使用nunit@3。这是nunit@3的已知问题。VSTS目前不支持NUnit3格式。
你可以去投票,并跟踪它的here。
目前,您可以尝试使用Nunit-v2-reslut-writer的变通方法,或者添加一个powershell任务来运行上面的开放问题中建议的转换脚本。
https://stackoverflow.com/questions/58821609
复制相似问题