iota-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tonyfaust...@apache.org
Subject [10/10] incubator-iota git commit: Adding cleanup after all tests executed
Date Thu, 21 Jul 2016 23:38:01 GMT
Adding cleanup after all tests executed


Project: http://git-wip-us.apache.org/repos/asf/incubator-iota/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-iota/commit/2acc7fc8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-iota/tree/2acc7fc8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-iota/diff/2acc7fc8

Branch: refs/heads/master
Commit: 2acc7fc8756eb8c12c6cb9e93db2424cda7c479d
Parents: b21fb6b
Author: Barbara Gomes <barbaramaltagomes@gmail.com>
Authored: Thu Jul 21 13:54:49 2016 -0700
Committer: Barbara Gomes <barbaramaltagomes@gmail.com>
Committed: Thu Jul 21 13:54:49 2016 -0700

----------------------------------------------------------------------
 project/BuildSettings.scala | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/2acc7fc8/project/BuildSettings.scala
----------------------------------------------------------------------
diff --git a/project/BuildSettings.scala b/project/BuildSettings.scala
index 17bb264..c2013b1 100644
--- a/project/BuildSettings.scala
+++ b/project/BuildSettings.scala
@@ -63,7 +63,17 @@ object BuildSettings {
     },
     //All tests on Fey are integrated tests.
     //All tests need to be execute sequentially
-    parallelExecution in Test := false
+    parallelExecution in Test := false,
+    testOptions in Test += Tests.Cleanup( () => {
+      println("CLenning up")
+      removeAll("/tmp/fey/test")
+      def removeAll(path: String) = {
+        def getRecursively(f: File): Seq[File] =
+          f.listFiles.filter(_.isDirectory).flatMap(getRecursively) ++ f.listFiles
+        getRecursively(new File(path)).foreach{f =>
+          if (!f.delete()) println(s"could not delete ${f.getAbsolutePath}")}
+      }
+    })
   )
 
   lazy val StreambuildSettings = Defaults.coreDefaultSettings ++ Seq(


Mime
View raw message