kalix-jvm-sdk
kalix-jvm-sdk copied to clipboard
New scheme for integration tests in Scala
Now that the IntegrationTest config in sbt is deprecated we need a different way to run integration tests, preferably allowing to run them separately from unit tests.
The sbt recommendation is to create separate submodules for integration tests only, which works fine for regular Scala project but seems cumbersome for Kalix projects that would now need to become multi-module.
On the other hand if we come up with our own scheme, we'll have to be careful to choose something that IDEs will understand. Maybe we could rely on Scalatest tags? (https://www.scalatest.org/user_guide/tagging_your_tests)
Turns out I remembered incorrectly that we used IntegrationTests config in the samples, we don't. So this really is about running tests selectively.
testOnly *Integration* works for running only the integration tests, and turns out we already have a separate sbt setting called onlyUnitTest for running only the unit tests (https://github.com/lightbend/kalix-jvm-sdk/blob/3c1e145f45a20d4140b044bb8c7a98e8d7d8e0c0/sbt-plugin/src/main/scala/kalix/sbt/KalixPlugin.scala#L46)