在哪里可以找到 Azure Devops 中失败的 VSTest 的日志?
Where to find logs for failed VSTest in Azure Devops?
在 VNET 内的 Windows 2019 VM 中的托管代理上有用于应用服务部署的 Azure Devops 管道 运行ning。部署任务的最后一步是 运行 集成测试,但由于无用的堆栈跟踪(微软调用堆栈)而失败。
这是该步骤的 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.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。
在 VNET 内的 Windows 2019 VM 中的托管代理上有用于应用服务部署的 Azure Devops 管道 运行ning。部署任务的最后一步是 运行 集成测试,但由于无用的堆栈跟踪(微软调用堆栈)而失败。
这是该步骤的 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.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。