You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@systemds.apache.org by ma...@apache.org on 2020/09/29 14:08:45 UTC
[systemds] 02/02: [MINOR][TESTS] Added flags to toggle GPU and
stats from command line. Also: * Used EXCEPTION_EXPECTED instead of "true"
with one test case because it makes the code clearer and silences a
warning.
This is an automated email from the ASF dual-hosted git repository.
markd pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/systemds.git
commit 77010bf4f77b7ee09595e7562bc72b043e0c1f9b
Author: Mark Dokter <ma...@dokter.cc>
AuthorDate: Tue Sep 29 16:06:10 2020 +0200
[MINOR][TESTS] Added flags to toggle GPU and stats from command line. Also:
* Used EXCEPTION_EXPECTED instead of "true" with one test case because it makes the code clearer and silences a warning.
---
pom.xml | 1 +
src/test/java/org/apache/sysds/test/AutomatedTestBase.java | 8 +++++++-
.../apache/sysds/test/functions/unary/scalar/ExponentTest.java | 2 +-
3 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/pom.xml b/pom.xml
index 403a345..39b6cff 100644
--- a/pom.xml
+++ b/pom.xml
@@ -53,6 +53,7 @@
<jacoco.skip>true</jacoco.skip>
<automatedtestbase.outputbuffering>false</automatedtestbase.outputbuffering>
<argLine>-Xms4g -Xmx4g -Xmn400m</argLine>
+ <enableStats>false</enableStats>
</properties>
<repositories>
diff --git a/src/test/java/org/apache/sysds/test/AutomatedTestBase.java b/src/test/java/org/apache/sysds/test/AutomatedTestBase.java
index 4e8cdcd..fffe6fe 100644
--- a/src/test/java/org/apache/sysds/test/AutomatedTestBase.java
+++ b/src/test/java/org/apache/sysds/test/AutomatedTestBase.java
@@ -99,7 +99,7 @@ public abstract class AutomatedTestBase {
public static final boolean EXCEPTION_NOT_EXPECTED = false;
// By default: TEST_GPU is set to false to allow developers without Nvidia GPU to run integration test suite
- public static final boolean TEST_GPU = false;
+ public static boolean TEST_GPU = false;
public static final double GPU_TOLERANCE = 1e-9;
public static final int FED_WORKER_WAIT = 1000; // in ms
@@ -170,6 +170,8 @@ public abstract class AutomatedTestBase {
protected static final boolean DEBUG = false;
+ public static boolean VERBOSE_STATS = false;
+
protected String fullDMLScriptName; // utilize for both DML and PyDML, should probably be renamed.
// protected String fullPYDMLScriptName;
protected String fullRScriptName;
@@ -209,6 +211,8 @@ public abstract class AutomatedTestBase {
e.printStackTrace();
}
outputBuffering = Boolean.parseBoolean(properties.getProperty("automatedtestbase.outputbuffering"));
+ TEST_GPU = Boolean.parseBoolean(properties.getProperty("enableGPU"));
+ VERBOSE_STATS = Boolean.parseBoolean(properties.getProperty("enableStats"));
}
// Timestamp before test start.
@@ -1292,6 +1296,8 @@ public abstract class AutomatedTestBase {
if(TEST_GPU)
args.add("-gpu");
+ if(VERBOSE_STATS)
+ args.add("-stats");
}
public static int getRandomAvailablePort() {
diff --git a/src/test/java/org/apache/sysds/test/functions/unary/scalar/ExponentTest.java b/src/test/java/org/apache/sysds/test/functions/unary/scalar/ExponentTest.java
index 7bda276..ecd26e0 100644
--- a/src/test/java/org/apache/sysds/test/functions/unary/scalar/ExponentTest.java
+++ b/src/test/java/org/apache/sysds/test/functions/unary/scalar/ExponentTest.java
@@ -205,7 +205,7 @@ public class ExponentTest extends AutomatedTestBase
createHelperMatrix();
- runTest(true, LanguageException.class);
+ runTest(EXCEPTION_EXPECTED, LanguageException.class);
}
}