title: How to pass environment variables to a sbt test build step in Jenkins?
body: <p>In my scala test, I read an environemnt variable via <code>sys.props.getOrElse("cassandra.test.host", DEFAULT_CASSANDRA_TEST_HOST)</code>.</p>
  
  <p>The tests are run via Jenkins.</p>
  
  <p>I have added a <code>Build using sbt</code> as a build step.</p>
  
  <p>By looking at similar questions on SO, I came up with this solution - i.e. setting the Actions field to:</p>
  
  <p><code>'; set javaOptions += "-Dcassandra.test.host=XX.XXX.XXX.XXX"; test'</code></p>
  
  <p>But it doesnt work. No variable is set when <code>Properties.envOrElse</code> is executed.</p>
  
  <p>The Jenkins console output contains:</p>
  
  <p><code>
  [...]
  [util-sessionizer] $ java -jar /usr/local/bin/sbt-launch.jar '; set javaOptions += "-Dcassandra.test.host=XX.XXX.XXX.XXX"; test'
  [info] Loading project definition from /jenkins/workspace/util-sessionizer/project/project
  [info] Loading project definition from /jenkins/workspace/util-sessionizer/project
  [info] Set current project to util-sessionizer (in build file:/jenkins/workspace/util-sessionizer/)
  [info] Defining *:javaOptions
  [info] The new value will be used by *:runner, compile:run::runner and 4 others.
  [info]  Run `last` for details.
  [info] Reapplying settings...
  [...]
  </code></p>