Skip to content

[2.x] feat: Support ... as testOnly pattern#8577

Merged
eed3si9n merged 3 commits intosbt:developfrom
byteforge38:feat/testonly-ellipsis-pattern
Jan 19, 2026
Merged

[2.x] feat: Support ... as testOnly pattern#8577
eed3si9n merged 3 commits intosbt:developfrom
byteforge38:feat/testonly-ellipsis-pattern

Conversation

@byteforge38
Copy link
Copy Markdown
Contributor

Fixes #8576

Problem

Currently testOnly supports glob expressions like **:

testOnly **.SomethingTest

However, ** is inconvenient from Bash because Bash itself expands the glob expression, requiring users to quote the pattern.

Solution

Support ... as an alias for ** by substituting ... with ** before applying the glob filter. This allows users to write:

$ sbt --client testOnly ...SomethingTest

Changes

  • IncrementalTest.scala: Added expandGlob function that replaces ... with **, applied to both include and exclude patterns in selectedFilter
  • Defaults.scala: Applied expandGlob in distinctParser for tab completion matching

Testing

  • Added unit tests in SelectedFilterTest.scala for expandGlob and ... pattern matching
  • Added scripted test cases in tests/test-exclude for end-to-end verification

Checklist

  • Compiles successfully
  • scalafmtCheckAll passes
  • Tests added (unit + scripted)

Copy link
Copy Markdown
Member

@eed3si9n eed3si9n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. Thanks for adding the tests!

@byteforge38
Copy link
Copy Markdown
Contributor Author

@eed3si9n It says that replaceAllLiterally has deprecated, could you please check it?

@byteforge38
Copy link
Copy Markdown
Contributor Author

All CI checks have passed now

@eed3si9n eed3si9n merged commit c5af677 into sbt:develop Jan 19, 2026
14 checks passed
@eed3si9n
Copy link
Copy Markdown
Member

Landed.

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.

Support ... as testOnly pattern

2 participants