VisualStudio在线TestAgent背后的代理

时间:2017-09-14 15:04:23

标签: visual-studio powershell azure-devops

摘要:

我很难让测试代理在Visual Studio Online中作为网站构建过程的一部分进行部署,可能是由于网络代理。

详细信息:

我为Crab Company工作," cc"简而言之(不,不是真的),我们在https://cc.visualstudio.com有一个帐户。

我们有一个内部构建服务器," ccvsts",Windows Server 2012 R2。

我们有一个将用于Intranet测试的实例,并将托管该网站," ccwebt1",Windows Server 2016.

网络流量已过滤。港口开放了。 Intranet计算机使用代理连接到Internet。

我们对使用Selenium的网站进行了一些测试。我试图按照https://www.visualstudio.com/en-us/docs/test/continuous-testing/getting-started/continuous-test-selenium的指南进行测试,但不是构建解决方案(有一堆项目),而是建立了网站项目和测试项目:< / p>

build steps

我已经达到项目构建的地步,并且经历了一些初步的网络问题,但我认为现在由于代理而遇到了问题。我认为相关的例外是

  

System.Management.Automation.MethodInvocationException:异常调用&#34; .ctor&#34;用&#34; 2&#34;参数:&#34;发生了一个或多个错误。&#34; ---&GT; System.AggregateException:发生一个或多个错误。 ---&GT; System.Net.Http.HttpRequestException:发送请求时发生错误。 ---&GT; System.Net.WebException:无法连接到远程服务器---&gt; System.Net.Sockets.SocketException:无法建立连接,因为目标计算机主动拒绝它104.214.111.103:443

请注意,cc.visualstudio.com解析为104.214.111.103
另请注意,这是&#34;部署TestAgent on&#34;构建步骤。
另请注意,第一个构建步骤确实成功,代码在ccvsts上生成,因此构建代理(至少)已经可以与Visual Studio Online进行通信。

我认为这是与以下powershell

的示例相关的代理
PS > $R = Invoke-WebRequest -URI http://www.bing.com?q=how+many+feet+in+a+mile
Invoke-WebRequest :
Access Denied (authentication_failed)
Your credentials could not be authenticated: "Credentials are missing.". You will not be permitted access until your
credentials can be verified.

但是,这可能是凭据问题。测试代理的要求对我来说有点不清楚,所以我在ccwebt1上设置了本地用户帐户和本地管理员帐户,但这两个帐户都无法访问VSTS 。我不知道这是否会引起问题。

总结我的问题

1)如果网络代理阻止在测试代理电源shell脚本中访问visual studio online,我该如何解决?

2)使用本地帐户进行测试代理是否会阻止对在线视觉工作室的访问?

在下方记录(重命名了一些值,但未经修改)

******************************************************************************
Starting: Deploy TestAgent on
******************************************************************************
==============================================================================
Task         : Visual Studio Test Agent Deployment
Description  : Deploy and configure Test Agent to run tests on a set of machines
Version      : 2.1.20
Author       : Microsoft Corporation
Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=838890)
==============================================================================
****************************************************************
                    Task Input Information                      
----------------------------------------------------------------
testMachineInput         = ccwebt1
adminUserName            = ccwebt1\ccwebt1localadmin
winRmProtocal            = Http
testCertificate          = true
machineUserName          = ccwebt1\ccwebt1local
runAsProcess             = false
logonAutomatically       = false
disableScreenSaver       = false
isDataCollectionOnly     = false
testPlatform             = 14.0
agentLocation            = 
updateTestAgent          = false
****************************************************************
Starting to deploy and configure test agent on test machines.
Inputs provided are:
Use HTTP Port: True
Username: ccwebt1\ccwebt1local
Disable Screen saver: False
Login Automatically: False
Run as process: False
Agent would be downloaded from https://go.microsoft.com/fwlink/?LinkId=615472
Update test agent: False
Run test agent as DataCollection only : False
Task 'VerifyTestAgentInstalled' on machine 'ccwebt1:5985' is being run
     Deployment started on target machine...
