我正在尝试使用'Deploy TestAgent'步骤作为构建的一部分,因此我可以运行Selenium测试。不幸的是,我一直遇到以下错误...
2017-05-05T16:31:13.9263760Z ##[warning]DistributedTests: Task 'ConfigureTestAgent' for machine DESKTOP-K88UM6R:5985's Error : System.Exception: Unable to find TestAgent installation path
完整的日志文件如下......
2017-05-05T16:30:46.3449184Z ##[section]Starting: Deploy TestAgent on DESKTOP-K88UM6R
2017-05-05T16:30:46.3449184Z ==============================================================================
2017-05-05T16:30:46.3449184Z Task : Visual Studio Test Agent Deployment
2017-05-05T16:30:46.3449184Z Description : Deploy and configure Test Agent to run tests on a set of machines
2017-05-05T16:30:46.3449184Z Version : 1.0.42
2017-05-05T16:30:46.3449184Z Author : Microsoft Corporation
2017-05-05T16:30:46.3449184Z Help : [More Information](https://go.microsoft.com/fwlink/?LinkId=625976)
2017-05-05T16:30:46.3449184Z ==============================================================================
2017-05-05T16:30:46.3605675Z Preparing task execution handler.
2017-05-05T16:30:46.8620069Z Executing the powershell script: C:\Build Agent\TFS\Builds\_tasks\DeployVisualStudioTestAgent_52a38a6a-1517-41d7-96cc-73ee0c60d2b6\1.0.42\DeployTestAgent.ps1
2017-05-05T16:30:48.0116105Z DistributedTests: Starting to deploy and configure test agent on test machines.
2017-05-05T16:30:48.0297456Z DistributedTests: Inputs provided are:
2017-05-05T16:30:48.0297456Z DistributedTests: Username: DESKTOP-K88UM6R\matty
2017-05-05T16:30:48.0302506Z DistributedTests: Use HTTP Port: True
2017-05-05T16:30:48.0302506Z DistributedTests: Run as process: True
2017-05-05T16:30:48.0307486Z DistributedTests: Login Automatically: True
2017-05-05T16:30:48.0307486Z DistributedTests: Disable Screen saver: True
2017-05-05T16:30:48.0312658Z DistributedTests: Agent would be downloaded from https://go.microsoft.com/fwlink/?LinkId=615472
2017-05-05T16:30:48.0312658Z DistributedTests: Update test agent: True
2017-05-05T16:30:48.0312658Z DistributedTests: Run test agent as DataCollection only : False
2017-05-05T16:30:48.0317489Z DistributedTests: Path to script that installs test agent on remote machine: C:\Build Agent\TFS\Builds\_tasks\DeployVisualStudioTestAgent_52a38a6a-1517-41d7-96cc-73ee0c60d2b6\1.0.42\TestAgentInstall.ps1
2017-05-05T16:30:48.0317489Z DistributedTests: Path to script that configures test agent on remote machine: C:\Build Agent\TFS\Builds\_tasks\DeployVisualStudioTestAgent_52a38a6a-1517-41d7-96cc-73ee0c60d2b6\1.0.42\TestAgentConfiguration.ps1
2017-05-05T16:30:48.0317489Z DistributedTests: Path to script that downloads test agent on Azure remote machines : C:\Build Agent\TFS\Builds\_tasks\DeployVisualStudioTestAgent_52a38a6a-1517-41d7-96cc-73ee0c60d2b6\1.0.42\DownloadTestAgent.ps1
2017-05-05T16:30:48.0322465Z DistributedTests: Path to script that checks if test agent is installed on remote machine: C:\Build Agent\TFS\Builds\_tasks\DeployVisualStudioTestAgent_52a38a6a-1517-41d7-96cc-73ee0c60d2b6\1.0.42\CheckTestAgentInstallation.ps1
2017-05-05T16:30:48.0322465Z DistributedTests: Path to script that checks if test agent is already running on remote machine: C:\Build Agent\TFS\Builds\_tasks\DeployVisualStudioTestAgent_52a38a6a-1517-41d7-96cc-73ee0c60d2b6\1.0.42\VerifyTestMachinesAreInUse.ps1
2017-05-05T16:30:48.0322465Z DistributedTests: Path to script that helps to download and configure test agent :
2017-05-05T16:30:48.1305296Z DistributedTests: Task 'PopulatingMachinesPresentState' on machine 'DESKTOP-K88UM6R:5985' is being run
2017-05-05T16:30:52.1708691Z DistributedTests: Task 'PopulatingMachinesPresentState' on machine 'DESKTOP-K88UM6R:5985' completed.
2017-05-05T16:30:52.1865084Z DistributedTests: Starting to download testagent
2017-05-05T16:31:04.3843950Z DistributedTests: testagent is downloaded at: C:\Users\matty\AppData\Local\Temp\7ff37613-bc34-4f69-afb1-7128d841678f
2017-05-05T16:31:04.7161264Z DistributedTests: Task 'CopyFilesToTestAgent' on machine 'DESKTOP-K88UM6R:5985' is being run
2017-05-05T16:31:06.1901171Z DistributedTests: Task 'CopyFilesToTestAgent' on machine 'DESKTOP-K88UM6R:5985' completed.
2017-05-05T16:31:06.1901171Z DistributedTests: Task 'DeployTestAgent' on machine 'DESKTOP-K88UM6R:5985' is being run
2017-05-05T16:31:09.9855530Z DistributedTests: Task 'DeployTestAgent' on machine 'DESKTOP-K88UM6R:5985' completed.
2017-05-05T16:31:10.0011806Z DistributedTests: Task 'ConfigureTestAgent' on machine 'DESKTOP-K88UM6R:5985' is being run
2017-05-05T16:31:13.9263760Z DistributedTests: Task 'ConfigureTestAgent' on machine 'DESKTOP-K88UM6R:5985' completed.
2017-05-05T16:31:13.9263760Z ##[warning]DistributedTests: Task 'ConfigureTestAgent' for machine DESKTOP-K88UM6R:5985's Error : System.Exception: Unable to find TestAgent installation path
2017-05-05T16:31:13.9263760Z ##[warning]DistributedTests: Task 'ConfigureTestAgent' for machine DESKTOP-K88UM6R:5985's Log :
2017-05-05T16:31:13.9263760Z Deployment started on target machine...
2017-05-05T16:31:13.9263760Z
2017-05-05T16:31:13.9263760Z System.AggregateException: Failed to execute the powershell script. Consult the logs below for details of the error.
2017-05-05T16:31:13.9263760Z Unable to find TestAgent installation path ---> System.Management.Automation.RuntimeException: Unable to find TestAgent installation path ---> System.Management.Automation.RuntimeException: Unable to find TestAgent installation path
2017-05-05T16:31:13.9263760Z --- End of inner exception stack trace ---
2017-05-05T16:31:13.9263760Z at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
2017-05-05T16:31:13.9263760Z at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke)
2017-05-05T16:31:13.9263760Z at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync)
2017-05-05T16:31:13.9263760Z at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
2017-05-05T16:31:13.9263760Z at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
2017-05-05T16:31:13.9263760Z at System.Management.Automation.PowerShell.Invoke(IEnumerable input, PSInvocationSettings settings)
2017-05-05T16:31:13.9263760Z at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Deployment.PowershellExecutor.<>c__DisplayClass28_0.<Invoke>b__0()
2017-05-05T16:31:13.9263760Z at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Utilities.RetryExecutor.<>c__DisplayClass19_0`1.<Execute>b__0()
2017-05-05T16:31:13.9419999Z at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Utilities.RetryExecutor.Execute(Action action)
2017-05-05T16:31:13.9419999Z at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Utilities.RetryExecutor.Execute[T](Func`1 action)
2017-05-05T16:31:13.9419999Z at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Deployment.PowershellExecutor.Invoke(String errorContextMessage, Boolean writeResultToLog, Boolean isCancellable, ActionPreference errorActionPreference)
2017-05-05T16:31:13.9419999Z --- End of inner exception stack trace ---
2017-05-05T16:31:13.9419999Z at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Deployment.PowershellExecutor.Invoke(String errorContextMessage, Boolean writeResultToLog, Boolean isCancellable, ActionPreference errorActionPreference)
2017-05-05T16:31:13.9419999Z at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Deployment.ScriptExecutor.ExecuteScript(IPowerShell powerShell, String script, String arguments, Boolean isScriptDotSourced, Boolean useHttp)
2017-05-05T16:31:13.9419999Z at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Deployment.DeploymentService.RunPowerShellScripts(DeploymentMachineSpecification deploymentMachine, ScriptSpecification scriptSpecification, ScriptSpecification initializationScriptSpecification, String applicationPath, IPowerShell powerShellSession)
2017-05-05T16:31:13.9419999Z ---> (Inner Exception #0) System.Management.Automation.RuntimeException: Unable to find TestAgent installation path ---> System.Management.Automation.RuntimeException: Unable to find TestAgent installation path
2017-05-05T16:31:13.9419999Z --- End of inner exception stack trace ---
2017-05-05T16:31:13.9419999Z at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
2017-05-05T16:31:13.9419999Z at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke)
2017-05-05T16:31:13.9419999Z at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync)
2017-05-05T16:31:13.9419999Z at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
2017-05-05T16:31:13.9419999Z at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
2017-05-05T16:31:13.9419999Z at System.Management.Automation.PowerShell.Invoke(IEnumerable input, PSInvocationSettings settings)
2017-05-05T16:31:13.9419999Z at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Deployment.PowershellExecutor.<>c__DisplayClass28_0.<Invoke>b__0()
2017-05-05T16:31:13.9419999Z at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Utilities.RetryExecutor.<>c__DisplayClass19_0`1.<Execute>b__0()
2017-05-05T16:31:13.9419999Z at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Utilities.RetryExecutor.Execute(Action action)
2017-05-05T16:31:13.9419999Z at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Utilities.RetryExecutor.Execute[T](Func`1 action)
2017-05-05T16:31:13.9419999Z at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Deployment.PowershellExecutor.Invoke(String errorContextMessage, Boolean writeResultToLog, Boolean isCancellable, ActionPreference errorActionPreference)<---
2017-05-05T16:31:13.9419999Z Finding whether TestAgent configuration is required
2017-05-05T16:31:13.9419999Z
2017-05-05T16:31:13.9419999Z Getting existing configuration
2017-05-05T16:31:13.9419999Z
2017-05-05T16:31:13.9419999Z
2017-05-05T16:31:13.9419999Z ##[error]Error occured on 'DESKTOP-K88UM6R:5985'. Details : 'Unable to find TestAgent installation path'. For troubleshooting, refer https://aka.ms/remotevstest.
2017-05-05T16:31:13.9419999Z ##[error]System.Exception: Error occured on 'DESKTOP-K88UM6R:5985'. Details : 'Unable to find TestAgent installation path'. For troubleshooting, refer https://aka.ms/remotevstest.
2017-05-05T16:31:13.9732454Z ##[warning]For troubleshooting, refer https://aka.ms/remotevstest.
2017-05-05T16:31:13.9732454Z ##[error]System.InvalidOperationException: Deploy Test Agent task has failed on all machines. Check the logs for more details.
2017-05-05T16:31:13.9732454Z at Microsoft.TeamFoundation.DistributedTask.Task.DistributedTestAutomation.DeployTestAgent.Run()
2017-05-05T16:31:13.9732454Z at Microsoft.TeamFoundation.DistributedTask.Task.DistributedTestAutomation.TaskRunner.Run(Dictionary`2 arguments, VssConnection connection, TaskType taskType)
2017-05-05T16:31:13.9732454Z at Microsoft.TeamFoundation.DistributedTask.Task.DistributedTestAutomation.InvokeDeployTestAgentCmdlet.ProcessRecord()
2017-05-05T16:31:14.0266415Z ##[error]PowerShell script completed with 2 errors.
2017-05-05T16:31:14.0266415Z ##[section]Finishing: Deploy TestAgent on DESKTOP-K88UM6R
我可以看到vstf_testagent文件在构建过程中出现在我的Temp文件夹中,但我很困惑为什么它会抱怨安装路径。
以下是更多信息
答案 0 :(得分:2)
测试代理位置:
可选。测试代理(vstf_testagent.exe)的路径,如果不同于 默认路径。
如果您使用本地计算机或网络上的测试代理的副本,请指定该实例的路径。
该位置必须可由构建代理(使用其运行的标识)或测试代理(使用 上面配置的身份)。
根据Unable to find TestAgent installation path
错误。您可以先手动下载代理,而不是从Internet下载代理。然后将VS 201x测试代理放在共享文件夹中,并让VS Test Agent Deployment任务部署它。 (不要在本地安装代理)
此外,如果您使用的是测试代理2017.您需要将TFS2017更新到TFS2017 update1。有一个&#34; 版本&#34;在每个任务的右上角下拉。您需要使用&#34;版本2&#34; VS Test Agent部署任务,以便您可以正确配置它以部署VS 2017测试代理。