Skip to content

Commit f499986

Browse files
committed
test live output
1 parent 6c76592 commit f499986

File tree

3 files changed

+20
-8
lines changed

3 files changed

+20
-8
lines changed

docker/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ Test your testing image locally by running the following command:
138138
```bash
139139
docker run \
140140
-v $(pwd):/github/workspace \
141+
-v $HOME/.m2/repository:/root/.m2/repository \
141142
apache/systemds:testing-latest \
142143
org.apache.sysds.test.component.**
143144
```

docker/entrypoint.sh

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,22 @@ cd /github/workspace
2929
export MAVEN_OPTS="-Xmx512m"
3030

3131
log="/tmp/sysdstest.log"
32-
mvn -ntp -B test-compile 2>&1 | grep -E "BUILD|Total time:|---|Building SystemDS"
32+
mvn -ntp -B test-compile 2>&1 | stdbuf -oL grep -E "BUILD|Total time:|---|Building SystemDS"
3333
mvn -ntp -B test -D maven.test.skip=false -D automatedtestbase.outputbuffering=true -D test=$1 2>&1 \
34-
| grep -v "already exists in destination." \
35-
| grep -v 'WARNING: Using incubator modules' | tee $log
34+
| stdbuf -oL grep -Ev "already exists in destination.|Using incubator" \
35+
| tee $log
3636

37-
# Merge Federated test runs.
38-
# if merged jacoco exist temporarily rename to not overwrite.
39-
[ -f target/jacoco.exec ] && mv target/jacoco.exec target/jacoco_main.exec
40-
# merge jacoco files.
41-
mvn -ntp -B jacoco:merge 2>&1 | grep -E "BUILD|Total time:|Building SystemDS|jacoco"
4237

4338
grep_args="SUCCESS"
4439
grepvals="$( tail -n 100 $log | grep $grep_args)"
4540

4641
if [[ $grepvals == *"SUCCESS"* ]]; then
42+
# Merge Federated test runs.
43+
# if merged jacoco exist temporarily rename to not overwrite.
44+
[ -f target/jacoco.exec ] && mv target/jacoco.exec target/jacoco_main.exec
45+
# merge jacoco files.
46+
mvn -ntp -B jacoco:merge 2>&1 | stdbuf -oL grep -E "jacoco"
47+
4748
exit 0
4849
else
4950
exit 1

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1760,15 +1760,25 @@ public static HashMap<CellIndex, Double> convert2DDoubleArrayToHashMap(double[][
17601760
}
17611761

17621762
public static double[][] convertHashMapToDoubleArray(HashMap <CellIndex, Double> matrix) {
1763+
if(matrix.isEmpty()){
1764+
LOG.error("converting empty hashMap");
1765+
return new double[0][0];
1766+
}
17631767
int max_rows = -1, max_cols= -1;
1768+
17641769
for(CellIndex ix : matrix.keySet()) {
17651770
max_rows = Math.max(max_rows, ix.row);
17661771
max_cols = Math.max(max_cols, ix.column);
17671772
}
1773+
17681774
return convertHashMapToDoubleArray(matrix, max_rows, max_cols);
17691775
}
17701776

17711777
public static double[][] convertHashMapToDoubleArray(HashMap<CellIndex, Double> matrix, int rows, int cols) {
1778+
if(rows <= -1 || cols <= -1){
1779+
LOG.error("converting negative size hashmap rows: " + rows + " cols: " + cols);
1780+
return new double[0][0];
1781+
}
17721782
double [][] ret_arr = new double[rows][cols];
17731783
for(Entry<CellIndex, Double> e : matrix.entrySet()) {
17741784
int i = e.getKey().row-1;

0 commit comments

Comments
 (0)