【问题标题】:How to order execution of tests in sbt?如何在 sbt 中命令执行测试?
【发布时间】:2017-01-02 13:40:30
【问题描述】:

请建议如何在 sbt 中控制测试/规范执行顺序的最佳方法?

有没有像runOrder in maven-sirefire-plugin这样的选项

【问题讨论】:

    标签: scala sbt


    【解决方案1】:

    当然,并行执行不能明确,但顺序可以解决:

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

    【讨论】:

      【解决方案2】:

      不,not with parallel execution。您可以要求测试类按adding sequential 到其声明的开头顺序运行其案例。

      【讨论】:

        猜你喜欢
        • 2012-10-07
        • 2014-12-17
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2010-10-07
        • 1970-01-01
        • 1970-01-01
        • 2020-01-16
        相关资源
        最近更新 更多