Skip to content

fix(sbt): filter testOnly/testQuick like sbt test - #3140

Merged
aeppling merged 5 commits into
developfrom
fix/sbt-testonly-filter
Jul 22, 2026
Merged

aeppling merged 5 commits into
developfrom
fix/sbt-testonly-filter

Conversation

@aeppling

Copy link
Copy Markdown
Contributor

Follow-up to #752, reported by @greenhost87: sbt testOnly fell through to passthrough (0% savings) and the rewrite rule never matched it.

Routes testOnly/testQuick (bare, scoped, and quoted forms like sbt "testOnly com.example.MySpec") through the existing test filter, and extends the rewrite rule to match them.

@max-leuthaeuser

max-leuthaeuser commented Jul 22, 2026 •

Copy link
Copy Markdown

Did you also test these?

sbt "testOnly *MySuite -- -n Tag" // select tests with a specific tag
sbt "testOnly *MySuite -- -z foo" // run only the tests whose name includes the substring "foo".
sbt "testOnly *MySuite -- -t foo" // run only the test whose name matches "foo" exactly.

@randomBrainstormer

randomBrainstormer commented Jul 22, 2026 •

Copy link
Copy Markdown
Contributor

Nice one @aeppling — I'd taken a run at this too (#3139, now closed) and you got there with a cleaner version. Really glad you handled the quoted form; sbt "testOnly ..." is how most people actually pass a spec, so it's much better having that covered here than left as a follow-up.

The one thing mine had that this doesn't is a small README touch, so testOnly shows up next to sbt test in the supported-commands list:

rtk sbt test                    # ScalaTest output (-90%)
rtk sbt testOnly com.example.X  # Single/selective tests, same filter (-90%)
rtk sbt compile                 # Compilation errors only (-75%)

No worries if you'd rather keep this PR focused, I'm happy to send it as a tiny docs PR once this lands.

@aeppling

Copy link
Copy Markdown
Contributor Author

@max-leuthaeuser yes verified and test added
@randomBrainstormer you can create a pr, not a blocker this is not really user facing docs since agent run this seamless

@aeppling
aeppling merged commit 194f392 into develop Jul 22, 2026
26 of 27 checks passed
@github-actions github-actions Bot mentioned this pull request Jul 22, 2026
@KuSh
KuSh deleted the fix/sbt-testonly-filter branch July 22, 2026 14:18
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.

4 participants