sbt testOnly not working

For sbt 1.5.2, this worked:

sbt "project dbm; testOnly my.package.TestClass"


From sbt you can try to get the autocompletion for the command:

sbt:my-project> testOnly <tab>

When running from command line (so outside the sbt prompt), for example in continuous integration, or other scripts etc., then you take the command in quotes including the argument, like this:

sbt "testOnly my.package.TheClassTest"

Otherwise testOnly does not seem to receive the argument.


From sbt you can try to get the autocompletion for the command:

sbt:my-project> testOnly <tab>

It should display the lists of tests classes that are available. This may not work with the oldest versions of sbt.

If you see no classes, try to run test:compile before to compile your test classes.