Skip to content

Commit 77010bf

Browse files
committed
[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.
1 parent 5461f42 commit 77010bf

3 files changed

Lines changed: 9 additions & 2 deletions

File tree

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
<jacoco.skip>true</jacoco.skip>
5454
<automatedtestbase.outputbuffering>false</automatedtestbase.outputbuffering>
5555
<argLine>-Xms4g -Xmx4g -Xmn400m</argLine>
56+
<enableStats>false</enableStats>
5657
</properties>
5758

5859
<repositories>

src/test/java/org/apache/sysds/test/AutomatedTestBase.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public abstract class AutomatedTestBase {
9999
public static final boolean EXCEPTION_NOT_EXPECTED = false;
100100

101101
// By default: TEST_GPU is set to false to allow developers without Nvidia GPU to run integration test suite
102-
public static final boolean TEST_GPU = false;
102+
public static boolean TEST_GPU = false;
103103
public static final double GPU_TOLERANCE = 1e-9;
104104

105105
public static final int FED_WORKER_WAIT = 1000; // in ms
@@ -170,6 +170,8 @@ public String getCodgenConfig() {
170170

171171
protected static final boolean DEBUG = false;
172172

173+
public static boolean VERBOSE_STATS = false;
174+
173175
protected String fullDMLScriptName; // utilize for both DML and PyDML, should probably be renamed.
174176
// protected String fullPYDMLScriptName;
175177
protected String fullRScriptName;
@@ -209,6 +211,8 @@ public String getCodgenConfig() {
209211
e.printStackTrace();
210212
}
211213
outputBuffering = Boolean.parseBoolean(properties.getProperty("automatedtestbase.outputbuffering"));
214+
TEST_GPU = Boolean.parseBoolean(properties.getProperty("enableGPU"));
215+
VERBOSE_STATS = Boolean.parseBoolean(properties.getProperty("enableStats"));
212216
}
213217

214218
// Timestamp before test start.
@@ -1292,6 +1296,8 @@ else if(rtplatform == ExecMode.SPARK)
12921296

12931297
if(TEST_GPU)
12941298
args.add("-gpu");
1299+
if(VERBOSE_STATS)
1300+
args.add("-stats");
12951301
}
12961302

12971303
public static int getRandomAvailablePort() {

src/test/java/org/apache/sysds/test/functions/unary/scalar/ExponentTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ public void testTwoParameters() {
205205

206206
createHelperMatrix();
207207

208-
runTest(true, LanguageException.class);
208+
runTest(EXCEPTION_EXPECTED, LanguageException.class);
209209
}
210210

211211
}

0 commit comments

Comments
 (0)