【问题标题】:Error while executing Run Functional Test task in VSTS在 VSTS 中执行运行功能测试任务时出错
【发布时间】:2016-04-14 12:10:50
【问题描述】:

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

Visual Test Agent Deployment Task 用于在目标机器上部署 NUnit Test Agent。

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

代理部署任务正在成功执行,但在 “运行功能测试”并显示以下错误消息:

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 日志文件摘要:

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.

请帮忙。

【问题讨论】:

  • 测试能否在本地机器上成功执行?如果你从目标机器上运行测试手册,你能看到这个问题吗?
  • 它在开发机器上工作,但没有尝试在目标机器上运行它

标签: tfs nunit integration-testing release-management devops


【解决方案1】:

我们在尝试使用“运行功能测试”构建步骤从 MTM 测试计划运行测试方向时遇到了类似的问题,但引用了具有关联自动化的测试用例,该自动化与 NUnit 测试用例相关联。

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

为了解决此问题,作为在部署到远程测试代理计算机之前构建测试解决方案的一部分,我们为 NUntTestAdapter 包含了 NuGet 包。这应该下载以下 DLL:

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

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

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

从那时起,您应该能够直接在测试代理上从 vstest.console.exe 执行测试,而无需引用 /TestAdapterPath 或构建(因为它使用 vstest.console 作为“运行”的一部分功能测试”)将尝试使用该适配器来获取和运行 NUnit 测试。

【讨论】:

  • 这些是 nunit 2 的 NunitTestAdapter 文件,我已经尝试使用这些文件以及 Nuint3TestAdapter (v3.7.0) 的方法,但我仍然遇到相同的错误。还有其他可能引发错误的东西吗?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-03-06
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多