diff options
author | Marcelo Vanzin <vanzin@cloudera.com> | 2015-06-16 21:10:18 +0100 |
---|---|---|
committer | Sean Owen <sowen@cloudera.com> | 2015-06-16 21:10:18 +0100 |
commit | cebf2411847706a98dc8df9c754ef53d6d12a87c (patch) | |
tree | 48ef530aa025511b4d5480307d8842dc08236d35 /project/SparkBuild.scala | |
parent | 4bd10fd5090fb5f4f139267b82e9f2fc15659796 (diff) | |
download | spark-cebf2411847706a98dc8df9c754ef53d6d12a87c.tar.gz spark-cebf2411847706a98dc8df9c754ef53d6d12a87c.tar.bz2 spark-cebf2411847706a98dc8df9c754ef53d6d12a87c.zip |
[SPARK-8126] [BUILD] Make sure temp dir exists when running tests.
If you ran "clean" at the top-level sbt project, the temp dir would
go away, so running "test" without restarting sbt would fail. This
fixes that by making sure the temp dir exists before running tests.
Author: Marcelo Vanzin <vanzin@cloudera.com>
Closes #6805 from vanzin/SPARK-8126-fix and squashes the following commits:
12d7768 [Marcelo Vanzin] [SPARK-8126] [build] Make sure temp dir exists when running tests.
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 41b7eba3a0..b7a3490787 100644 --- a/project/SparkBuild.scala +++ b/project/SparkBuild.scala @@ -53,9 +53,6 @@ object BuildCommons { val sparkHome = buildLocation val testTempDir = s"$sparkHome/target/tmp" - if (!new File(testTempDir).isDirectory()) { - require(new File(testTempDir).mkdirs()) - } } object SparkBuild extends PomBuild { @@ -526,6 +523,13 @@ object TestSettings { libraryDependencies += "com.novocode" % "junit-interface" % "0.9" % "test", // Only allow one test at a time, even across projects, since they run in the same JVM parallelExecution in Test := false, + // Make sure the test temp directory exists. + resourceGenerators in Test <+= resourceManaged in Test map { outDir: File => + if (!new File(testTempDir).isDirectory()) { + require(new File(testTempDir).mkdirs()) + } + Seq[File]() + }, concurrentRestrictions in Global += Tags.limit(Tags.Test, 1), // Remove certain packages from Scaladoc scalacOptions in (Compile, doc) := Seq( |