diff options
author | Marcelo Vanzin <vanzin@cloudera.com> | 2015-04-11 13:10:01 +0100 |
---|---|---|
committer | Sean Owen <sowen@cloudera.com> | 2015-04-11 13:10:01 +0100 |
commit | 694aef0d71d2683eaf63cbd1d8e95c2da423b72e (patch) | |
tree | fbdb664127faed8239519d15cd854b567a8a4e84 /project/SparkBuild.scala | |
parent | 95a07591b3e23782a7021ef2bbf07a67a1e4a83a (diff) | |
download | spark-694aef0d71d2683eaf63cbd1d8e95c2da423b72e.tar.gz spark-694aef0d71d2683eaf63cbd1d8e95c2da423b72e.tar.bz2 spark-694aef0d71d2683eaf63cbd1d8e95c2da423b72e.zip |
[hotfix] [build] Make sure JAVA_HOME is set for tests.
This is needed at least for YARN integration tests, since `$JAVA_HOME` is used to launch the executors.
Author: Marcelo Vanzin <vanzin@cloudera.com>
Closes #5441 from vanzin/yarn-test-test and squashes the following commits:
3eeec30 [Marcelo Vanzin] Use JAVA_HOME when available, java.home otherwise.
d71f1bb [Marcelo Vanzin] And sbt too.
6bda399 [Marcelo Vanzin] WIP: Testing to see whether this fixes the yarn test issue.
Diffstat (limited to 'project/SparkBuild.scala')
-rw-r--r-- | project/SparkBuild.scala | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/project/SparkBuild.scala b/project/SparkBuild.scala index d3faa551a4..5f51f4b58f 100644 --- a/project/SparkBuild.scala +++ b/project/SparkBuild.scala @@ -119,7 +119,9 @@ object SparkBuild extends PomBuild { lazy val publishLocalBoth = TaskKey[Unit]("publish-local", "publish local for m2 and ivy") lazy val sharedSettings = graphSettings ++ genjavadocSettings ++ Seq ( - javaHome := Properties.envOrNone("JAVA_HOME").map(file), + javaHome := sys.env.get("JAVA_HOME") + .orElse(sys.props.get("java.home").map { p => new File(p).getParentFile().getAbsolutePath() }) + .map(file), incOptions := incOptions.value.withNameHashing(true), retrieveManaged := true, retrievePattern := "[type]s/[artifact](-[revision])(-[classifier]).[ext]", @@ -426,8 +428,10 @@ object TestSettings { fork := true, // Setting SPARK_DIST_CLASSPATH is a simple way to make sure any child processes // launched by the tests have access to the correct test-time classpath. - envVars in Test += ("SPARK_DIST_CLASSPATH" -> - (fullClasspath in Test).value.files.map(_.getAbsolutePath).mkString(":").stripSuffix(":")), + envVars in Test ++= Map( + "SPARK_DIST_CLASSPATH" -> + (fullClasspath in Test).value.files.map(_.getAbsolutePath).mkString(":").stripSuffix(":"), + "JAVA_HOME" -> sys.env.get("JAVA_HOME").getOrElse(sys.props("java.home"))), javaOptions in Test += "-Dspark.test.home=" + sparkHome, javaOptions in Test += "-Dspark.testing=1", javaOptions in Test += "-Dspark.port.maxRetries=100", |