3

The default behavior for ScalaTest is to "run different suites in parallel, but the tests of any one suite sequentially." See ParallelTestExecution.

How do I constrain a set of Suites, maybe using a SuiteMixin, to all run sequentially? This related answer says to "enable forking but disable parallel execution." How do I do this with the gradle test runner?

My use case is specifically around running a set of SparkSession based integration test suites under gradle.

Peter Stephens
  • 1,040
  • 1
  • 9
  • 23

1 Answers1

4

Look at SequentialNestedSuiteExecution.

Sequential provides a concrete implementation of it.

rancidfishbreath
  • 3,944
  • 2
  • 30
  • 44
  • Looks like I need to study how nested suites work. Right now all my suites are independent stand alone suites all mixing in my TestSparkSession SuiteMixin which provides the Spark session. Was hoping I could annotate this mixin to declare these suites "sequential". – Peter Stephens Sep 23 '17 at 16:05
  • 2
    This question and answer would be more helpful, if we could add an example. The high-level example in the ScalaTest-doc is putting me in the same place as @PeterStephens -- quite lost, and on a journey to self enlightenment, without a clear way forward. In particular, where would I put the Suites that Sequential would execute, to avoid having them get executed themselves, when testing the entire project? – Rick Moritz Jan 19 '18 at 15:12