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.
| - name: Set up database | ||
| run: bundle exec rails db:migrate | ||
| - name: Set up databases | ||
| run: bundle exec rake parallel:setup |
There was a problem hiding this comment.
Use rails (not rake) as the task runner; this is the more modern convention
| run: chromedriver --port=9515 --whitelisted-ips & | ||
| - name: Run rspec tests | ||
| run: bundle exec rspec | ||
| run: bundle exec parallel_tests spec/ -t rspec --exclude-pattern "spec/system/**/*_spec.rb" |
There was a problem hiding this comment.
Use rails parallel:spec rather than parallel_tests. I suspect this is causing the issue with parallel_tests not being found in the GitHub Actions workflow.
| pg (1.6.3) | ||
| pghero (3.8.0) | ||
| activerecord (>= 7.2) | ||
| pghero (3.7.0) |
There was a problem hiding this comment.
This dependency should not be changed
f13a970 to
cba0279
Compare
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:
Questions and Comments