Skip to content

Commit

Permalink
Further reduction in noise and made pyspark tests to fail fast.
Browse files Browse the repository at this point in the history
  • Loading branch information
ScrapCodes committed Mar 29, 2014
1 parent 811170f commit 87dfa54
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
4 changes: 2 additions & 2 deletions dev/run-tests
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ dev/scalastyle
echo "========================================================================="
echo "Running Spark unit tests"
echo "========================================================================="
sbt/sbt assembly test | grep -v "info.*Resolving"
sbt/sbt assembly test | grep -v -e "info.*Resolving" -e "warn.*Merging" -e "info.*Including"

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

19 changes: 12 additions & 7 deletions python/run-tests
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down

0 comments on commit 87dfa54

Please sign in to comment.