在VSTS中执行运行功能测试任务时出错 [英] Error while executing Run Functional Test task in VSTS

查看:124
本文介绍了在VSTS中执行运行功能测试任务时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在VSTS 2015中,我们在使用NUnit测试框架的项目中构建和发布了管道设置。
我们正在尝试使用运行功能性任务配置集成测试用例执行,该任务的配置在以下屏幕截图中给出:

In VSTS 2015 we have build and release pipeline setup in a project which is using NUnit test framework. We are trying to configure Integration test case execution using "Run Functional Task" configuration of the task is given in the screenshot below:

Visual Test Agent部署任务用于在目标计算机中部署NUnit测试代理。

Visual Test Agent Deployment Task is used to Deploy the NUnit Test Agent in target machine.

在Target Machine中创建了一个文件夹,其中所有测试程序集都将被复制,即C:\TestDlls和NUnit适配器程序集C:\PIMPackages

There is a folder that is created in Target Machine where all test assemblies are getting copied i.e. C:\TestDlls and for NUnit Adapter assemblies C:\PIMPackages

代理部署任务已成功执行,但在
中中止了运行功能测试,并显示以下错误消息:

The Agent deployment task is getting executed successfully but it get aborted in "Run Functional Test" with below error message:

2016-04-14T09:51:08.0151865Z DistributedTests: Test run '65' is in 'Aborted' state.
2016-04-14T09:51:18.0177458Z ##[warning]DistributedTests: Test run is aborted. Logging details of the run logs.
2016-04-14T09:51:18.2601235Z ##[warning]DistributedTests: New test run created.
2016-04-14T09:51:18.2601235Z ##[warning]Test Run queued for Project Collection Build Service (deepaksoniv).
2016-04-14T09:51:18.2611323Z ##[warning]DistributedTests: Test discovery started.
2016-04-14T09:51:18.2621353Z ##[warning]DistributedTests: Test Run Discovery Aborted . Test run id : 65
2016-04-14T09:51:18.2631347Z ##[warning]DistributedTests: UnExpected error occured during test execution. Try again.
2016-04-14T09:51:18.2631347Z ##[warning]DistributedTests: Error : NUnit Adapter 3.0.8.0 discovering test is finished
2016-04-14T09:51:18.2641325Z ##[warning]DistributedTests: Test run aborted. Test run id: 65
2016-04-14T09:51:18.2681313Z ##[error]The test run was aborted, failing the task.

在已部署测试代理的目标计算机中,DTAEXecutionHost日志文件摘要:

In Target Machine where Test Agent is getting deployed the DTAEXecutionHost log file abstract:

V, 3780, 11, 2016/04/14, 09:50:57.073, PIMNEWVM\DTAExecutionHost, TestCaseFilter.GetTestPropertiesInTraitDictionary : Populating trait dictionary with test case properties.
V, 3780, 11, 2016/04/14, 09:50:57.073, PIMNEWVM\DTAExecutionHost, TestCaseFilter.GetTestPropertiesInTraitDictionary : Populating trait dictionary with test case 

-------------------------------------------------------------------------------------------------

[test] 8260 ms
V, 3780, 10, 2016/04/14, 09:51:00.401, PIMNEWVM\DTAExecutionHost, TestExecutionServiceCommandQueueListener:DispatchAsync
I, 3780, 10, 2016/04/14, 09:51:00.401, PIMNEWVM\DTAExecutionHost, ExecutionTaskStateModel.ListenerCommandReceived : Requesting a stop on Stop command.
I, 3780, 10, 2016/04/14, 09:51:00.401, PIMNEWVM\DTAExecutionHost, TestExecutionServiceCommandQueueListener.DispatchAsync : Stop listening on Stop command.
I, 3780, 9, 2016/04/14, 09:51:00.401, PIMNEWVM\DTAExecutionHost, ExecutionTaskStateModel.RunStateTransitionsAsync : The task was cancelled
I, 3780, 9, 2016/04/14, 09:51:00.416, PIMNEWVM\DTAExecutionHost, Removing agent setting 

-------------------------------------------------------------------------------------------------

I, 3780, 9, 2016/04/14, 09:51:00.416, PIMNEWVM\DTAExecutionHost, Removing agent setting DtlMachineName on agent machine - 64 bit hive
I, 3780, 9, 2016/04/14, 09:51:00.416, PIMNEWVM\DTAExecutionHost, Removed agent setting DtlMachineName on agent machine - 64 bit hive
I, 3780, 9, 2016/04/14, 09:51:00.416, PIMNEWVM\DTAExecutionHost, ExecutionHost.UnregisterFromServer : Agent is unregistering from server.

请帮助。

推荐答案

当尝试使用运行功能测试构建步骤从MTM测试计划运行测试方向时,遇到一个类似的问题,但所引用的测试用例具有与NUnit测试用例相关联的自动化功能。

We've run into a similar problem when trying to run tests direction from an MTM test plan using the "Run Functional Tests" build step but referencing test cases that had associated automation which linked to NUnit test cases.

似乎运行功能测试构建步骤是以某种方式在后端使用vstest.console.exe在测试代理上执行测试的。默认情况下,vstest.console不知道如何运行NUnit测试,如果从命令行运行,则将使用/ TestAdapterPath:。由于在构建中不可能做到这一点,因此我们需要vstest.console默认知道如何执行NUnit测试。

It appears that the "Run Functional Tests" build step is somehow using vstest.console.exe on the back end to execute the tests on the Test Agent. vstest.console by default does not know how to run NUnit tests and if running from the command line, one would use /TestAdapterPath:. Since this isn't possible from the build, we need vstest.console to know by default how to execute NUnit tests.

要解决此问题,这是构建的一部分在部署到远程Test Agent机器之前的测试解决方案中,我们为NUntTestAdapter提供了NuGet软件包。这应该下载以下DLL:

To work around this problem, as part of building the test solution before deploying to the remote Test Agent machine, we've included the NuGet package for the NUntTestAdapter. This should download the following DLLs:


  • nunit.core.dll

  • nunit.core.interfaces .dll

  • nunit.util.dll

  • NUnit.VisualStudio.TestAdapter.dl

  • nunit.core.dll
  • nunit.core.interfaces.dll
  • nunit.util.dll
  • NUnit.VisualStudio.TestAdapter.dl

然后,我们将这些DLL部署到远程计算机的以下位置:

We then deploy these DLLs to the remote machine to the following location:


C:\Program文件(x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\Extensions

C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\Extensions

从那时起,您应该能够直接在测试代理上从vstest.console.exe执行测试,而无需引用/ TestAdapterPath或构建(因为它是在运行功能测试中使用vstest.console的。 )将尝试使用该适配器进行并运行NUnit测试。

From that point on, you should be able to execute your tests from either vstest.console.exe directly on your test agent without having a reference to /TestAdapterPath or the build (since it's using vstest.console as part of "Run Functional Tests") will attempt to use that adapter to pickup and run NUnit tests.

这篇关于在VSTS中执行运行功能测试任务时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