Skip to content

[codex] fix native test expression passthrough - #1

Closed
allanbatista wants to merge 1 commit into
developfrom
codex/fix-native-test-expression
Closed

allanbatista wants to merge 1 commit into
developfrom
codex/fix-native-test-expression

Conversation

@allanbatista

Copy link
Copy Markdown
Owner

What changed

  • Detect native POSIX test expressions passed through rtk test, such as rtk test -d graphify-out.
  • Route those expressions to the system test command via passthrough.
  • Keep regular RTK test filtering intact for commands like rtk test cargo test.
  • Add regression coverage and a changelog entry.

Problem

rtk test -d graphify-out failed with:

sh: 0: Illegal option -d

Running test -d graphify-out directly worked.

Root cause

test is also an RTK subcommand. Clap correctly routed rtk test -d graphify-out to Commands::Test, but that handler joined the remaining args into a string and executed it through sh -c for RTK's test-output filtering.

That produced sh -c "-d graphify-out". POSIX sh interpreted -d as an option to the shell command itself, not as an argument to test, which caused Illegal option -d.

Proposed solution

When Commands::Test receives a native test expression (-d, -f, !, (, etc.), bypass the RTK test-output wrapper and run the system test command directly with the original arguments. This keeps shell parsing out of the path and preserves the native test exit semantics.

Validation

  • rtk cargo +1.91.0 fmt --all && rtk cargo +1.91.0 clippy --all-targets && rtk cargo +1.91.0 test --all
  • rtk proxy ./target/debug/rtk test -d .
  • rtk proxy ./target/debug/rtk test -d graphify-out
  • rtk proxy ./target/debug/rtk test true

@coderabbitai

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b3249ce8-6a31-4bc8-940f-57e1c26b055b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-native-test-expression

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.

@allanbatista

Copy link
Copy Markdown
Owner Author

Closed in favor of upstream PR: rtk-ai#2515

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