scala - How can I run tests against jar built by sbt-assembly -
I am running sbt-assembly to create a single jar file that can be deployed elsewhere. I'd like to run your test against this local file against this jar file against. Local. Running against class files is the default with sbt test
, but I want to test the jar instead (but without adding a test class file in jar)
You need a configuration to create an assembly jar in the exam
Import AssemblyKeys._Project.inConfig (TestAssembly) in Base (javascript) (BaseAssemblySettings): = "$ {name.value} -test - $ {version.value} .jar"
< P> So now you experiment with uber-test: assembly though I do not know the easy way to run tests with this jar from SBT. I would like to go for a custom command, like test: run-test-assembly which will do something internally scala-classpath uber-jar-test.jar classpath scalatest- & lt; Version & gt; .jar org.scalatest.tools.Runner -p compiled_tests
Testing is going on during SBT-assembly assembly phase, but I am pretty sure that it is doing again, nevertheless Classes have not been packed. You probably want them to exit from assembly stage
test (test, assembly): = {}
Comments
Post a Comment