How to measure and display the running time of a single test?

后端 未结 2 2013
醉梦人生
醉梦人生 2021-02-04 12:20

I have a potentially long-running test written with scalatest:

test(\"a long running test\") {
  failAfter(Span(60, Seconds)) {
    // ...
  }
}
         


        
2条回答
  •  情深已故
    2021-02-04 12:46

    In addition to r.v.'s answer: If you have multiproject builds the testOptions in Test += Tests.Argument("-oD") does not work on root level in build.sbt, because Test refers to src/test/scala. You have to put it inside your Sub-Project settings

    Project(id = "da_project", base = file("da_project"))
        .settings(
            testOptions in Test += Tests.Argument("-oDG"),
            libraryDependencies ++= Seq(
                ...
            )
        )
    

提交回复
热议问题