Skip to content

Commit

Permalink
Fix parallel_rspec runtime grouping and artifact handling; streamline…
Browse files Browse the repository at this point in the history
… artifact download and test result combination
  • Loading branch information
Janell-Huyck committed Jan 27, 2025
1 parent a9aefc9 commit c7913fe
Showing 1 changed file with 14 additions and 46 deletions.
60 changes: 14 additions & 46 deletions .github/workflows/run-rspec-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ jobs:
- name: Generate Runtime Log
run: |
mkdir -p tmp
COVERAGE=false bundle exec rspec \
--format ParallelTests::RSpec::RuntimeLogger \
--out tmp/parallel_runtime_rspec.log --pattern 'spec/**/*_spec.rb'
bundle exec rspec --format ParallelTests::RSpec::RuntimeLogger --out tmp/parallel_runtime_rspec.log --pattern 'spec/**/*_spec.rb'
- name: Debug Runtime Log
run: |
Expand Down Expand Up @@ -76,11 +74,9 @@ jobs:

- name: Run Tests for Job Index ${{ matrix.job_index }}
run: |
TEST_ENV_NUMBER=${{ matrix.job_index }} bundle exec parallel_rspec --group-by runtime --only-group ${{ matrix.job_index }} \
-- \
TEST_ENV_NUMBER=${{ matrix.job_index }} bundle exec parallel_rspec --group-by runtime --only-group ${{ matrix.job_index }} -- \
--format RspecJunitFormatter --out tmp/test_results/result-${{ matrix.job_index }}.xml \
|| TEST_ENV_NUMBER=${{ matrix.job_index }} bundle exec parallel_rspec --group-by filesize --only-group ${{ matrix.job_index }} \
-- \
|| TEST_ENV_NUMBER=${{ matrix.job_index }} bundle exec parallel_rspec --group-by filesize --only-group ${{ matrix.job_index }} -- \
--format RspecJunitFormatter --out tmp/test_results/result-${{ matrix.job_index }}.xml
env:
COVERALLS_PARALLEL: true
Expand Down Expand Up @@ -113,25 +109,11 @@ jobs:
uses: actions/checkout@v3

- name: Download Partial Test Results
uses: actions/download-artifact@v4
with:
name: test-results-0
path: tmp/test_results
- name: Download Partial Test Results 1
uses: actions/download-artifact@v4
with:
name: test-results-1
path: tmp/test_results
- name: Download Partial Test Results 2
uses: actions/download-artifact@v4
with:
name: test-results-2
path: tmp/test_results
- name: Download Partial Test Results 3
uses: actions/download-artifact@v4
with:
name: test-results-3
path: tmp/test_results
run: |
mkdir -p tmp/test_results
for i in 0 1 2 3; do
actions/download-artifact@v4 --name test-results-${i} --path tmp/test_results || exit 1
done
- name: Combine Test Results
run: |
Expand All @@ -144,26 +126,12 @@ jobs:
name: combined-test-results
path: coverage/combined_results.xml

- name: Download Partial Coverage 0
uses: actions/download-artifact@v4
with:
name: coverage-0
path: coverage/lcov
- name: Download Partial Coverage 1
uses: actions/download-artifact@v4
with:
name: coverage-1
path: coverage/lcov
- name: Download Partial Coverage 2
uses: actions/download-artifact@v4
with:
name: coverage-2
path: coverage/lcov
- name: Download Partial Coverage 3
uses: actions/download-artifact@v4
with:
name: coverage-3
path: coverage/lcov
- name: Download Partial Coverage Files
run: |
mkdir -p coverage/lcov
for i in 0 1 2 3; do
actions/download-artifact@v4 --name coverage-${i} --path coverage/lcov || exit 1
done
- name: Combine Coverage Files
run: |
Expand Down

0 comments on commit c7913fe

Please sign in to comment.