Really useful for separating tests running in different CI builds.
I usually define a tags.scala which contains the tag definitions:
Then tag tests like this:
Then from the sbt console to run only the unit tests:
"test-only -- -n com.ojha.UnitTest"
To run everything except integration tests:
"test-only -- -l com.ojha.IntegrationTest"
I usually define a tags.scala which contains the tag definitions:
package com.ojha
import org.scalatest.Tag
object UnitTest extends Tag("com.ojha.UnitTest")
object IntegrationTest extends Tag("com.ojha.IntegrationTest")
Then tag tests like this:
it should "be a cat" taggedAs UnitTest in {
}
Then from the sbt console to run only the unit tests:
"test-only -- -n com.ojha.UnitTest"
To run everything except integration tests:
"test-only -- -l com.ojha.IntegrationTest"
No comments:
Post a Comment