Skip to content

test: enable RSpec --profile to surface slowest package tests#3176

Merged
justin808 merged 1 commit intomainfrom
jg/3132-rspec-profile
Apr 20, 2026
Merged

test: enable RSpec --profile to surface slowest package tests#3176
justin808 merged 1 commit intomainfrom
jg/3132-rspec-profile

Conversation

@justin808
Copy link
Copy Markdown
Member

@justin808 justin808 commented Apr 18, 2026

Summary

  • Uncomments config.profile_examples = 10 in react_on_rails/spec/react_on_rails/spec_helper.rb so each run prints the 10 slowest examples.
  • Enables data-driven optimization of the ~24 minute package test suite — prerequisite for targeted perf work on generator tests, redundant before(:all) blocks, etc.

Fixes #3132

Test plan

  • bundle exec rubocop react_on_rails/spec/react_on_rails/spec_helper.rb — no offenses
  • Ran a sample spec file (utils_spec.rb) locally; confirmed "Top 10 slowest examples" block appears at the end of the run
  • CI green

🤖 Generated with Claude Code


Note

Low Risk
Low risk: test-only configuration change that only affects RSpec output and adds minor runtime overhead from collecting timings.

Overview
Enables RSpec profiling in react_on_rails/spec/react_on_rails/spec_helper.rb by turning on config.profile_examples = 10, so each spec run reports the 10 slowest examples/example groups to help target test-suite performance work.

Reviewed by Cursor Bugbot for commit 82417ab. Bugbot is set up for automated code reviews on this repo. Configure here.

Summary by CodeRabbit

  • Tests
    • Enhanced test performance profiling to identify and report the slowest test cases during spec runs.

Uncomments config.profile_examples = 10 in spec_helper so each test
run prints the 10 slowest examples, enabling data-driven optimization
of the ~24 minute package test suite.

Fixes #3132

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 18, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ad6f2b17-2f3c-4728-bc94-fc2bac8acbca

📥 Commits

Reviewing files that changed from the base of the PR and between c4d8687 and 82417ab.

📒 Files selected for processing (1)
  • react_on_rails/spec/react_on_rails/spec_helper.rb

Walkthrough

A single RSpec configuration setting was uncommented in the test helper to enable performance profiling. The config.profile_examples = 10 directive now activates automatic reporting of the 10 slowest test examples upon each spec run completion, providing visibility into performance bottlenecks without modifying test logic.

Changes

Cohort / File(s) Summary
RSpec Profiling Configuration
react_on_rails/spec/react_on_rails/spec_helper.rb
Uncommented config.profile_examples = 10 to enable automatic profiling output showing the 10 slowest test examples after spec runs.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

A rabbit hops through testing grounds so slow,
"Which tests are sluggish? Let the profiles show!"
Ten slowest examples now printed with care,
Performance secrets revealed in the air. 🐇✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: uncommenting RSpec profiling configuration to enable display of slowest tests.
Linked Issues check ✅ Passed The PR fully implements the objective from issue #3132 by uncommenting config.profile_examples = 10 in spec_helper.rb.
Out of Scope Changes check ✅ Passed All changes are directly related to enabling RSpec profiling as specified in issue #3132; no out-of-scope modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch jg/3132-rspec-profile

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 18, 2026

Greptile Summary

This PR uncomments a single line — config.profile_examples = 10 — in the package RSpec helper, enabling RSpec's built-in profiler to surface the 10 slowest examples and example groups after every run. It is a non-breaking, diagnostic-only change with no effect on test correctness or CI pass/fail behaviour.

Confidence Score: 5/5

Safe to merge — single diagnostic config line with no impact on test correctness or CI outcomes.

The only changed line enables RSpec's built-in profiling output; it cannot cause test failures and has no side effects on the test suite results themselves.

No files require special attention.

Important Files Changed

Filename Overview
react_on_rails/spec/react_on_rails/spec_helper.rb Uncomments config.profile_examples = 10 to print the 10 slowest RSpec examples at the end of each test run; no logic or correctness issues.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[bundle exec rspec] --> B[Run all specs]
    B --> C{config.profile_examples = 10}
    C -->|Enabled after this PR| D[Record per-example timing]
    D --> E[Print normal pass/fail summary]
    E --> F[Print Top 10 slowest examples]
    F --> G[Print Top 10 slowest groups]
    C -->|Was commented out before| H[Print normal pass/fail summary only]
Loading

Reviews (1): Last reviewed commit: "test: enable RSpec --profile to surface ..." | Re-trigger Greptile

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Apr 18, 2026

Review: Enable RSpec --profile in spec_helper

Overall: Clean, low-risk change. Uncomments config.profile_examples = 10 so the 10 slowest examples are reported at the end of every run — useful prereq for targeting the ~24-minute suite.

