How to fork the jvm for each test in sbt

前端 未结 2 1692
[愿得一人]
[愿得一人] 2021-01-11 13:24

I am working with some classes that (for some reason) can only be used once within a single VM. My test cases work if I run them individually (fork := true) ena

2条回答
  •  天命终不由人
    2021-01-11 13:44

    Using non-deprecated syntax:

    testGrouping in Test := (definedTests in Test).value map { test =>
      Tests.Group(name = test.name, tests = Seq(test), runPolicy = Tests.SubProcess(
        ForkOptions(
          javaHome.value,
          outputStrategy.value,
          Nil,
          Some(baseDirectory.value),
          javaOptions.value,
          connectInput.value,
          envVars.value
        )))
    }
    

提交回复
热议问题