TFS 功能测试仅在用户登录到测试框时运行



我正在尝试将WPF应用程序功能测试集成到TFS CI中,这仅部分有效。

在 TFS 生成定义中,有步骤Visual Studio Test Agent DeploymentRun Functional Tests。代理配置为作为交互式进程运行。只有当有人登录到测试服务器并实际看到屏幕时,一切才有效。从服务器注销后,CI 将卡在Deploy TestAgent步骤的任务ConfigureTestAgent上(请参阅下面的日志(。

代理使用与 RDP 到测试框相同的凭据运行。那里到底是什么失败了 - 与 TFS 服务器的通信或其他东西?

功能测试卡在以下控制台日志中:

Starting task: Deploy TestAgent on dpp02
******************************************************************************
Executing the powershell script: c:AgenttasksDeployVisualStudioTestAgent1.0.25DeployTestAgent.ps1
DistributedTests: Starting to deploy and configure test agent on test machines.
DistributedTests: Inputs provided are:
DistributedTests: Username: tsaak
DistributedTests: Use HTTP Port: True
DistributedTests: Run as process: True
DistributedTests: Login Automatically: True
DistributedTests: Disable Screen saver: True
DistributedTests: Agent would be downloaded from http://go.microsoft.com/fwlink/?LinkId=615472
DistributedTests: Update test agent: True
DistributedTests: Run test agent as DataCollection only : False
DistributedTests: Path to script that installs test agent on remote machine: C:AgenttasksDeployVisualStudioTestAgent1.0.25TestAgentInstall.ps1
DistributedTests: Path to script that configures test agent on remote machine: C:AgenttasksDeployVisualStudioTestAgent1.0.25TestAgentConfiguration.ps1
DistributedTests: Path to script that downloads test agent on azure remote machines : C:AgenttasksDeployVisualStudioTestAgent1.0.25DownloadTestAgent.ps1
DistributedTests: Path to script that checks if test agent is installed on remote machine: C:AgenttasksDeployVisualStudioTestAgent1.0.25CheckTestAgentInstallation.ps1
DistributedTests: Path to script that checks if test agent is already running on remote machine: C:AgenttasksDeployVisualStudioTestAgent1.0.25VerifyTestMachinesAreInUse.ps1
DistributedTests: Task 'VerifyTestMachinesAreInUse' on machine 'dpp02:5985' is being run
DistributedTests: Task 'VerifyTestMachinesAreInUse' on machine 'dpp02:5985' completed.
DistributedTests: Starting to download testagent
DistributedTests: testagent is downloaded at: C:UsersaakAppDataLocalTemp34b091f9-093d-46cd-8635-3a1164d777fe
DistributedTests: Task 'CopyFilesToTestAgent' on machine 'dpp02:5985' is being run
DistributedTests: Task 'CopyFilesToTestAgent' on machine 'dpp02:5985' completed.
DistributedTests: Task 'DeployTestAgent' on machine 'dpp02:5985' is being run
DistributedTests: Task 'DeployTestAgent' on machine 'dpp02:5985' completed.
DistributedTests: Task 'ConfigureTestAgent' on machine 'dpp02:5985' is being run
DistributedTests: Task 'ConfigureTestAgent' on machine 'dpp02:5985' is taking time. Please Wait
DistributedTests: Task 'ConfigureTestAgent' on machine 'dpp02:5985' is taking time. Please Wait
DistributedTests: Task 'ConfigureTestAgent' on machine 'dpp02:5985' is taking time. Please Wait
DistributedTests: Task 'ConfigureTestAgent' on machine 'dpp02:5985' is taking time. Please Wait
DistributedTests: Task 'ConfigureTestAgent' on machine 'dpp02:5985' is taking time. Please Wait
DistributedTests: Task 'ConfigureTestAgent' on machine 'dpp02:5985' is taking time. Please Wait
DistributedTests: Task 'ConfigureTestAgent' on machine 'dpp02:5985' is taking time. Please Wait
DistributedTests: Task 'ConfigureTestAgent' on machine 'dpp02:5985' is taking time. Please Wait
DistributedTests: Task 'ConfigureTestAgent' on machine 'dpp02:5985' is taking time. Please Wait
DistributedTests: Task 'ConfigureTestAgent' on machine 'dpp02:5985' is taking time. Please Wait
DistributedTests: Task 'ConfigureTestAgent' on machine 'dpp02:5985' is taking time. Please Wait
DistributedTests: Task 'ConfigureTestAgent' on machine 'dpp02:5985' is taking time. Please Wait

DTAExecutionHost.exe.log 具有以下内容:

V, 7096, 16, 2017/08/09, 17:52:52.016, DPP02DTAExecutionHost, TestExecutionServiceCommandQueueListener:DispatchAsync
I, 7096, 16, 2017/08/09, 17:52:52.017, DPP02DTAExecutionHost, ExecutionTaskStateModel.ListenerCommandReceived : Requesting a stop on Stop command.
I, 7096, 16, 2017/08/09, 17:52:52.017, DPP02DTAExecutionHost, TestExecutionServiceCommandQueueListener.DispatchAsync : Stop listening on Stop command.
I, 7096, 6, 2017/08/09, 17:52:52.017, DPP02DTAExecutionHost, ExecutionTaskStateModel.RunStateTransitionsAsync : The task was cancelled
I, 7096, 6, 2017/08/09, 17:52:52.022, DPP02DTAExecutionHost, Removing agent setting RegisteredAgentIdOnTfs on agent machine
I, 7096, 6, 2017/08/09, 17:52:52.022, DPP02DTAExecutionHost, Removing agent setting RegisteredAgentIdOnTfs on agent machine - 32 bit hive
I, 7096, 6, 2017/08/09, 17:52:52.022, DPP02DTAExecutionHost, Removed agent setting RegisteredAgentIdOnTfs on agent machine - 32 bit hive
I, 7096, 6, 2017/08/09, 17:52:52.022, DPP02DTAExecutionHost, Removing agent setting RegisteredAgentIdOnTfs on agent machine - 64 bit hive
I, 7096, 6, 2017/08/09, 17:52:52.022, DPP02DTAExecutionHost, Removed agent setting RegisteredAgentIdOnTfs on agent machine - 64 bit hive
I, 7096, 6, 2017/08/09, 17:52:52.022, DPP02DTAExecutionHost, Removing agent setting TfsUrl on agent machine
I, 7096, 6, 2017/08/09, 17:52:52.022, DPP02DTAExecutionHost, Removing agent setting TfsUrl on agent machine - 32 bit hive
I, 7096, 6, 2017/08/09, 17:52:52.023, DPP02DTAExecutionHost, Removed agent setting TfsUrl on agent machine - 32 bit hive
I, 7096, 6, 2017/08/09, 17:52:52.023, DPP02DTAExecutionHost, Removing agent setting TfsUrl on agent machine - 64 bit hive
I, 7096, 6, 2017/08/09, 17:52:52.023, DPP02DTAExecutionHost, Removed agent setting TfsUrl on agent machine - 64 bit hive
I, 7096, 6, 2017/08/09, 17:52:52.023, DPP02DTAExecutionHost, Removing agent setting DtlEnvUrl on agent machine
I, 7096, 6, 2017/08/09, 17:52:52.023, DPP02DTAExecutionHost, Removing agent setting DtlEnvUrl on agent machine - 32 bit hive
I, 7096, 6, 2017/08/09, 17:52:52.023, DPP02DTAExecutionHost, Removed agent setting DtlEnvUrl on agent machine - 32 bit hive
I, 7096, 6, 2017/08/09, 17:52:52.023, DPP02DTAExecutionHost, Removing agent setting DtlEnvUrl on agent machine - 64 bit hive
I, 7096, 6, 2017/08/09, 17:52:52.023, DPP02DTAExecutionHost, Removed agent setting DtlEnvUrl on agent machine - 64 bit hive
I, 7096, 6, 2017/08/09, 17:52:52.023, DPP02DTAExecutionHost, Removing agent setting DtlMachineName on agent machine
I, 7096, 6, 2017/08/09, 17:52:52.023, DPP02DTAExecutionHost, Removing agent setting DtlMachineName on agent machine - 32 bit hive
I, 7096, 6, 2017/08/09, 17:52:52.023, DPP02DTAExecutionHost, Removed agent setting DtlMachineName on agent machine - 32 bit hive
I, 7096, 6, 2017/08/09, 17:52:52.024, DPP02DTAExecutionHost, Removing agent setting DtlMachineName on agent machine - 64 bit hive
I, 7096, 6, 2017/08/09, 17:52:52.024, DPP02DTAExecutionHost, Removed agent setting DtlMachineName on agent machine - 64 bit hive
I, 7096, 6, 2017/08/09, 17:52:52.024, DPP02DTAExecutionHost, ExecutionHost.UnregisterFromServer : Agent is unregistering from server.
Web method running: [http://tfs01:8080/tfs/XRX%20Projects/_apis/test/Agents/33] (DELETE)33[test]
Web method response: [http://tfs01:8080/tfs/XRX%20Projects/_apis/test/Agents/33] (DELETE)33[test] 43 ms
I, 312, 1, 2017/08/09, 17:55:23.897, 24814877456, DTAExecutionHost.exe, Main.TryReadAndCacheVssCredentials Acquiring the Token Info
I, 312, 1, 2017/08/09, 17:55:23.916, 24814914498, DTAExecutionHost.exe, Communicating to the Token Servicehttp://tfs01:8080/tfs/XRX%20Projects
W, 312, 1, 2017/08/09, 17:55:23.998, 24815107475, DTAExecutionHost.exe, Service task failed. Retry attempt 10.
I, 2324, 1, 2017/08/09, 17:59:39.692, 467469870, DTAExecutionHost.exe, Main.TryReadAndCacheVssCredentials Acquiring the Token Info
I, 2324, 1, 2017/08/09, 17:59:39.723, 467537817, DTAExecutionHost.exe, Communicating to the Token Servicehttp://tfs01:8080/tfs/XRX%20Projects
I, 3240, 1, 2017/08/09, 18:02:03.753, 382139782, DTAExecutionHost.exe, Main.TryReadAndCacheVssCredentials Acquiring the Token Info
I, 3240, 1, 2017/08/09, 18:02:03.769, 382166680, DTAExecutionHost.exe, Communicating to the Token Servicehttp://tfs01:8080/tfs/XRX%20Projects
I, 1288, 1, 2017/08/09, 18:06:12.974, 462638694, DTAExecutionHost.exe, Main.TryReadAndCacheVssCredentials Acquiring the Token Info
I, 1288, 1, 2017/08/09, 18:06:12.990, 462666317, DTAExecutionHost.exe, Communicating to the Token Servicehttp://tfs01:8080/tfs/XRX%20Projects
I, 3908, 1, 2017/08/09, 18:08:09.827, 238326434, DTAExecutionHost.exe, Main.TryReadAndCacheVssCredentials Acquiring the Token Info

当计算机上的组策略重置测试执行所需的自动登录注册表项,而部署测试代理步骤尝试设置此注册表项时,通常会发生此问题。

为了使测试代理以交互方式运行,我们需要在盒子上有一个有效的用户会话,如果该会话不存在,则通过自动登录创建该会话。

因此,请检查您是否为测试计算机启用了自动登录,或者是否有任何组策略限制自动登录。

请尝试以下操作以缩小问题范围:

  1. 如果您之前已成功执行测试,请尝试 重新启动测试计算机,并取消选中"更新测试代理"下的 ">高级"(默认情况下处于选中状态并强制重新安装 TA( 每次(。

  2. 如果之前未执行,可以尝试下载测试代理 2015,然后手动将其安装在该计算机上并检查结果。

如果这不起作用,请尝试:

  • 配置为服务并使用(如果这是一个选项(。
  • 要求 IT 管理员禁用有关自动登录的域策略 用于您的测试机器。

另一方面,您可以尝试找到另一台测试计算机来测试是否可以在其上很好地部署测试代理。

最新更新