-
Notifications
You must be signed in to change notification settings - Fork 24
Parallelize the test suite in CI with parallel_tests #1572
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,7 +18,7 @@ | |
| # See https://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration | ||
| require "active_storage_validations/matchers" | ||
|
|
||
| if ENV["CI"] | ||
| if ENV["COVERAGE"] | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🤖 From Claude: SimpleCov is now gated on |
||
| require "simplecov" | ||
| require "simplecov_json_formatter" | ||
| SimpleCov.formatter = | ||
|
|
@@ -42,6 +42,18 @@ | |
| end | ||
| end | ||
|
|
||
| # Under parallel_tests in CI, a single shared --out file would be clobbered by | ||
| # each process. Give every process its own results file, keyed on the | ||
| # TEST_ENV_NUMBER that parallel_tests assigns (blank for the first process). | ||
| if ENV["CI"] | ||
| require "fileutils" | ||
| FileUtils.mkdir_p("tmp/rspec_results") | ||
| RSpec.configure do |config| | ||
| config.add_formatter "progress" | ||
| config.add_formatter "json", "tmp/rspec_results/results#{ENV['TEST_ENV_NUMBER']}.json" | ||
| end | ||
| end | ||
|
|
||
| RSpec.configure do |config| | ||
| # rspec-expectations config goes here. You can use an alternate | ||
| # assertion/expectation library such as wrong or the stdlib/minitest | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤖 From Claude:
PARALLEL_TEST_PROCESSORS=4matches the 4 vCPUs onubuntu-latest. Running 4 headless Chrome system specs concurrently is the main flakiness risk to watch — if CI gets flaky, dropping to 3 or sharding system specs into their own job is the lever.