Add parallel test execution for local development#2598
Open
mroderick wants to merge 3 commits intocodebar:masterfrom
Open
Add parallel test execution for local development#2598mroderick wants to merge 3 commits intocodebar:masterfrom
mroderick wants to merge 3 commits intocodebar:masterfrom
Conversation
Only enable SimpleCov when COVERAGE=true is set. This: - Speeds up local test runs (no coverage overhead) - Avoids coverage file conflicts when running parallel tests locally - Allows parallel test execution without coverage merging complexity Coverage is still enabled in CI by setting COVERAGE=true in the workflow. Also adds proper parallel test support for coverage merging when TEST_ENV_NUMBER is set (by parallel_tests gem) or CI_NODE_INDEX (for GitHub Actions matrix strategy).
Set COVERAGE=true in GitHub Actions workflow to enable SimpleCov coverage reporting in CI. This works with the conditional SimpleCov loading in spec_helper.rb.
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
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.
Summary
This PR introduces parallel test execution for local development, significantly reducing test runtime.
Changes
1. Added
make testtarget to MakefileRuns tests in parallel using 3 processes (optimal for this codebase):
2. Made SimpleCov conditional on COVERAGE environment variable
COVERAGE=trueCOVERAGE=trueset, so coverage reporting continues to work3. Added parallel test support for coverage merging
When
TEST_ENV_NUMBERis set (by parallel_tests gem) orCI_NODE_INDEX(GitHub Actions), coverage results are properly namespaced for merging.4. Updated AGENTS.md documentation
make testfor parallel test executionCOVERAGE=truebin/drspecreferencePerformance Results
bundle exec rspecmake testUsage
Notes
-n 3(3 processes) was chosen as optimal for this codebase. Higher values don't provide significant additional speedup due to database contention.