Skip to content

Conversation

@mroderick
Copy link
Collaborator

@mroderick mroderick commented Feb 1, 2026

The branch for this PR was branched from #2453, please review and merge that one first and then rebase this one.

Summary

  • Silence Puma output during tests for cleaner output
  • Add parallel test execution (4 processes) for faster CI builds and local test runs
  • Configure SimpleCov to merge coverage from parallel runs

Changes

  • Puma configuration: Suppress startup messages in test environment
  • parallel_tests gem: Enable concurrent test execution
  • database.yml: Support TEST_ENV_NUMBER for parallel databases
  • GitHub Actions: Run tests across 4 parallel runners with matrix strategy
  • SimpleCov: Configure to merge coverage results from all parallel processes

Local Usage

Run tests in parallel:

bundle exec parallel_rspec spec/ -n 4

Run with specific seed:

bundle exec parallel_rspec spec/ -n 4 -o '--seed 1234'

One-time setup:

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 pipeline.

Test Plan

  • Verified parallel tests run successfully locally
  • Confirmed coverage results match serial execution (95.19%)
  • Tested with same seed across parallel processes
  • Monitor first CI run for parallel execution success

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.
@mroderick mroderick marked this pull request as draft February 1, 2026 14:52
@mroderick mroderick force-pushed the speedup-ci-tests branch 3 times, most recently from b46da18 to 0f0012a Compare February 1, 2026 15:22
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.
Improves CI speedup from 1.84x to 2.35x based on local testing.
Each runner now handles ~17 specs instead of ~26.
@mroderick mroderick marked this pull request as ready for review February 1, 2026 16:40
@mroderick
Copy link
Collaborator Author

Before

image

After

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant