2

When I execute sbt testOnly *JoinTest* no tests are found and the following output is shown, but com.typesafe.slick.testkit.tests.JoinTest should have been executed:

testOnly *JoinTest*
[info] Compiling 1 Scala source to /ext/git/slick/slick-testkit/target/scala-2.10/test-classes...
[info] Passed: Total 0, Failed 0, Errors 0, Passed 0
[info] No tests to run for testkit/test:testOnly
LuGo
  • 4,877
  • 1
  • 18
  • 19

2 Answers2

3

You're so close. Try this instead:

testOnly -- *JoinTest*

The -- allows you test send arguments to the test kit. Without that it's expecting a list of JUnit tests. More info here.

Tim Gautier
  • 29,150
  • 5
  • 46
  • 53
  • 2
    it gets better, not only can you run a single test, you can run that test against a single database as well: `test-only -- *MyTest*h2mem*` And if you want a debug dump then append: `-Dlog.qcomp.phases=debug -Dscala.slick.ansiDump=true`. Talk about an undocumented feature! After scouring the net finally found this gem from der Zeiger: https://github.com/slick/slick/issues/818#issuecomment-44819119 – virtualeyes Mar 25 '16 at 11:03
0

every time when I had a class called as yours .JoinTest to lunch / run all the tests from it I just wrote:

testOnly *.JoinTest

link from sbt 0.13 with details about this

additional if you want to run a specific test case from that class you can use the following command

testOnly *.JoinTest -- -z "test name you want to run"

to discover other commands that you can use with -- you can take a look at this link

Ionut
  • 486
  • 3
  • 6