You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by sr...@apache.org on 2015/06/16 22:10:21 UTC

spark git commit: [SPARK-8126] [BUILD] Make sure temp dir exists when running tests.

Repository: spark
Updated Branches:
  refs/heads/master 4bd10fd50 -> cebf24118


[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 <va...@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.


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/cebf2411
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/cebf2411
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/cebf2411

Branch: refs/heads/master
Commit: cebf2411847706a98dc8df9c754ef53d6d12a87c
Parents: 4bd10fd
Author: Marcelo Vanzin <va...@cloudera.com>
Authored: Tue Jun 16 21:10:18 2015 +0100
Committer: Sean Owen <so...@cloudera.com>
Committed: Tue Jun 16 21:10:18 2015 +0100

----------------------------------------------------------------------
 project/SparkBuild.scala | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/cebf2411/project/SparkBuild.scala
----------------------------------------------------------------------
diff --git a/project/SparkBuild.scala b/project/SparkBuild.scala
index 41b7eba..b7a3490 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(


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org