Query for Testplatfrom version: 14.0
Test Agent does not exists
RemoteDeployerSource Verbose: 2 : [RemoteDeployer][12:Sep:17:11:37:45:2421; 4784, 4](ccwebt1)Created public key for communication
RemoteDeployerSource Information: 12 : [RemoteDeployer][12:Sep:17:11:37:45:2576; 4784, 4](ccwebt1)Deployment service - VisualStudioRemoteDeployer553ef14b-0634-460a-b535-cb40cbcb2409 is running...
RemoteDeployerSource Verbose: 4 : [RemoteDeployer][12:Sep:17:11:37:46:2851; 4784, 6](ccwebt1)Input file found
RemoteDeployerSource Verbose: 5 : [RemoteDeployer][12:Sep:17:11:37:46:2851; 4784, 6](ccwebt1)Reading input parameters
RemoteDeployerSource Verbose: 6 : [RemoteDeployer][12:Sep:17:11:37:46:2851; 4784, 6](ccwebt1)Finished reading input parameters
Task 'VerifyTestAgentInstalled' on machine 'ccwebt1:5985' completed.
Starting to download testagent
Test agent download is taking time. Please wait.
testagent is downloaded at: C:\TestAgent\365dea8f-557e-45e8-bb1d-fa59563f01ef
Task 'CopyFilesToTestAgent' on machine 'ccwebt1:5985' is being run
\\ccwebt1 was deleted successfully.
Copying recursively from C:\TestAgent\365dea8f-557e-45e8-bb1d-fa59563f01ef to C:\TestAgent on machine ccwebt1 succeeded.
\\ccwebt1 was deleted successfully.
Task 'CopyFilesToTestAgent' on machine 'ccwebt1:5985' completed.
Task 'InstallTestAgent' on machine 'ccwebt1:5985' is being run
Task 'InstallTestAgent' on machine 'ccwebt1:5985' is taking time. Please Wait
Task 'InstallTestAgent' on machine 'ccwebt1:5985' completed.
     Deployment started on target machine...
Setup path: C:\TestAgent\vstf_testagent.exe
Installed Test Agent version: 0.0
Requested Test Agent version: 14.0.25463
Test Agent will be installed
Invoking the command C:\TestAgent\vstf_testagent.exe with arguments 
RemoteDeployerSource Verbose: 2 : [RemoteDeployer][12:Sep:17:11:39:18:4378; 420, 4](ccwebt1)Created public key for communication
RemoteDeployerSource Information: 12 : [RemoteDeployer][12:Sep:17:11:39:18:4534; 420, 4](ccwebt1)Deployment service - VisualStudioRemoteDeployer3c6e52bc-5767-4bfd-9dba-f056c5d90671 is running...
RemoteDeployerSource Verbose: 4 : [RemoteDeployer][12:Sep:17:11:39:19:4789; 420, 6](ccwebt1)Input file found
RemoteDeployerSource Verbose: 5 : [RemoteDeployer][12:Sep:17:11:39:19:4789; 420, 6](ccwebt1)Reading input parameters
RemoteDeployerSource Verbose: 6 : [RemoteDeployer][12:Sep:17:11:39:19:4945; 420, 6](ccwebt1)Finished reading input parameters
Task 'CopyFilesToTestAgent' on machine 'ccwebt1:5985' is being run
Task 'CopyFilesToTestAgent' on machine 'ccwebt1:5985' completed.
\\ccwebt1 was deleted successfully.
Copying recursively from C:\agent\_work\_tasks\DeployVisualStudioTestAgent_52a38a6a-1517-41d7-96cc-73ee0c60d2b6\2.1.20\TestExecution.zip to C:\TestAgent on machine ccwebt1 succeeded.
\\ccwebt1 was deleted successfully.
Task 'TestAgentConfiguration' on machine 'ccwebt1:5985' is being run
RemoteDeployerSource Verbose: 2 : [RemoteDeployer][12:Sep:17:11:40:28:2919; 3220, 4](ccwebt1)Created public key for communication
RemoteDeployerSource Information: 12 : [RemoteDeployer][12:Sep:17:11:40:28:2919; 3220, 4](ccwebt1)Deployment service - VisualStudioRemoteDeployer1b3bbb26-a295-47a6-93bb-1432b9140099 is running...
RemoteDeployerSource Verbose: 4 : [RemoteDeployer][12:Sep:17:11:40:29:3232; 3220, 6](ccwebt1)Input file found
RemoteDeployerSource Verbose: 5 : [RemoteDeployer][12:Sep:17:11:40:29:3232; 3220, 6](ccwebt1)Reading input parameters
RemoteDeployerSource Verbose: 6 : [RemoteDeployer][12:Sep:17:11:40:29:3232; 3220, 6](ccwebt1)Finished reading input parameters
Task 'TestAgentConfiguration' on machine 'ccwebt1:5985' completed.
Task 'TestAgentConfiguration' for machine ccwebt1:5985's Error : System.Exception: The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Unable to connect to Team Foundation Server
Task 'TestAgentConfiguration' for machine ccwebt1:5985's Log :
     Deployment started on target machine...
