Using ‘Visual Studio Agent Deployment’ task on machines not connected to the internet

‘Run Functional Tests’ (RFT) task is used for running functional tests using remote machines or to run tests in a distributed manner using multiple machines. With TFS 2017 Update 2 and VSTS, You can use “Run Functional Tests” task to run tests using Visual Studio Test Agent 2017.

The RFT task needs a companion ‘Deploy Test Agent’ task that deploys and configures test agents against your VSTS account or the TFS server. Using the Deploy Test Agent version 2 task, you can now choose which version of Test Agents you want to deploy.

agentversionsetting

For machines which are connected to the internet, the process is pretty straightforward.

The required test agent will be downloaded and installed automatically if it’s not present on the machine.

For machines that are not connected to the internet, the task supports installing test agents from a shared UNC path. For this, you need to make the test agent installer available on a network share.

If you are installing Test Agent 2015, use the following steps:

  1. Download Test Agent 2015 from https://go.microsoft.com/fwlink/?LinkId=827840
  2. Copy the test agent to a machine which is accessible by build agent and test agent machines
  3. Share the test agent folder using Windows file sharing
  4. Use the shared path location in “Visual Studio Test Agent Deployment” task as shown below

ta2015

 

 

 

 

With the Visual Studio 2017 release, the packaging and installation experience has changed. So you need to first create an offline installer using the bootstrapper. The installer also checks for certificates to verify package authenticity, so some extra prep is required before an offline installer can be used by the ‘Visual Studio Test Agent Deployment’ task.

To easily create an offline package of Test Agent 2017 in a single step, we have created a Powershell script.

If you are using TFS 2017 Update 2, please use the PS script located here.

If you are using VSTS, please use the PS script located here

Run the PS script providing language and sharedFolder as optional parameters. If these parameters are not provided, Test Agent English (en-us) package will be downloaded to the folder from where the script runs.

If you do not want to run the script, you can perform the following steps instead:

  1. Download the bootstrapper vs_testagent.exe from: https://aka.ms/vs/15/release/vs_TestAgent.exe
  2. Run the following command to create an offline cache (the following example assumes ENU language)

vs_testagent.exe –layout C:\TA2017Setup –lang en-US

This downloads the Test agent packages to C:\TA2017Setup\ folder

tapackage

3. Now “Archive/Zip”  all the contents of the folder and name it as “TestAgent.zip”. Please make sure you retain the directory information while zipping.

preservedirectory

4. Share the folder which contains “TestAgent.zip” using Windows file sharing.

5. Use the shared path location in “Visual Studio Test Agent Deployment” 

ta2017

Notes:

  1. For Test agent 2017, make sure the archive retains the folder structure as shown and name it “TestAgent.zip”
  2. Offline installation is supported only for “HTTP/local” machines. If you are using Azure machines, the agent will be downloaded from internet and installed automatically. For creating Azure machines, we recommend creating “VM image with Test Agent preinstalled”. If Test Agent is preinstalled, the ‘Deploy Test Agent’ step skips the installation portion and simply configures the agent, and thus runs faster.
  1. It is also recommended that you install the latest Windows Management Framework on test agent machines
  1. A prerequisites checklist is available at https://github.com/Microsoft/vsts-tasks/tree/master/Tasks/DeployVisualStudioTestAgent
5