我正在使用SBT和Play!框架。目前,我们在我们的管道中有一个提交阶段,我们在这个阶段发布我们的二进制文件。二进制文件是使用dist任务生成的。然后管道运行冒烟和验收测试,这些测试是用scala编写的。它们是通过sbt运行的。
我想要做的是编译冒烟和验收测试以及二进制文件,并将它们发布到artifactory。这将允许管道下载这些二进制文件(测试套件)并运行它们,而不是每次都重新编译它们,这需要很长时间。
我尝试了sbt test:compile来生成jar,但是我找不到一种方法来运行测试。
发布于 2013-05-07 07:55:00
sbt不在工件中发布测试
publishArtifact in GlobalScope in Test:== false以下是启用它的方法
// 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来源:http://www.scala-sbt.org/release/docs/Detailed-Topics/Artifacts
运行测试
scala -classpath pipeline.jar classpath scalatest-<version>.jar org.scalatest.tools.Runner -p compiled_tests其中pipeline.jar是从管道接收的测试工件
或者您可以通过sbt设置一个测试项目
http://www.scala-sbt.org/release/docs/Detailed-Topics/Testing.html
https://stackoverflow.com/questions/16389446
复制相似问题