Last active
March 28, 2019 21:41
-
-
Save lancegatlin/d7e4a9b50ff3d1c75b4c014bcfbb90fe to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sbt.Keys._ | |
import sbt._ | |
object IntegrationTest { | |
// Select integration tests that use local running resources | |
lazy val IntgLocalTest = config("intg_local") extend Test | |
// Select integration test that connect to dev env | |
lazy val IntgDevTest = config("intg_dev") extend Test | |
// Select all integration tests | |
lazy val IntgTest = config("intg") extend Test | |
lazy val configs = Seq(IntgLocalTest, IntgDevTest, IntgTest) | |
val settings : Seq[Def.Setting[_]] = | |
inConfig(IntgDevTest)(Defaults.testTasks) ++ | |
inConfig(IntgLocalTest)(Defaults.testTasks) ++ | |
inConfig(IntgTest)(Defaults.testTasks) ++ | |
Seq( | |
// exclude integration tests in Test | |
testOptions in Test := Seq( | |
Tests.Argument(TestFrameworks.ScalaTest, "-l","IntgTest"), | |
Tests.Argument(TestFrameworks.ScalaTest, "-l","IntgLocalTest"), | |
Tests.Argument(TestFrameworks.ScalaTest, "-l","IntgDevTest") | |
), | |
// only run tagged tests in IntgTest, IntgLocalTest and IntgDevTest | |
testOptions in IntgLocalTest := Seq( | |
Tests.Argument(TestFrameworks.ScalaTest, "-n","IntgLocalTest") | |
), | |
testOptions in IntgDevTest := Seq( | |
Tests.Argument(TestFrameworks.ScalaTest, "-n","IntgDevTest") | |
), | |
testOptions in IntgTest := Seq( | |
Tests.Argument(TestFrameworks.ScalaTest, "-n","IntgTest") | |
), | |
// don't run integration tests in parallel since they use external resources | |
parallelExecution in IntgTest := false, | |
parallelExecution in IntgDevTest := false, | |
parallelExecution in IntgLocalTest := false | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment