Documentation

Looking for something in particular?

Parallel Execution in Microsoft Azure Pipelines using Targets

Microsoft Azure Pipelines is a cloud service that you can use to automatically build and test your code project and make it available to other users. It works with just about any language or project type.

Azure Pipelines combines continuous integration (CI) and continuous delivery (CD) to constantly and consistently test and build your code and ship it to any target.

This support article describes how to execute parallel execution in Microsoft Azure Pipelines using targets.  

In ANT execution, everything under the target tag is executed. We can have multiple target tags present in the same build.xml file. 

In this example, we assume to have 20 test cases and a single build.xml file with two targets – each with ten different test cases. The following includes instructions for using the targets of an ANT build.xml file.

Prerequisites in Microsoft Azure Pipelines using Targets


You will need to make changes to the provar.home and testproject.home variables in the build.xml file to include the path of the agent system. The following command is used to execute the build file with targets: 

> ant -f build.xml target_name

Step 1: Configure Azure Pipelines with an ANT task. To get started, click Variables.

Step 2: Create a variable TARGETS with the value of: 

suite1,suite2

Note: The value is the name of different targets created in the build file above. It could be different for you. 

Executing ant -f build.xml

Above: View of Variables tab within Azure Pipelines. 

Step 3: Click Tasks and then the selected agent job. 

Step 4: Under Parallelism, select Multi-Configuration.

Step 5 Complete the following configuration.

Multipliers: TARGETS

Note: This is the variable name being defined in Step 2.

A maximum number of agents: Provide the number of agents you want to execute test cases in parallel.

Providing the number of agents you want to execute test cases in parallel execution Microsoft Azure pipeline using targets.

Step 6: Select the ANT task.

Step 7: Use the following information to complete the configuration.

  • Ant build file: <Path to build file>\build.xml
  • Options: $(TARGETS)
  • Check to Publish to Azure Pipelines under JUnit Test Results
  • Test results files: <Path to Result file from build.xml>\junit.xml

Configuring ANT build in Azure Pipeline

Step 8: Changes can also be made to the build.xml files to create separate result files. (See command below.) Otherwise, one agent’s result will override the other’s result.

<property name=”testproject.results” value=”D:\a\1\s\ANT\Results\${TARGETS}”/>

 If you execute the Azure Pipeline now, you should see two agents running – each executing their respective target from the build.xml file.

 

Review Provar on G2
Documentation library

Trying to raise a case with our support team?

We use cookies to better understand how our website is used so we can tailor content for you. For more information about the different cookies we use please take a look at our Privacy Policy.

Scroll to Top