Skip to content

Feat/rspec test runner - #534

Closed
cosgroveb wants to merge 10 commits into
rtk-ai:developfrom
cosgroveb:feat/rspec-test-runner
Closed

cosgroveb wants to merge 10 commits into
rtk-ai:developfrom
cosgroveb:feat/rspec-test-runner

Conversation

@cosgroveb

Copy link
Copy Markdown

Summary

  • Add rtk rspec command. Parses rspec JSON output, shows failures and pending tests only (87% reduction for me)
  • Falls back to regex when JSON isn't available, passthrough when neither works
  • Handles rspec, bundle exec rspec, and any flags
  • Hook rewrite rules included

Test plan

  • JSON parsing, regex fallback, passthrough, edge cases
  • Token savings at least 87% verified against real rspec output
  • Smoke test in test-all.sh (skips when rspec not installed)
  • cargo fmt --all --check passes
  • cargo clippy --all-targets clean
  • All existing tests still pass

cosgroveb and others added 10 commits March 12, 2026 11:23
Signed-off-by: Brian Cosgrove <[email protected]>
Signed-off-by: Brian Cosgrove <[email protected]>
Adds conditional rspec test to test-all.sh (skips when rspec not installed).
Fixes 'skip' to 'skip_test' for Graphite test.

Signed-off-by: Brian Cosgrove <[email protected]>
navidemad added a commit to navidemad/rtk that referenced this pull request Mar 19, 2026
Unifies 5 competing PRs (rtk-ai#198, rtk-ai#292, rtk-ai#379, rtk-ai#534, rtk-ai#643) into a single
coherent implementation.

New commands:
- rtk rspec: JSON parsing with text fallback (60%+ savings)
- rtk rubocop: JSON parsing, group by cop/severity (60%+ savings)
- rtk rake test: Minitest state machine parser (85-90% savings)
- rtk bundle install: TOML filter, strip Using lines (90%+ savings)

Shared infrastructure: ruby_exec(), fallback_tail(),
exit_code_from_output(), count_tokens() in utils.rs.

Discover/rewrite rules for rspec, rubocop, rake, rails, bundle
including bundle exec and bin/ variants.

56 new unit tests + 4 inline TOML tests. All 1035 tests passing.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
navidemad added a commit to navidemad/rtk that referenced this pull request Mar 19, 2026
Unifies 5 competing PRs (rtk-ai#198, rtk-ai#292, rtk-ai#379, rtk-ai#534, rtk-ai#643) into a single
coherent implementation.

New commands:
- rtk rspec: JSON parsing with text fallback (60%+ savings)
- rtk rubocop: JSON parsing, group by cop/severity (60%+ savings)
- rtk rake test: Minitest state machine parser (85-90% savings)
- rtk bundle install: TOML filter, strip Using lines (90%+ savings)

Shared infrastructure: ruby_exec(), fallback_tail(),
exit_code_from_output(), count_tokens() in utils.rs.

Discover/rewrite rules for rspec, rubocop, rake, rails, bundle
including bundle exec and bin/ variants.

E2E smoke tests (scripts/test-ruby.sh) covering all 4 commands.
56 new unit tests + 4 inline TOML tests. All 1035 tests passing.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Signed-off-by: Navid EMAD <[email protected]>
@navidemad

Copy link
Copy Markdown
Contributor

Hey @cosgroveb — I created a unified PR at #724 that merges all 5 competing Ruby implementations (#198, #292, #379, #534, #643).

Your improved format flag detection is incorporated — specifically the handling of -fj, -fjson, -fdocumentation, and --format=... patterns that the other PRs missed, along with your 4 dedicated tests.

Thanks for catching those edge cases!

@cosgroveb

Copy link
Copy Markdown
Author

Perfect

@cosgroveb cosgroveb closed this Mar 19, 2026
@cosgroveb

Copy link
Copy Markdown
Author

Closed in favor of #724

pszymkowiak pushed a commit that referenced this pull request Mar 19, 2026
…724)

* feat(ruby): add Ruby on Rails support (rspec, rubocop, rake, bundle)

Unifies 5 competing PRs (#198, #292, #379, #534, #643) into a single
coherent implementation.

New commands:
- rtk rspec: JSON parsing with text fallback (60%+ savings)
- rtk rubocop: JSON parsing, group by cop/severity (60%+ savings)
- rtk rake test: Minitest state machine parser (85-90% savings)
- rtk bundle install: TOML filter, strip Using lines (90%+ savings)

Shared infrastructure: ruby_exec(), fallback_tail(),
exit_code_from_output(), count_tokens() in utils.rs.

Discover/rewrite rules for rspec, rubocop, rake, rails, bundle
including bundle exec and bin/ variants.

E2E smoke tests (scripts/test-ruby.sh) covering all 4 commands.
56 new unit tests + 4 inline TOML tests. All 1035 tests passing.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Signed-off-by: Navid EMAD <[email protected]>

* fix(ruby): use TEST= env var for rake single-file test in smoke tests

Rails' `rake test` ignores positional file args; use `TEST=path` syntax.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Signed-off-by: Navid EMAD <[email protected]>

* docs(ruby): add Ruby module architecture and update attribution

Integrate ARCHITECTURE.md Ruby Module Architecture section and CLAUDE.md
module table/fork-features from PR #643. Update PR description attribution.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Signed-off-by: Navid EMAD <[email protected]>

* chore: remove PULL_REQUEST_DESCRIPTION.md from repo

PR description lives on GitHub, no need to track in the codebase.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Signed-off-by: Navid EMAD <[email protected]>

---------

Signed-off-by: Navid EMAD <[email protected]>
Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
romualdbassinot-efficy pushed a commit to romualdbassinot-efficy/rtk that referenced this pull request Apr 10, 2026
…tk-ai#724)

* feat(ruby): add Ruby on Rails support (rspec, rubocop, rake, bundle)

Unifies 5 competing PRs (rtk-ai#198, rtk-ai#292, rtk-ai#379, rtk-ai#534, rtk-ai#643) into a single
coherent implementation.

New commands:
- rtk rspec: JSON parsing with text fallback (60%+ savings)
- rtk rubocop: JSON parsing, group by cop/severity (60%+ savings)
- rtk rake test: Minitest state machine parser (85-90% savings)
- rtk bundle install: TOML filter, strip Using lines (90%+ savings)

Shared infrastructure: ruby_exec(), fallback_tail(),
exit_code_from_output(), count_tokens() in utils.rs.

Discover/rewrite rules for rspec, rubocop, rake, rails, bundle
including bundle exec and bin/ variants.

E2E smoke tests (scripts/test-ruby.sh) covering all 4 commands.
56 new unit tests + 4 inline TOML tests. All 1035 tests passing.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Signed-off-by: Navid EMAD <[email protected]>

* fix(ruby): use TEST= env var for rake single-file test in smoke tests

Rails' `rake test` ignores positional file args; use `TEST=path` syntax.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Signed-off-by: Navid EMAD <[email protected]>

* docs(ruby): add Ruby module architecture and update attribution

Integrate ARCHITECTURE.md Ruby Module Architecture section and CLAUDE.md
module table/fork-features from PR rtk-ai#643. Update PR description attribution.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Signed-off-by: Navid EMAD <[email protected]>

* chore: remove PULL_REQUEST_DESCRIPTION.md from repo

PR description lives on GitHub, no need to track in the codebase.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Signed-off-by: Navid EMAD <[email protected]>

---------

Signed-off-by: Navid EMAD <[email protected]>
Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
thehoff pushed a commit to thehoff/contextcrawler that referenced this pull request May 14, 2026
…tk-ai#724)

* feat(ruby): add Ruby on Rails support (rspec, rubocop, rake, bundle)

Unifies 5 competing PRs (rtk-ai#198, rtk-ai#292, rtk-ai#379, rtk-ai#534, rtk-ai#643) into a single
coherent implementation.

New commands:
- rtk rspec: JSON parsing with text fallback (60%+ savings)
- rtk rubocop: JSON parsing, group by cop/severity (60%+ savings)
- rtk rake test: Minitest state machine parser (85-90% savings)
- rtk bundle install: TOML filter, strip Using lines (90%+ savings)

Shared infrastructure: ruby_exec(), fallback_tail(),
exit_code_from_output(), count_tokens() in utils.rs.

Discover/rewrite rules for rspec, rubocop, rake, rails, bundle
including bundle exec and bin/ variants.

E2E smoke tests (scripts/test-ruby.sh) covering all 4 commands.
56 new unit tests + 4 inline TOML tests. All 1035 tests passing.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Signed-off-by: Navid EMAD <[email protected]>

* fix(ruby): use TEST= env var for rake single-file test in smoke tests

Rails' `rake test` ignores positional file args; use `TEST=path` syntax.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Signed-off-by: Navid EMAD <[email protected]>

* docs(ruby): add Ruby module architecture and update attribution

Integrate ARCHITECTURE.md Ruby Module Architecture section and CLAUDE.md
module table/fork-features from PR rtk-ai#643. Update PR description attribution.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Signed-off-by: Navid EMAD <[email protected]>

* chore: remove PULL_REQUEST_DESCRIPTION.md from repo

PR description lives on GitHub, no need to track in the codebase.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Signed-off-by: Navid EMAD <[email protected]>

---------

Signed-off-by: Navid EMAD <[email protected]>
Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
thehoff pushed a commit to thehoff/contextcrawler that referenced this pull request May 14, 2026
…tk-ai#724)

* feat(ruby): add Ruby on Rails support (rspec, rubocop, rake, bundle)

Unifies 5 competing PRs (rtk-ai#198, rtk-ai#292, rtk-ai#379, rtk-ai#534, rtk-ai#643) into a single
coherent implementation.

New commands:
- rtk rspec: JSON parsing with text fallback (60%+ savings)
- rtk rubocop: JSON parsing, group by cop/severity (60%+ savings)
- rtk rake test: Minitest state machine parser (85-90% savings)
- rtk bundle install: TOML filter, strip Using lines (90%+ savings)

Shared infrastructure: ruby_exec(), fallback_tail(),
exit_code_from_output(), count_tokens() in utils.rs.

Discover/rewrite rules for rspec, rubocop, rake, rails, bundle
including bundle exec and bin/ variants.

E2E smoke tests (scripts/test-ruby.sh) covering all 4 commands.
56 new unit tests + 4 inline TOML tests. All 1035 tests passing.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Signed-off-by: Navid EMAD <[email protected]>

* fix(ruby): use TEST= env var for rake single-file test in smoke tests

Rails' `rake test` ignores positional file args; use `TEST=path` syntax.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Signed-off-by: Navid EMAD <[email protected]>

* docs(ruby): add Ruby module architecture and update attribution

Integrate ARCHITECTURE.md Ruby Module Architecture section and CLAUDE.md
module table/fork-features from PR rtk-ai#643. Update PR description attribution.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Signed-off-by: Navid EMAD <[email protected]>

* chore: remove PULL_REQUEST_DESCRIPTION.md from repo

PR description lives on GitHub, no need to track in the codebase.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Signed-off-by: Navid EMAD <[email protected]>

---------

Signed-off-by: Navid EMAD <[email protected]>
Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
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.

2 participants