Compile tests with SBT and package them to be run later

≯℡__Kan透↙ 提交于 2019-11-28 10:05:49
Guillaume Massé

sbt dont publish test in artifacts

publishArtifact in GlobalScope in Test:== false

source: https://github.com/sbt/sbt/blob/a7413f6415687f32e6365598680f3bb8545c46b5/main/src/main/scala/sbt/Defaults.scala#L1118

this is how to enable it

// enable publishing the jar produced by `test:package`
publishArtifact in (Test, packageBin) := true

// enable publishing the test API jar
publishArtifact in (Test, packageDoc) := true

// enable publishing the test sources jar
publishArtifact in (Test, packageSrc) := true

source: http://www.scala-sbt.org/release/docs/Detailed-Topics/Artifacts

run the test

scala -classpath pipeline.jar classpath scalatest-<version>.jar org.scalatest.tools.Runner -p compiled_tests

where pipeline.jar is the test artifact you receive from the pipeline

or you can setup a test projet via sbt

http://www.scala-sbt.org/release/docs/Detailed-Topics/Testing.html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!