You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@asterixdb.apache.org by mb...@apache.org on 2019/02/16 00:23:09 UTC
[asterixdb] 06/08: [NO ISSUE][TEST] Use unique directory for
external library tests
This is an automated email from the ASF dual-hosted git repository.
mblow pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/asterixdb.git
commit d9850dc6063755991dd477a340660e3c74638aed
Author: Michael Blow <mb...@apache.org>
AuthorDate: Fri Feb 15 17:36:33 2019 -0500
[NO ISSUE][TEST] Use unique directory for external library tests
Enables external library tests on hosts w/ a shared home directory
Change-Id: I575cfc79f4df831783ce6551ae691d73410ca878
Reviewed-on: https://asterix-gerrit.ics.uci.edu/3211
Reviewed-by: Michael Blow <mb...@apache.org>
Tested-by: Michael Blow <mb...@apache.org>
---
.../org/apache/asterix/test/runtime/ExecutionTestUtil.java | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/runtime/ExecutionTestUtil.java b/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/runtime/ExecutionTestUtil.java
index 4ed36c6..b4c5b26 100644
--- a/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/runtime/ExecutionTestUtil.java
+++ b/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/runtime/ExecutionTestUtil.java
@@ -18,6 +18,8 @@
*/
package org.apache.asterix.test.runtime;
+import static org.apache.hyracks.util.file.FileUtil.joinPath;
+
import java.io.File;
import java.nio.file.Paths;
import java.util.ArrayList;
@@ -41,6 +43,15 @@ public class ExecutionTestUtil {
protected static final Logger LOGGER = LogManager.getLogger();
+ static {
+ // hack to ensure we have a unique location for external libraries in our tests (asterix cluster has a shared home directory)
+ String appHome = joinPath(System.getProperty("app.home", System.getProperty("user.home")),
+ "appHome" + (int) (Math.random() * Integer.MAX_VALUE));
+ LOGGER.info("setting app.home to {}", appHome);
+ System.setProperty("app.home", appHome);
+ new File(appHome).deleteOnExit();
+ }
+
protected static final String PATH_ACTUAL = "rttest" + File.separator;
public static TestGroup FailedGroup;