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
High
priority tests should run. - Then, the
Medium
priority should run. - Finally, the
Low
priority 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:
Get hands-on with 1400+ tech skills courses.