2
votes

I upgraded my TFS-2013 to TFS-2015 and then define new build definition with 3 steps

  1. MSBuild
  2. Visual Studio Test Agent Deployment
  3. Visual Studio Test using test agent

I selected test group for the second step and add username and password for the third step. I selected the test group and test drop folder which contains test DLLs and I added the DLL file name which contains coded UI test method to test assembly.

when I tried to deploy test agent I found this log :

[debug]Calling Invoke-DeployTestAgent DistributedTests: Starting to deploy and configure test agent on test machines. DistributedTests: Inputs provided are: DistributedTests: Machines: TestPC3 DistributedTests: Username: user123 DistributedTests: Machine Group name: testui DistributedTests: Run as process: True DistributedTests: Login Automatically: True DistributedTests: Disable Screen saver: True DistributedTests: Agent location: \user-pc\drop_Location\vstf_testagent.exe DistributedTests: Update test agent: True DistributedTests: Run test agent as DataCollection only : False DistributedTests: Path to script that installs test agent on remote machine: G:\agentui\tasks\DeployVisualStudioTestAgent\1.0.2\TestAgentInstall.ps1 DistributedTests: Path to script that configures test agent on remote machine: G:\agentui\tasks\DeployVisualStudioTestAgent\1.0.2\TestAgentConfiguration.ps1 DistributedTests: Path to script that checks if test agent is installed on remote machine: G:\agentui\tasks\DeployVisualStudioTestAgent\1.0.2\CheckTestAgentInstallation.ps1 DistributedTests: Creating DTL client DistributedTests: Getting Machine Group with name = testui project = TestBuildLifeCycle DistributedTests: Got Machine Group with name = testui project = TestBuildLifeCycle DistributedTests: Cleaning up tags from machines DistributedTests: Removing tag 'Microsoft-AgentsForVS' on machine 'TestPC3' DistributedTests: Getting list of machines from machinename completed DistributedTests: Updating environment resources with TestAgent tag DistributedTests: Test Agent is being copied to: C:\Users\userFolder\AppData\Local\Temp\2c15a489-7765-4a41-b78e-09197ee5d2c8\vstf_testagent.exe DistributedTests: Preparing for copying files from C:\Users\userFolder\AppData\Local\Temp\2c15a489-7765-4a41-b78e-09197ee5d2c8\vstf_testagent.exe to $env:SystemDrive\TestAgent DistributedTests: Setting up Copy task for Agent : TestPC3 DistributedTests: Total machines where task CopyFilesToTestAgent needs to be run : 1 DistributedTests: Task 'CopyFilesToTestAgent' on machine 'TestPC3' is being run DistributedTests: Task 'CopyFilesToTestAgent' on machine 'TestPC3' completed. DistributedTests: Task 'CopyFilesToTestAgent' for machine TestPC3's Status : Failed DistributedTests: Task 'CopyFilesToTestAgent' for machine TestPC3's Log : System.AggregateException: Failed to create working directory on the machine. Consult the logs below for details of the error. An object at the specified path C:\Users\J3CA7~1.JSH does not exist.

I used administrator's credentials and solved this issue by install agent manual but need to make it able to edit the agent I've noticed that the process tries to copy test agent to temp folder in appData and then try to copy this agent to c:\testAgent but it failes

2
can you shown me the detailed build log file on the Diagnostics page? - Vicky - MSFT

2 Answers

2
votes

If you are running coded UI tests, you must configure your build agent to run interactively. Before you try to use your build process to run tests, make sure they can be run on the build server that you plan to use.

There are some things you should pay attention to:

Prepare

  1. Make sure your solution and your test files are checked into version control.

  2. Microsoft Visual Studio is required to be installed on the build server for the following scenario: To run unit tests, or coded UI tests, you must install Visual Studio Professional or later.

  3. Many tests and test operations (including Code UI test) require that you install on your build agent the same version of Visual Studio that your team uses on its dev machines.

To run your build server in interactive mode

  1. Identify the user account that will act as the build service account. The build service account must:

    • Be a member of the Windows Administrators group on the build server.
    • Be a member of the Build Service Accounts group on your team project collection.
    • Have Change and Read privileges on the drop folder, if any, that you plan to specify in your build definition.
  2. On the Build Service Properties dialog box, choose Stop the service.

  3. Under Run the Service as, choose Change, and then specify the credentials of the build service account.

  4. Select Run the Service interactively.

  5. Choose Start, and then choose OK.

  6. Leave the build service account logged on to the build server.

For more details and screenshots: https://msdn.microsoft.com/en-us/library/ms181712(v=vs.120).aspx#interactive

0
votes

On step 2 (deploying test agent) you will need to enable the "Interactive" option.

For more detail: https://github.com/Microsoft/vso-agent-tasks/blob/master/Tasks/DeployVisualStudioTestAgent/README.md