Parallelize rspec tests#7972
Conversation
|
Hi @david-yz-liu, I'm seeing that the CI run is failing due to the |
david-yz-liu
left a comment
There was a problem hiding this comment.
@akarki2005 I removed the gem cache and re-ran the tests. It looks like the gem installed correctly, but there's an issue with bundler using parallel_tests. See my comments for a suggested fix.
be6a481 to
c749258
Compare
Coverage Report for CI Build 27071576024Coverage remained the same at 90.202%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats💛 - Coveralls |
david-yz-liu
left a comment
There was a problem hiding this comment.
@akarki2005 nice work! In addition to the inline comments I left, I think we can improve the GitHub Actions part a bit. Take a look at https://github.com/grosser/parallel_rails_example/blob/master/.github/workflows/test.yml, and in particular the store-runtime action. I think the goal of that is to cache the test logs so that the test parallelization is more balanced in future runs.
ee4164b to
b70ff6f
Compare
david-yz-liu
left a comment
There was a problem hiding this comment.
@akarki2005 the changes look good to me (and do seem to faithfully follow the parallel_tests example) but in the GitHub Actions flow, it looks like the tasks that involve deleting the cache are failing.
But also in the most recent test run I think there's an issue with redis as well with parallelization: https://github.com/MarkUsProject/Markus/actions/runs/27071576024/job/79960812268.
Proposed Changes
Adds the
parallel_testsgem to run RSpec tests in parallel, reducing CI test suite runtime. Each parallel worker gets its own isolated test database using theTEST_ENV_NUMBERenvironment variable. System tests continue to run sequentially as they require a browser.Type of Change
(Write an
Xor a brief description next to the type or types that best describe your changes.)Checklist
(Complete each of the following items for your pull request. Indicate that you have completed an item by changing the
[ ]into a[x]in the raw text, or by clicking on the checkbox in the rendered description on GitHub.)Before opening your pull request:
After opening your pull request: