2

Please suggest best approach how to control order of test/spec execution in sbt?

Is there any option like runOrder in maven-sirefire-plugin

Andriy Plokhotnyuk
  • 7,497
  • 2
  • 39
  • 62

2 Answers2

4

Sure, it cannot be done clearly for parallel execution, but it solvable for sequential:

parallelExecution in test := false

testGrouping <<= definedTests in Test map { tests =>
  tests.map { test =>
    import Tests._
    new Group(
      name = test.name,
      tests = Seq(test),
      runPolicy = InProcess)
  }.sortWith(_.name < _.name)
}
Andriy Plokhotnyuk
  • 7,497
  • 2
  • 39
  • 62
1

Nope, not with parallel execution. You can ask a test class to run its cases sequentially by adding sequential to the beginning of its declaration.

Community
  • 1
  • 1
Francois G
  • 11,485
  • 50
  • 57