Reputation: 9648
I use sbt 0.13.5.
I'd like to execute tests on a machine and given they're successful move the project to another machine and rerun them without compilation.
I tried sbt testOnly package_1 package_2
but it didn't work.
These are the steps of what I am trying to do:
sbt clean compile
. If I execute sbt testOnly myTest1
on this machine, it works fine.target
target
directory on this machine.)Upvotes: 0
Views: 458
Reputation: 74619
I think you won't be able to execute tests without some subset of build definition, i.e. you don't have all the dependencies of the project under tests. What's inside target
is just the compiled sources you wrote in the project - there are no test libraries. sbt won't help you without helping sbt itself first.
You may mimic what sbt does with transitively downloading test
and compile
dependencies, but it's far too much work comparing to copying the build definition to the other machine.
What may work is to have build.sbt
and target
directory in a single (semi)project on the other machine. sbt test
should work fine then (don't use clean
for obvious reasons).
Upvotes: 0