Code quality

  • The comment de-nesting (removing the extra # indent from the surrounding block) is correct — the lines were previously formatted as if they were inside a commented-out if block, which was misleading.
  • The active line is correctly indented at two spaces inside RSpec.configure do |config|.

Consistency gap

react_on_rails_pro/spec/react_on_rails_pro/spec_helper.rb still has config.profile_examples = 10 commented out (line 115). If the goal is data-driven perf work across the whole suite, enabling it there too would give a complete picture. Not a blocker, but worth a follow-up.

No concerns

  • No performance regression risk: timing collection adds negligible overhead.
  • react_on_rails/lib/generators/react_on_rails/templates/dev_tests/spec/spec_helper.rb already ships with this enabled, so the change is consistent with existing precedent.
  • No CI config changes needed — config.profile_examples outputs to stdout via the existing formatter.

Verdict: Approve. The pro-package helper inconsistency is minor and can be a follow-up.

@justin808 justin808 merged commit 23c1234 into main Apr 20, 2026
26 checks passed
@justin808 justin808 deleted the jg/3132-rspec-profile branch April 20, 2026 03:46
justin808 added a commit that referenced this pull request Apr 23, 2026
…ons-docs

* origin/main:
  chore: remove redundant --rsc-pro install generator flag (#3105)
  ci: warn (don't fail) on Bencher main regression (#3168)
  test: enable RSpec --profile to surface slowest package tests (#3176)
  fix(node-renderer): expose performance in VM context when supportModules (#3158)
  docs: remove stale immediate_hydration references (#3139) (#3159)
  docs: restore absolute URL for node-renderer testing example (#3179)
  Bump Rspack dependencies to v2 (^2.0.0-0) (#3084)
  chore: remove obsolete webpack <5.106.0 pin (#3175)
  Move Node Renderer entry point to renderer/ directory (#3165)
  docs: address RSC pitfalls review follow-ups (#3155) (#3156)
  docs: remove fabricated DevConsole reference, link verified RSC tools (#2527) (#3163)

# Conflicts:
#	docs/oss/building-features/node-renderer/js-configuration.md
justin808 added a commit that referenced this pull request Apr 23, 2026
…ging' into jg/3122-rolling-deploy-adapter

* origin/jg/3122-unify-renderer-cache-staging: (39 commits)
  fix(specs): boot dummy specs without readline and drop redundant pnpm workspace (#3190)
  docs: add RSC migration success stories page (#1985) (#3162)
  Fix Bencher reporting permanently broken on pushes to main (#3148)
  docs: add example migrations guide (#3126)
  docs: remove defunct guavapass.com reference (#3199)
  chore: remove redundant --rsc-pro install generator flag (#3105)
  ci: warn (don't fail) on Bencher main regression (#3168)
  test: enable RSpec --profile to surface slowest package tests (#3176)
  fix(node-renderer): expose performance in VM context when supportModules (#3158)
  docs: remove stale immediate_hydration references (#3139) (#3159)
  docs: restore absolute URL for node-renderer testing example (#3179)
  Bump Rspack dependencies to v2 (^2.0.0-0) (#3084)
  chore: remove obsolete webpack <5.106.0 pin (#3175)
  Move Node Renderer entry point to renderer/ directory (#3165)
  docs: address RSC pitfalls review follow-ups (#3155) (#3156)
  docs: remove fabricated DevConsole reference, link verified RSC tools (#2527) (#3163)
  Scaffold CI workflow and build scripts for first-run consistency (#3097)
  Add OPTIONAL triage tier and fix recommendations to /address-review (#3161)
  chore: sync Gemfile.lock with term-ansicolor 1.11.3 (#3164)
  Simplify the docs sidebar and Pro landing pages (#3119)
  ...
justin808 added a commit that referenced this pull request Apr 23, 2026
* origin/main:
  fix(specs): boot dummy specs without readline and drop redundant pnpm workspace (#3190)
  docs: add RSC migration success stories page (#1985) (#3162)
  Fix Bencher reporting permanently broken on pushes to main (#3148)
  docs: add example migrations guide (#3126)
  docs: remove defunct guavapass.com reference (#3199)
  chore: remove redundant --rsc-pro install generator flag (#3105)
  ci: warn (don't fail) on Bencher main regression (#3168)
  test: enable RSpec --profile to surface slowest package tests (#3176)
  fix(node-renderer): expose performance in VM context when supportModules (#3158)
  docs: remove stale immediate_hydration references (#3139) (#3159)
  docs: restore absolute URL for node-renderer testing example (#3179)
  Bump Rspack dependencies to v2 (^2.0.0-0) (#3084)
  chore: remove obsolete webpack <5.106.0 pin (#3175)
  Move Node Renderer entry point to renderer/ directory (#3165)
  docs: address RSC pitfalls review follow-ups (#3155) (#3156)

# Conflicts:
#	CHANGELOG.md
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.

Enable RSpec --profile to identify slowest package tests

1 participant