Reputation: 16143
My tests are run sequential with the option parallelExecution in Test := false
.
It seems the execution order of the tests is not necessarily the order of the tests within my class file. Is this observation correct and if yes, is there a way to specify the execution order?
Upvotes: 3
Views: 1020
Reputation: 15557
There are 2 levels of parallelization. The first one is to execute classes in parallel when using sbt. This can be deactivated with the sbt setting you mention. The second one is to execute examples in parallel inside specs2.
You can run specs2 examples sequentially by adding the sequential
argument at the beginning of your specification:
class MySpec extends mutable.Specification {
sequential
...
}
class MySpec extends Specification { def is = sequential ^ """
...
"""
}
or add it to your sbt build file:
testOptions in Test += Tests.Argument(TestFrameworks.Specs2, "sequential")
Upvotes: 4