Run Jobs Sequentially
Learn how to break down the tests into jobs and how to reorganize the pipeline to use inside of a job.
So far, we have executed all tests in a single job.
The Priority variable is passed to the goals of the Maven task so the tests with the specific priority are executed:
goals: 'clean test -Dgroups=$(Priority)'
Let’s say that we want to execute tests sequentially by priority:
- First, the
Highpriority tests should run. - Then, the
Mediumpriority should run. - Finally, the
Lowpriority ones should run.
How to execute jobs sequentially
To execute jobs sequentially, we need to change the pipeline code as follows so that it uses jobs and strategies:
The pipeline has a jobs section, which can include one job or more (line 4). ...