How to order execution of tests in sbt?

后端 未结 2 1914
猫巷女王i
猫巷女王i 2020-12-20 03:16

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

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

2条回答
  •  悲&欢浪女
    2020-12-20 03:48

    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)
    }
    

提交回复
热议问题