javadba javadba - 8 months ago 93
Scala Question

How to set System property for a scalatest from sbt command line

A ScalaTest suite is using


What is the sbt command line to achieve this setting?

I have tried

SBT_OPTS="" sbt "test-only <path to test suite"


JAVA_OPTS="" sbt "test-only <path to test suite"


sbt/sbt '; set javaOptions in Test +="-Dtest.num.points=500000"; \
project mllib; test-only org.apache.spark.mllib.optimization.LBFGSSuite'

When using any of those attempts the System.getProperty comes up blank.

An approach that does work is running the ScalaTest from within Intellij and setting the JVM parameters to within the Run Configuration.

Answer Source

Your third way almost works (if fork in Test := true is set). But you have to change into the project first:

sbt/sbt  '; project mllib; set javaOptions in Test  +="-Dtest.num.points=500000"; \
test-only org.apache.spark.mllib.optimization.LBFGSSuite'