diff options
author | Prashant Sharma <prashant.s@imaginea.com> | 2014-03-29 23:03:03 -0700 |
---|---|---|
committer | Patrick Wendell <pwendell@gmail.com> | 2014-03-29 23:03:03 -0700 |
commit | df1b9f7b1a07bf8d806695a7684f9d69bf705093 (patch) | |
tree | 6591e63c787a9698271d0777e6fad15308774e20 /python | |
parent | 2861b07bb030f72769f5b757b4a7d4a635807140 (diff) | |
download | spark-df1b9f7b1a07bf8d806695a7684f9d69bf705093.tar.gz spark-df1b9f7b1a07bf8d806695a7684f9d69bf705093.tar.bz2 spark-df1b9f7b1a07bf8d806695a7684f9d69bf705093.zip |
SPARK-1336 Reducing the output of run-tests script.
Author: Prashant Sharma <prashant.s@imaginea.com>
Author: Prashant Sharma <scrapcodes@gmail.com>
Closes #262 from ScrapCodes/SPARK-1336/ReduceVerbosity and squashes the following commits:
87dfa54 [Prashant Sharma] Further reduction in noise and made pyspark tests to fail fast.
811170f [Prashant Sharma] Reducing the ouput of run-tests script.
Diffstat (limited to 'python')
-rwxr-xr-x | python/run-tests | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/python/run-tests b/python/run-tests index a986ac9380..b2b60f08b4 100755 --- a/python/run-tests +++ b/python/run-tests @@ -29,8 +29,18 @@ FAILED=0 rm -f unit-tests.log function run_test() { - SPARK_TESTING=0 $FWDIR/bin/pyspark $1 2>&1 | tee -a unit-tests.log + SPARK_TESTING=0 $FWDIR/bin/pyspark $1 2>&1 | tee -a > unit-tests.log FAILED=$((PIPESTATUS[0]||$FAILED)) + + # Fail and exit on the first test failure. + if [[ $FAILED != 0 ]]; then + cat unit-tests.log | grep -v "^[0-9][0-9]*" # filter all lines starting with a number. + echo -en "\033[31m" # Red + echo "Had test failures; see logs." + echo -en "\033[0m" # No color + exit -1 + fi + } run_test "pyspark/rdd.py" @@ -46,12 +56,7 @@ run_test "pyspark/mllib/clustering.py" run_test "pyspark/mllib/recommendation.py" run_test "pyspark/mllib/regression.py" -if [[ $FAILED != 0 ]]; then - echo -en "\033[31m" # Red - echo "Had test failures; see logs." - echo -en "\033[0m" # No color - exit -1 -else +if [[ $FAILED == 0 ]]; then echo -en "\033[32m" # Green echo "Tests passed." echo -en "\033[0m" # No color |