-
-
Notifications
You must be signed in to change notification settings - Fork 198
Speed up CI with parallel test execution #2455
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
Open
mroderick
wants to merge
5
commits into
codebar:master
Choose a base branch
from
mroderick:speedup-ci-tests
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+116
−23
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Resolves issues with two failing feature tests that were timing-dependent when interacting with Chosen.js select dropdowns. Changes: - Rewrote select_from_chosen helper to use JavaScript instead of simulating clicks - Increased Capybara.default_max_wait_time to 5 seconds for JS tests - Added explicit waits for Chosen dropdown initialization - Used select_from_chosen helper consistently across tests The new approach directly sets select values via JavaScript and triggers Chosen's update events, avoiding race conditions from clicking and typing into the animated dropdown UI. All 777 tests now pass consistently with seed 63863.
Suppress Puma startup messages during test runs to reduce noise and make test output easier to read.
Configure parallel test execution to speed up CI builds and local test runs. ## Changes - Add parallel_tests gem for running tests concurrently - Configure database.yml to support TEST_ENV_NUMBER for parallel databases - Update GitHub Actions workflow to run tests across 4 parallel runners - Configure SimpleCov to merge coverage results from parallel runs ## Local Usage Run tests in parallel with 4 processes: ``` bundle exec parallel_rspec spec/ -n 4 ``` Run with a specific seed: ``` bundle exec parallel_rspec spec/ -n 4 -o '--seed 1234' ``` One-time setup (creates test, test2, test3, test4 databases): ``` bundle exec rake parallel:setup ``` ## Performance Local verification shows 1.84x speedup (162s → 88s) with identical coverage results (95.19%). Expected similar speedup in CI.
47d6c53 to
81bfd15
Compare
b46da18 to
0f0012a
Compare
Configure SimpleCov to generate unique coverage files for each parallel CI runner and merge them for reporting. Changes: - Detect CI parallel execution via CI_NODE_INDEX environment variable - Generate unique command names (RSpec-0, RSpec-1, etc.) per runner - Preserve resultset files immediately after test completion - Merge all resultsets in separate coverage job before reporting Local parallel execution still works using TEST_ENV_NUMBER detection.
0f0012a to
dcd620a
Compare
Improves CI speedup from 1.84x to 2.35x based on local testing. Each runner now handles ~17 specs instead of ~26.
Collaborator
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.


The branch for this PR was branched from #2453, please review and merge that one first and then rebase this one.
Summary
Changes
Local Usage
Run tests in parallel:
bundle exec parallel_rspec spec/ -n 4Run with specific seed:
One-time setup:
bundle exec rake parallel:setupPerformance
Local verification shows 1.84x speedup (162s → 88s) with identical coverage results (95.19%).
Expected similar speedup in CI pipeline.
Test Plan