There is a project which has a lot of tests, and running them all takes about 20 minutes. Unfortunately, it is not possible to parallel them inside one gitlab runner. I wonder if there are any good practices to start multiple gitlab runners with the same environment but different test suits?
If you can split the test suit into several parts, you can create equal number of jobs in the same stage (test). Jobs in the same stage are run in parallel but jobs in the next stage will start after the jobs of the previous stage complete. They will run in parallel even if you have only one runner. Let's assume this test case:
stages:
- test
testsA:
stage: test
script:
- sleep 60
- echo 'Test set A done'
testsB:
stage: test
script:
- sleep 30
- echo 'Test set B done'
You will see that they are running at the same time and test A will complete after test B.
Adjust the runners' settings (/etc/gitlab-runner/config.toml) checking for 2 options:
concurrent
= the total number of jobs run in parallel across all runnerslimit
(set for each runner) = the number of jobs run in parallel by one particular runnerNote: I haven't tested if a project with multiple runners, each of them having limit
set to 1, would run these jobs using different runners. However, I assume it works this way.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With