scala - Compile tests with SBT and package them to be run later -


im working sbt , play! framework. have commit stage in our pipeline publish artifactory our binaries. binaries generated dist task. pipeline runs smoke , acceptance tests written in scala. run sbt.

what want compile smoke , acceptance tests binary , publish them artifactory. allow pipeline download these binaries (the test suites) , run them, instead of recompiling them every time, takes long time.

i tried sbt test:compile generates jar, cant find way run tests.

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 how enable it

// enable publishing jar produced `test:package` publishartifact in (test, packagebin) := true  // enable publishing test api jar publishartifact in (test, packagedoc) := true  // enable publishing test sources jar publishartifact in (test, packagesrc) := true 

source: http://www.scala-sbt.org/release/docs/detailed-topics/artifacts

run test

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

where pipeline.jar test artifact receive pipeline

or can setup test projet via sbt

http://www.scala-sbt.org/release/docs/detailed-topics/testing.html


Comments