vstest控制台上的有序测试失败

时间:2018-10-31 16:51:01

标签: tfs automated-tests coded-ui-tests qa ordered-test

包含有序测试的项目将.NET Framework 4.6.1作为目标框架。 有序测试是使用vs2017进行的。

我使用TFS版本15.117.27414.0,其中有一个版本和一个发行版定义,可以将测试部署到测试环境中的计算机上。 包含我订购的测试的UItest项目由构建服务器上的构建代理进行构建。生成服务器使用Visual Studio Enterprise 2017版本15.7.6。

版本定义仅包含Visual Studio测试任务:

  • 选择了版本2
  • 使用测试程序集,其路径指向我的.orderedtest文件。
  • 检查包含UI测试的测试组合。
  • 测试平台版本与2017年相比

运行此测试的测试代理已安装在我的测试环境中的计算机上,并配置为运行UI测试。

以下是发布版本后来自TFS的日志:

##[section]Starting: VSTest - Test assemblies
==============================================================================
Task         : Visual Studio Test
Description  : Run tests with Visual Studio test runner
Version      : 2.0.55
Author       : Microsoft Corporation
Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=835764)
==============================================================================
Run the tests locally using vstest.console.exe
========================================================
Test selector : Test assemblies
Test assemblies : Deploy and Distributed Test-CI\drop\completeRun.orderedtest
Test filter criteria : null
Search folder : C:\agent\_work\r1\a
Run settings file : C:\agent\_work\r1\a
Run in parallel : false
Run in isolation : false
Path to custom adapters : null
Other console options : null
Code coverage enabled : false
VisualStudio version selected for test execution : 15.0
[command]powershell -NonInteractive -ExecutionPolicy Unrestricted -file C:\agent\_work\_tasks\VSTest_ef087383-ee5e-42c7-9a53-ab56c98420f9\2.0.55\vs15Helper.ps1
<Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04">
  <S>C:\Program Files (x86)\Microsoft Visual Studio\2017\TestAgent</S>
</Objs>
[command]wmic datafile where "name='C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\TestAgent\\Common7\\IDE\\CommonExtensions\\Microsoft\\TestWindow\\vstest.console.exe'" get Version /Value

Version=15.0.27924.0 


Version=15.0.27924.0

========================================================
[command]"C:\Program Files (x86)\Microsoft Visual Studio\2017\TestAgent\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" "C:\agent\_work\r1\a\Deploy and Distributed Test-CI\drop\completeRun.orderedtest" /logger:trx "/TestAdapterPath:\"C:\agent\_work\r1\a\""
Microsoft (R) Test Execution Command Line Tool Version 15.8.0
Copyright (c) Microsoft Corporation.  All rights reserved.

Starting test execution, please wait...
An exception occurred while invoking executor 'executor://orderedtestadapter/v1': Method not found: 'Void Microsoft.VisualStudio.TestTools.Common.TestRunConfiguration.AddTestSettingsProperties(System.Collections.Generic.Dictionary`2<System.String,System.Object>)'.

Test Run Failed.
##[warning]Vstest failed with error. Check logs for failures. There might be failed tests.
##[error]Error: C:\Program Files (x86)\Microsoft Visual Studio\2017\TestAgent\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe failed with return code: 1
##[warning]No results found to publish.
##[error]Vstest exited with return code: 1.
##[section]Finishing: VSTest - Test assemblies
##[section]Finishing: Release

我已经在线搜索了此异常,但是到目前为止没有发现任何有用的信息。我尝试使用该计算机上的vstest控制台直接在测试计算机上运行有序测试,但结果却相同。所以我认为我的构建和发布定义还可以。

更新:

我将目标.net框架更改为.net 4.5,因为vstest.console.exe并未提及.net framework 4.6.1作为目标框架的参数。这没有帮助。 我发现我可以在开发机上通过vstest控制台运行有序测试,因此我正在考虑在测试机上缺少DLL的方向。请注意,测试计算机上未安装vs2017。

1 个答案:

答案 0 :(得分:0)

很显然,安装在远程计算机上的远程调试器引起了麻烦。 卸载后,vstest控制台能够播放我订购的测试。 应该使用最新版本的远程调试器解决此问题。

Microsoft开发人员社区论坛上的这篇文章导致此解决方案: https://developercommunity.visualstudio.com/content/problem/169183/coded-ui-cant-run-test-in-vs-enterprise-2017-1552.html

相关问题