System.AggregateException: Failed to execute the powershell script. Consult the logs below for details of the error.
The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Unable to connect to Team Foundation Server ---> System.Management.Automation.ActionPreferenceStopException: The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Unable to connect to Team Foundation Server
   at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
   at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke)
   at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync)
   at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
   at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
   at System.Management.Automation.PowerShell.Invoke(IEnumerable input, PSInvocationSettings settings)
   at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Deployment.PowershellExecutor.<>c__DisplayClass28_0.<Invoke>b__0()
   at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Utilities.RetryExecutor.<>c__DisplayClass19_0`1.<Execute>b__0()
   at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Utilities.RetryExecutor.Execute(Action action)
   at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Utilities.RetryExecutor.Execute[T](Func`1 action)
   at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Deployment.PowershellExecutor.Invoke(String errorContextMessage, Boolean writeResultToLog, Boolean isCancellable, ActionPreference errorActionPreference)
   --- End of inner exception stack trace ---
   at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Deployment.PowershellExecutor.Invoke(String errorContextMessage, Boolean writeResultToLog, Boolean isCancellable, ActionPreference errorActionPreference)
   at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Deployment.ScriptExecutor.ExecuteScript(IPowerShell powerShell, String script, String arguments, Boolean isScriptDotSourced, Boolean useHttp)
   at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Deployment.DeploymentService.RunPowerShellScripts(DeploymentMachineSpecification deploymentMachine, ScriptSpecification scriptSpecification, ScriptSpecification initializationScriptSpecification, String applicationPath, IPowerShell powerShellSession)
---> (Inner Exception #0) System.Management.Automation.ActionPreferenceStopException: The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Unable to connect to Team Foundation Server
   at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
   at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke)
   at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync)
   at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
   at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
   at System.Management.Automation.PowerShell.Invoke(IEnumerable input, PSInvocationSettings settings)
   at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Deployment.PowershellExecutor.<>c__DisplayClass28_0.<Invoke>b__0()
   at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Utilities.RetryExecutor.<>c__DisplayClass19_0`1.<Execute>b__0()
   at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Utilities.RetryExecutor.Execute(Action action)
   at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Utilities.RetryExecutor.Execute[T](Func`1 action)
   at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Deployment.PowershellExecutor.Invoke(String errorContextMessage, Boolean writeResultToLog, Boolean isCancellable, ActionPreference errorActionPreference)<---
Test User ccwebt1local
Test UserDomain ccwebt1
Path: C:\TestAgent\TfsAssemblies\Newtonsoft.Json.dll
Loading module from path 'C:\TestAgent\TfsAssemblies\Newtonsoft.Json.dll'.
Loading module from path 'C:\TestAgent\TfsAssemblies\System.Net.Http.Formatting.dll'.
Loading module from path 'C:\TestAgent\TfsAssemblies\Microsoft.TeamFoundation.DistributedTask.Task.TestExecution.dll'.
Loading module from path 'C:\TestAgent\TfsAssemblies\Microsoft.TeamFoundation.Common.dll'.
Loading module from path 'C:\TestAgent\TfsAssemblies\Microsoft.TeamFoundation.Test.WebApi.dll'.
Loading module from path 'C:\TestAgent\TfsAssemblies\Microsoft.VisualStudio.Services.Common.dll'.
Loading module from path 'C:\TestAgent\TfsAssemblies\Microsoft.VisualStudio.Services.WebApi.dll'.
Loading module from path 'C:\TestAgent\PrivateAssemblies\MS.VS.TestService.Client.Utility.dll'.
****************************************************************
                    Configure Test Agent                      
