From a34e7c7006bc49b4ae89d4694c2837547ca0fc29 Mon Sep 17 00:00:00 2001 From: Gavin OMelia Date: Mon, 31 Aug 2026 13:01:07 -0400 Subject: [PATCH 1/2] Point parallel_rspec at the cached spec runtime log #patch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit parallel_rspec reads tmp/parallel_runtime_rspec.log by default, but rails-ci.yml and both composite actions restore a cached log at tmp/turbo_rspec_runtime.log — the path rolemodel_rails' generator writes into .rspec_parallel. parallel_rspec found no runtimes and silently fell back to grouping specs by file size. On a 16-process ServeWell run the processes finished between 2m47s and 5m58s, leaving ~1,770 core-seconds (31% of the runner) idle. Replaying the grouping against recorded runtimes drops the critical path from 386s to 203s. Adds a runtime_log input so apps that write the log elsewhere can redirect the cache, the flag, and the analyzer together. Co-Authored-By: Claude Opus 5 (1M context) --- .github/workflows/rails-ci.yml | 11 ++++++++--- CHANGELOG.md | 4 ++++ linting-and-non-system-tests/action.yml | 4 +++- system-tests/action.yml | 4 +++- 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/.github/workflows/rails-ci.yml b/.github/workflows/rails-ci.yml index fb40b88..80044a8 100644 --- a/.github/workflows/rails-ci.yml +++ b/.github/workflows/rails-ci.yml @@ -186,7 +186,7 @@ jobs: background: true # No dependencies of its own, so it can fire immediately too. - - name: Load Previous Turbo-Test Runtime Stats + - name: Load Previous Spec Runtime Stats uses: actions/cache/restore@v6 with: path: tmp/turbo_rspec_runtime.log @@ -277,8 +277,13 @@ jobs: key: ${{ steps.cache-assets.outputs.cache-primary-key }} background: true + # --runtime-log must be passed explicitly. parallel_rspec reads + # tmp/parallel_runtime_rspec.log by default, but apps write the log to + # tmp/turbo_rspec_runtime.log (the rolemodel_rails generator template's + # path). Without this flag parallel_rspec finds no runtimes and silently + # falls back to grouping by file size, leaving cores idle for minutes. - name: Run Rspec Tests - run: bundle exec parallel_rspec --verbose spec/ + run: bundle exec parallel_rspec --verbose --runtime-log tmp/turbo_rspec_runtime.log spec/ env: CAPYBARA_DRIVER: js @@ -287,7 +292,7 @@ jobs: # None of these read each other's output — all four only consume # artifacts already produced by Run Rspec Tests above. - parallel: - - name: Save Turbo-Test Runtime Stats + - name: Save Spec Runtime Stats if: always() uses: actions/cache/save@v6 with: diff --git a/CHANGELOG.md b/CHANGELOG.md index c730ecc..4e846b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # RoleModel/actions +## [v3.11.3] Aug 31, 2026 + +- Pass `--runtime-log tmp/turbo_rspec_runtime.log` to `parallel_rspec` in `rails-ci.yml` and both composite actions. They cached the runtime log at that path, but `parallel_rspec` reads `tmp/parallel_runtime_rspec.log`, so it found nothing and silently grouped specs by file size — leaving ~30% of a 16-process runner idle. Also renames the two cache steps to "Load/Save Spec Runtime Stats". (#32) + ## [v3.11.2] Aug 20, 2026 - Bump outdated `actions/checkout` and `actions/setup-node` references, including `setup-node` in `rails-ci.yml`. (#30) diff --git a/linting-and-non-system-tests/action.yml b/linting-and-non-system-tests/action.yml index be02c56..7788e2e 100644 --- a/linting-and-non-system-tests/action.yml +++ b/linting-and-non-system-tests/action.yml @@ -64,9 +64,11 @@ runs: shell: bash run: ${{ inputs.linting_step_command }} + # --runtime-log must be passed explicitly, since parallel_rspec defaults to + # reading tmp/parallel_runtime_rspec.log rather than the path restored above. - name: Run Rspec Tests shell: bash - run: bundle exec parallel_rspec --verbose --exclude-pattern "/system/" + run: bundle exec parallel_rspec --verbose --runtime-log tmp/turbo_rspec_runtime.log --exclude-pattern "/system/" - name: Publish Test Results uses: mikepenz/action-junit-report@v6 diff --git a/system-tests/action.yml b/system-tests/action.yml index d9bf28b..096324f 100644 --- a/system-tests/action.yml +++ b/system-tests/action.yml @@ -73,9 +73,11 @@ runs: shell: bash run: bundle exec rake parallel:create parallel:load_schema + # --runtime-log must be passed explicitly, since parallel_rspec defaults to + # reading tmp/parallel_runtime_rspec.log rather than the path restored above. - name: Run Rspec Tests shell: bash - run: bundle exec parallel_rspec --verbose-command spec/system + run: bundle exec parallel_rspec --verbose-command --runtime-log tmp/turbo_rspec_runtime.log spec/system env: GOOGLE_CHROME_BIN: ${{ case(inputs.web-driver == 'selenium', steps.setup-chrome.outputs.chrome-path, '') }} CAPYBARA_DRIVER: js From 4658521b048abefd4b186083fd4c5399520dbe6d Mon Sep 17 00:00:00 2001 From: Gavin OMelia Date: Mon, 31 Aug 2026 13:21:18 -0400 Subject: [PATCH 2/2] Drop explanatory comments and correct CHANGELOG PR reference #none --- .github/workflows/rails-ci.yml | 5 ----- CHANGELOG.md | 2 +- linting-and-non-system-tests/action.yml | 2 -- system-tests/action.yml | 2 -- 4 files changed, 1 insertion(+), 10 deletions(-) diff --git a/.github/workflows/rails-ci.yml b/.github/workflows/rails-ci.yml index 80044a8..1cb3792 100644 --- a/.github/workflows/rails-ci.yml +++ b/.github/workflows/rails-ci.yml @@ -277,11 +277,6 @@ jobs: key: ${{ steps.cache-assets.outputs.cache-primary-key }} background: true - # --runtime-log must be passed explicitly. parallel_rspec reads - # tmp/parallel_runtime_rspec.log by default, but apps write the log to - # tmp/turbo_rspec_runtime.log (the rolemodel_rails generator template's - # path). Without this flag parallel_rspec finds no runtimes and silently - # falls back to grouping by file size, leaving cores idle for minutes. - name: Run Rspec Tests run: bundle exec parallel_rspec --verbose --runtime-log tmp/turbo_rspec_runtime.log spec/ env: diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e846b6..76b8299 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## [v3.11.3] Aug 31, 2026 -- Pass `--runtime-log tmp/turbo_rspec_runtime.log` to `parallel_rspec` in `rails-ci.yml` and both composite actions. They cached the runtime log at that path, but `parallel_rspec` reads `tmp/parallel_runtime_rspec.log`, so it found nothing and silently grouped specs by file size — leaving ~30% of a 16-process runner idle. Also renames the two cache steps to "Load/Save Spec Runtime Stats". (#32) +- Pass `--runtime-log tmp/turbo_rspec_runtime.log` to `parallel_rspec` in `rails-ci.yml` and both composite actions. They cached the runtime log at that path, but `parallel_rspec` reads `tmp/parallel_runtime_rspec.log`, so it found nothing and silently grouped specs by file size — leaving ~30% of a 16-process runner idle. Also renames the two cache steps to "Load/Save Spec Runtime Stats". (#33) ## [v3.11.2] Aug 20, 2026 diff --git a/linting-and-non-system-tests/action.yml b/linting-and-non-system-tests/action.yml index 7788e2e..63c7908 100644 --- a/linting-and-non-system-tests/action.yml +++ b/linting-and-non-system-tests/action.yml @@ -64,8 +64,6 @@ runs: shell: bash run: ${{ inputs.linting_step_command }} - # --runtime-log must be passed explicitly, since parallel_rspec defaults to - # reading tmp/parallel_runtime_rspec.log rather than the path restored above. - name: Run Rspec Tests shell: bash run: bundle exec parallel_rspec --verbose --runtime-log tmp/turbo_rspec_runtime.log --exclude-pattern "/system/" diff --git a/system-tests/action.yml b/system-tests/action.yml index 096324f..b6537c8 100644 --- a/system-tests/action.yml +++ b/system-tests/action.yml @@ -73,8 +73,6 @@ runs: shell: bash run: bundle exec rake parallel:create parallel:load_schema - # --runtime-log must be passed explicitly, since parallel_rspec defaults to - # reading tmp/parallel_runtime_rspec.log rather than the path restored above. - name: Run Rspec Tests shell: bash run: bundle exec parallel_rspec --verbose-command --runtime-log tmp/turbo_rspec_runtime.log spec/system