azure-devops - 在哪里可以找到 Azure Devops 中失败的 VSTest 的日志?
问题描述
在 VNET 内的 Windows 2019 VM 中的托管代理上运行用于应用服务部署的 Azure Devops 管道。部署任务的最后一步是运行集成测试,但它因堆栈跟踪(microsoft callstack)而失败。
这是该步骤的 YAML:
steps:
- task: VSTest@2
displayName: 'Run Integration Tests'
inputs:
testAssemblyVer2: '$(System.DefaultWorkingDirectory)/_FooService pipeline/drop/output/FooServiceTests.Integration.dll'
这是最后一点 devops 日志
2020-09-25T01:00:48.0902607Z --- End of stack trace from previous location where exception was thrown ---
2020-09-25T01:00:48.0903591Z at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
2020-09-25T01:00:48.0904073Z at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
2020-09-25T01:00:48.0904563Z at Microsoft.VisualStudio.Services.WebApi.TaskExtensions.SyncResult[T](Task`1 task)
2020-09-25T01:00:48.0905027Z at Microsoft.VisualStudio.Services.WebApi.VssConnection.GetClient[T]()
2020-09-25T01:00:48.0905523Z at Microsoft.VisualStudio.TestService.RestApiHelpers.TcmTestExecutionServiceRestApiHelper..ctor(String project)
2020-09-25T01:00:48.0906060Z at MS.VS.TestService.VstestConsoleAdapter.VstestConsoleRunContext.InitializeRestApiHelper()
2020-09-25T01:00:48.0906556Z at MS.VS.TestService.VstestConsoleAdapter.VstestConsoleRunContext.CreateRunContext()
2020-09-25T01:00:48.0907032Z at MS.VS.TestService.VstestConsoleAdapter.VstestConsoleRunContext.get_Instance()
2020-09-25T01:00:48.0907540Z at Microsoft.VisualStudio.TestService.AgentExecutionHost.LocalTestRunHost.Execute(Boolean debugLogs)
2020-09-25T01:00:48.0908043Z at Microsoft.VisualStudio.TestService.AgentExecutionHost.Program.Main(String[] args)
2020-09-25T01:00:48.1629868Z ##[warning]Vstest failed with error. Check logs for failures. There might be failed tests.
2020-09-25T01:00:48.1631712Z ##[error]Error: The process 'C:\Users\TestAdmin\agent\_work\_tasks\VSTest_ed087383-ee5e-42c7-8a53-ab56c98420f9\2.170.1\Modules\DTAExecutionHost.exe' failed with exit code 3762504530
2020-09-25T01:00:48.1634275Z ##[error]Vstest failed with error. Check logs for failures. There might be failed tests.
我在哪里可以找到日志以显示有关测试失败原因的更多详细信息?
解决方案
事实证明,发布管道 URL 变量不正确,导致测试中的 http 客户端失败。最终不得不添加一些测试代码来使用 ITestOutputHelper 来记录 URL,这样我们就可以在测试失败时轻松查看服务 url。
推荐阅读
- javascript - 在 Wordpress 中将 URL 参数添加到 AJAX 过滤器
- json - 控制器中的 Groovy 到 Json
- ios - 如何将 Cocoa Touch 模板添加到 Xcode?
- azure-data-factory - REST API 中按工厂列出方法中的页面大小
- sql - SQL 数据库结构
- outlook - 如何将电话号码中的呼叫添加到现有的 Microsoft Teams 会议?
- php - 如何在新标签中打开 WooCommerce 中的可下载产品
- node.js - 在海拔 powershell 中执行命令
- azure - Azure 数据工厂 - 在存储事件触发器中使用 typeProperties 参数
- javascript - 试图将项目 ID 获取到我的另一个函数