Run jest in parallel in CI
What is the productivity problem to solve?
As in #34322 (closed), jest
job duration is increasing. Left on its own, it's going to be the slowest job in the test
stage. As the codebase grows, it is reasonable to expect the number of tests to go up. Similar to rspec
jobs, we need to look into enabling parallel jobs to run jest
suite in order to keep the total pipeline duration within target.
Problem identification checklist
-
The root cause of the problem is identified. -
The surface of the problem is as small as possible.
What are the potential solutions?
The first iteration of this can be a runner script that splits up jest
test files and distribute the test files evenly across parallel CI jobs.
We should develop this in node.js, so we could extend it to hook into jest or karma runner natively when needed.
Jest runner also returns performance information which we can use to improve the test distributions.
Verify that the solution has improved the situation
-
The solution improved the situation. - If yes, check this box and close the issue. Well done!
🎉 - Otherwise, create a new "Productivity Improvement" issue. You can re-use the description from this issue, but obviously another solution should be chosen this time.
- If yes, check this box and close the issue. Well done!