2017-08-09 73 views
0

我正在嘗試將WPF應用程序功能測試集成到TFS CI中,並且這隻能部分工作。只有當用戶登錄到測試框時才運行TFS功能測試

在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:\Agent\tasks\DeployVisualStudioTestAgent\1.0.25\DeployTestAgent.ps1 
DistributedTests: Starting to deploy and configure test agent on test machines. 
DistributedTests: Inputs provided are: 
DistributedTests: Username: ts\aak 
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:\Agent\tasks\DeployVisualStudioTestAgent\1.0.25\TestAgentInstall.ps1 
DistributedTests: Path to script that configures test agent on remote machine: C:\Agent\tasks\DeployVisualStudioTestAgent\1.0.25\TestAgentConfiguration.ps1 
DistributedTests: Path to script that downloads test agent on azure remote machines : C:\Agent\tasks\DeployVisualStudioTestAgent\1.0.25\DownloadTestAgent.ps1 
DistributedTests: Path to script that checks if test agent is installed on remote machine: C:\Agent\tasks\DeployVisualStudioTestAgent\1.0.25\CheckTestAgentInstallation.ps1 
DistributedTests: Path to script that checks if test agent is already running on remote machine: C:\Agent\tasks\DeployVisualStudioTestAgent\1.0.25\VerifyTestMachinesAreInUse.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:\Users\aak\AppData\Local\Temp\34b091f9-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, DPP02\DTAExecutionHost, TestExecutionServiceCommandQueueListener:DispatchAsync 
I, 7096, 16, 2017/08/09, 17:52:52.017, DPP02\DTAExecutionHost, ExecutionTaskStateModel.ListenerCommandReceived : Requesting a stop on Stop command. 
I, 7096, 16, 2017/08/09, 17:52:52.017, DPP02\DTAExecutionHost, TestExecutionServiceCommandQueueListener.DispatchAsync : Stop listening on Stop command. 
I, 7096, 6, 2017/08/09, 17:52:52.017, DPP02\DTAExecutionHost, ExecutionTaskStateModel.RunStateTransitionsAsync : The task was cancelled 
I, 7096, 6, 2017/08/09, 17:52:52.022, DPP02\DTAExecutionHost, Removing agent setting RegisteredAgentIdOnTfs on agent machine 
I, 7096, 6, 2017/08/09, 17:52:52.022, DPP02\DTAExecutionHost, Removing agent setting RegisteredAgentIdOnTfs on agent machine - 32 bit hive 
I, 7096, 6, 2017/08/09, 17:52:52.022, DPP02\DTAExecutionHost, Removed agent setting RegisteredAgentIdOnTfs on agent machine - 32 bit hive 
I, 7096, 6, 2017/08/09, 17:52:52.022, DPP02\DTAExecutionHost, Removing agent setting RegisteredAgentIdOnTfs on agent machine - 64 bit hive 
I, 7096, 6, 2017/08/09, 17:52:52.022, DPP02\DTAExecutionHost, Removed agent setting RegisteredAgentIdOnTfs on agent machine - 64 bit hive 
I, 7096, 6, 2017/08/09, 17:52:52.022, DPP02\DTAExecutionHost, Removing agent setting TfsUrl on agent machine 
I, 7096, 6, 2017/08/09, 17:52:52.022, DPP02\DTAExecutionHost, Removing agent setting TfsUrl on agent machine - 32 bit hive 
I, 7096, 6, 2017/08/09, 17:52:52.023, DPP02\DTAExecutionHost, Removed agent setting TfsUrl on agent machine - 32 bit hive 
I, 7096, 6, 2017/08/09, 17:52:52.023, DPP02\DTAExecutionHost, Removing agent setting TfsUrl on agent machine - 64 bit hive 
I, 7096, 6, 2017/08/09, 17:52:52.023, DPP02\DTAExecutionHost, Removed agent setting TfsUrl on agent machine - 64 bit hive 
I, 7096, 6, 2017/08/09, 17:52:52.023, DPP02\DTAExecutionHost, Removing agent setting DtlEnvUrl on agent machine 
I, 7096, 6, 2017/08/09, 17:52:52.023, DPP02\DTAExecutionHost, Removing agent setting DtlEnvUrl on agent machine - 32 bit hive 
I, 7096, 6, 2017/08/09, 17:52:52.023, DPP02\DTAExecutionHost, Removed agent setting DtlEnvUrl on agent machine - 32 bit hive 
I, 7096, 6, 2017/08/09, 17:52:52.023, DPP02\DTAExecutionHost, Removing agent setting DtlEnvUrl on agent machine - 64 bit hive 
I, 7096, 6, 2017/08/09, 17:52:52.023, DPP02\DTAExecutionHost, Removed agent setting DtlEnvUrl on agent machine - 64 bit hive 
I, 7096, 6, 2017/08/09, 17:52:52.023, DPP02\DTAExecutionHost, Removing agent setting DtlMachineName on agent machine 
I, 7096, 6, 2017/08/09, 17:52:52.023, DPP02\DTAExecutionHost, Removing agent setting DtlMachineName on agent machine - 32 bit hive 
I, 7096, 6, 2017/08/09, 17:52:52.023, DPP02\DTAExecutionHost, Removed agent setting DtlMachineName on agent machine - 32 bit hive 
I, 7096, 6, 2017/08/09, 17:52:52.024, DPP02\DTAExecutionHost, Removing agent setting DtlMachineName on agent machine - 64 bit hive 
I, 7096, 6, 2017/08/09, 17:52:52.024, DPP02\DTAExecutionHost, Removed agent setting DtlMachineName on agent machine - 64 bit hive 
I, 7096, 6, 2017/08/09, 17:52:52.024, DPP02\DTAExecutionHost, 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 

回答

0

當機器上的組策略重置自動登錄這個問題通常發生註冊表項是測試執行所需的,而部署測試代理步驟則嘗試設置此註冊表項。

要使測試代理以交互方式運行,我們需要在該框上有一個有效的用戶會話,如果該會話不存在,則通過自動登錄創建該會話。

因此,請檢查您是否爲您的測試機啓用了自動登錄功能,或者是否有任何組策略限制了自動登錄功能。

請嘗試以下的東西縮小問題的範圍:

  1. 如果您已成功之前進行測試,只是嘗試 重啓測試機和 下取消「更新測試代理」「 高級「(默認情況下,它已被選中並強制每次重新安裝TA )。

  2. 如果以前未執行過,則可以嘗試下載2015年的測試代理程序 ,然後手動將其安裝在該機器上並檢查結果。

如果還是不行,請嘗試:

  • 配置爲服務,並使用,如果這是一個選項。
  • 請求您的IT管理員在自動登錄器 之前停用您的測試機器的域策略。

另一方面,您可能會嘗試找到另一臺測試機器來測試測試代理是否可以正常部署。

+0

謝謝。禁用GPO解決了這個問題 – lekso