----------------------------------------------------------------
SetupPath                       : (C:\TestAgent)
TestUserName                    : (ccwebt1\ccwebt1local)
TfsCollection                   : (https://cc.visualstudio.com/)
AsServiceOrProcess              : (Service)
EnvironmentUrl                  : (dta://env/2d109582-6dad-402e-8297-aa8de2398194/_apis//201709121137404659)
MachineName                     : (ccwebt1)
Capabilities                    : ()
TestAgentVersion                : (14.0)
****************************************************************
Unable to connect to Team Foundation Server, Check if TFS is reachable from the test agent. Exception Details : 
System.Management.Automation.MethodInvocationException: Exception calling ".ctor" with "2" argument(s): "One or more errors occurred." ---> System.AggregateException: One or more errors occurred. ---> System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 104.214.111.103:443
   at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)
   at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
   --- End of inner exception stack trace ---
   at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
   at System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar)
   --- End of inner exception stack trace ---
   at Microsoft.VisualStudio.Services.Common.VssHttpRetryMessageHandler.<SendAsync>d__4.MoveNext() in E:\v2.0\A5\_work\1\s\Vssf\Client\Common\VssHttpRetryMessageHandler.cs:line 159
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.<SendAsync>d__48.MoveNext() in E:\v2.0\A5\_work\1\s\Vssf\Client\WebApi\VssHttpClientBase.cs:line 818
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.<SendAsync>d__45`1.MoveNext() in E:\v2.0\A5\_work\1\s\Vssf\Client\WebApi\VssHttpClientBase.cs:line 721
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Services.Location.Client.LocationHttpClient.<GetConnectionDataAsync>d__6.MoveNext() in E:\v2.0\A5\_work\1\s\Vssf\Client\WebApi\HttpClients\LocationHttpClient.cs:line 71
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Services.WebApi.Location.VssServerDataProvider.<ConnectAsync>d__41.MoveNext() in E:\v2.0\A5\_work\1\s\Vssf\Client\WebApi\Location\ServerDataProvider.cs:line 692
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Services.WebApi.Location.VssServerDataProvider.<EnsureConnectedAsync>d__39.MoveNext() in E:\v2.0\A5\_work\1\s\Vssf\Client\WebApi\Location\ServerDataProvider.cs:line 642
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Services.WebApi.Location.VssServerDataProvider.<GetInstanceIdAsync>d__11.MoveNext() in E:\v2.0\A5\_work\1\s\Vssf\Client\WebApi\Location\ServerDataProvider.cs:line 174
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Services.WebApi.Location.LocationService.<GetLocationDataAsync>d__2.MoveNext() in E:\v2.0\A5\_work\1\s\Vssf\Client\WebApi\Location\LocationService.cs:line 54
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Services.WebApi.VssConnection.<GetClientInstanceAsync>d__18.MoveNext() in E:\v2.0\A5\_work\1\s\Vssf\Client\WebApi\VssConnection.cs:line 357
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Services.WebApi.VssConnection.<GetClientServiceImplAsync>d__15.MoveNext() in E:\v2.0\A5\_work\1\s\Vssf\Client\WebApi\VssConnection.cs:line 299
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Services.WebApi.VssConnection.<GetClientAsync>d__12`1.MoveNext() in E:\v2.0\A5\_work\1\s\Vssf\Client\WebApi\VssConnection.cs:line 227
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Services.WebApi.TaskExtensions.SyncResult[T](Task`1 task) in E:\v2.0\A5\_work\1\s\Vssf\Client\WebApi\TaskExtensions.cs:line 35
   at Microsoft.VisualStudio.Services.WebApi.VssConnection.GetClient[T]() in E:\v2.0\A5\_work\1\s\Vssf\Client\WebApi\VssConnection.cs:line 195
   at MS.VS.TestService.Client.Utility.TestExecutionServiceRestApiHelper.Initialize(String serviceUrl, String accesToken) in E:\v2.0\A5\_work\1\s\Ta\Agent\VS.TestService.Client.Utility\RestApiHelper.cs:line 108
   at System.Threading.Tasks.Task.Execute()
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at MS.VS.TestService.Client.Utility.TestExecutionServiceRestApiHelper.RunTaskWithRetriesOnServiceUnavailability[T](Func`1 getTask) in E:\v2.0\A5\_work\1\s\Ta\Agent\VS.TestService.Client.Utility\RestApiHelper.cs:line 158
   --- End of inner exception stack trace ---
   at System.Management.Automation.DotNetAdapter.AuxiliaryConstructorInvoke(MethodInformation methodInformation, Object[] arguments, Object[] originalArguments)
   at System.Management.Automation.DotNetAdapter.ConstructorInvokeDotNet(Type type, ConstructorInfo[] constructors, Object[] arguments)
   at Microsoft.PowerShell.Commands.NewObjectCommand.CallConstructor(Type type, ConstructorInfo[] constructors, Object[] args)
Error occurred on 'ccwebt1:5985'. Details : 'The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Unable to connect to Team Foundation Server'. For troubleshooting, refer https://aka.ms/remotevstest.
******************************************************************************
Finishing: Deploy TestAgent on
******************************************************************************

0 个答案:

没有答案