Run Jobs in Parallel

Learn how to run jobs in parallel by updating the maxParallel setting.

We'll cover the following...

To run the jobs from the previous lesson in parallel, we just change the maxParallel value from 1 to 3:

Press + to interact
trigger:
- master
jobs:
- job:
pool:
vmImage: 'ubuntu-latest'
strategy:
matrix:
Tests_High:
TestsPriority: "High"
Tests_Medium:
TestsPriority: "Medium"
Tests_Low:
TestsPriority: "Low"
maxParallel: 3 <-----------
steps:
- task: Bash@3
displayName: "create browser variable"
inputs:
targetType: 'inline'
script: |
export BROWSER=$(BROWSER)
- task: Maven@3
inputs:
mavenPomFile: 'pom.xml'
mavenOptions: '-Xmx3072m'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.8'
jdkArchitectureOption: 'x64'
publishJUnitResults: true
testResultsFiles: '**/surefire-reports/TEST-*.xml'
goals: 'clean test -Dgroups=$(TestsPriority)'
- task: PublishBuildArtifacts@1
displayName: 'Publish Log File as Artifact'
inputs:
PathtoPublish: $(System.DefaultWorkingDirectory)/target/logs
ArtifactName: 'logs_$(TestsPriority)'
- task: PublishBuildArtifacts@1
displayName: 'Publish Screenshots as Artifact'
inputs:
PathtoPublish: $(System.DefaultWorkingDirectory)/target/screenshots
ArtifactName: 'screenshots_$(TestsPriority)'

As soon as the pipeline starts executing, you should ...