I have many disappointments trying to run all my tests from sbt - with the exception of a specific tag. Here is what I am trying to run:
testOnly * -- -l "com.my.project.path.tags.ValidationTest"
I tried many variations of this command, including replacing * with a class path or package path as follows:
testOnly "com.my.project.path.somePackage" -- -l "com.my.project.path.tags.ValidationTest"
And I tried using without quotes around the package.
I just read that testOnly used in the new version of sbt , not test-only . I tried this syntax (and many variations) and nothing works. My tests are configured as follows:
"some method" should "fail when doing something" taggedAs ValidationTest in { ... }
I have an object ValidationTest extends Tag("com.my.project.path.tags.ValidationTest") defined in TestTag.scala .
I also tried to do this when the method is defined using the it keyword instead of "some method" should "fail..."
Sbt with ScalaTest shows the following in the section "Include and Exclude Tagged Tests"
> test-only org.acme.* -- -n CheckinTests > test-only org.acme.* -- -n FunctionalTests -l org.scalatest.tags.Slow > test-only org.acme.* -- -n "CheckinTests FunctionalTests" -l "org.scalatest.tags.Slow org.scalatest.tags.Network"
source share