Skip to content

Commit 87dfa54

Browse files
committed
Further reduction in noise and made pyspark tests to fail fast.
1 parent 811170f commit 87dfa54

2 files changed

Lines changed: 14 additions & 9 deletions

File tree

dev/run-tests

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ dev/scalastyle
4949
echo "========================================================================="
5050
echo "Running Spark unit tests"
5151
echo "========================================================================="
52-
sbt/sbt assembly test | grep -v "info.*Resolving"
52+
sbt/sbt assembly test | grep -v -e "info.*Resolving" -e "warn.*Merging" -e "info.*Including"
5353

5454
echo "========================================================================="
5555
echo "Running PySpark tests"
@@ -63,5 +63,5 @@ echo "========================================================================="
6363
echo "Detecting binary incompatibilites with MiMa"
6464
echo "========================================================================="
6565
./bin/spark-class org.apache.spark.tools.GenerateMIMAIgnore
66-
sbt/sbt mima-report-binary-issues
66+
sbt/sbt mima-report-binary-issues | grep -v -e "info.*Resolving"
6767

python/run-tests

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,18 @@ FAILED=0
2929
rm -f unit-tests.log
3030

3131
function run_test() {
32-
SPARK_TESTING=0 $FWDIR/bin/pyspark $1 2>&1 | tee -a unit-tests.log
32+
SPARK_TESTING=0 $FWDIR/bin/pyspark $1 2>&1 | tee -a > unit-tests.log
3333
FAILED=$((PIPESTATUS[0]||$FAILED))
34+
35+
# Fail and exit on the first test failure.
36+
if [[ $FAILED != 0 ]]; then
37+
cat unit-tests.log | grep -v "^[0-9][0-9]*" # filter all lines starting with a number.
38+
echo -en "\033[31m" # Red
39+
echo "Had test failures; see logs."
40+
echo -en "\033[0m" # No color
41+
exit -1
42+
fi
43+
3444
}
3545

3646
run_test "pyspark/rdd.py"
@@ -46,12 +56,7 @@ run_test "pyspark/mllib/clustering.py"
4656
run_test "pyspark/mllib/recommendation.py"
4757
run_test "pyspark/mllib/regression.py"
4858

49-
if [[ $FAILED != 0 ]]; then
50-
echo -en "\033[31m" # Red
51-
echo "Had test failures; see logs."
52-
echo -en "\033[0m" # No color
53-
exit -1
54-
else
59+
if [[ $FAILED == 0 ]]; then
5560
echo -en "\033[32m" # Green
5661
echo "Tests passed."
5762
echo -en "\033[0m" # No color

0 commit comments

Comments
 (0)