From 74984dbdee9b368867c17f1086888d9136e1f299 Mon Sep 17 00:00:00 2001 From: Patrick Wendell Date: Tue, 10 Jun 2014 12:37:36 -0700 Subject: [PATCH 1/3] HOTFIX: Allow PySpark tests to run on Jenkins. This makes some small changes that allow the PySpark tests to work correctly on Jenkins. --- bin/pyspark | 6 +++++- python/run-tests | 10 ++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/bin/pyspark b/bin/pyspark index d0fa56f31913..114cbbc3a8a8 100755 --- a/bin/pyspark +++ b/bin/pyspark @@ -86,6 +86,10 @@ else if [[ "$IPYTHON" = "1" ]]; then exec ipython $IPYTHON_OPTS else - exec "$PYSPARK_PYTHON" + if [[ -n $SPARK_TESTING ]]; then + exec "$PYSPARK_PYTHON" -m doctest + else + exec "$PYSPARK_PYTHON" + fi fi fi diff --git a/python/run-tests b/python/run-tests index 36a96121cbc0..3443bf485d10 100755 --- a/python/run-tests +++ b/python/run-tests @@ -32,7 +32,7 @@ rm -f unit-tests.log rm -rf metastore warehouse function run_test() { - SPARK_TESTING=0 $FWDIR/bin/pyspark $1 2>&1 | tee -a > unit-tests.log + SPARK_TESTING=1 $FWDIR/bin/pyspark $1 2>&1 | tee -a > unit-tests.log FAILED=$((PIPESTATUS[0]||$FAILED)) # Fail and exit on the first test failure. @@ -46,15 +46,17 @@ function run_test() { } +echo "Running PySpark tests. Output is in python/unit-tests.log." + run_test "pyspark/rdd.py" run_test "pyspark/context.py" run_test "pyspark/conf.py" if [ -n "$_RUN_SQL_TESTS" ]; then run_test "pyspark/sql.py" fi -run_test "-m doctest pyspark/broadcast.py" -run_test "-m doctest pyspark/accumulators.py" -run_test "-m doctest pyspark/serializers.py" +run_test "pyspark/broadcast.py" +run_test "pyspark/accumulators.py" +run_test "pyspark/serializers.py" run_test "pyspark/tests.py" run_test "pyspark/mllib/_common.py" run_test "pyspark/mllib/classification.py" From 71e7b7441a72b206f6f501aacdb1ab44128d875f Mon Sep 17 00:00:00 2001 From: Patrick Wendell Date: Tue, 10 Jun 2014 12:57:05 -0700 Subject: [PATCH 2/3] Removing incorrect python path --- dev/run-tests | 3 --- 1 file changed, 3 deletions(-) diff --git a/dev/run-tests b/dev/run-tests index 93d6692f83ca..c82a47ebb618 100755 --- a/dev/run-tests +++ b/dev/run-tests @@ -73,9 +73,6 @@ fi echo "=========================================================================" echo "Running PySpark tests" echo "=========================================================================" -if [ -z "$PYSPARK_PYTHON" ]; then - export PYSPARK_PYTHON=/usr/local/bin/python2.7 -fi ./python/run-tests echo "=========================================================================" From 9c99856c803ca74fe015921837b12cac74bcbce4 Mon Sep 17 00:00:00 2001 From: Patrick Wendell Date: Tue, 10 Jun 2014 12:58:41 -0700 Subject: [PATCH 3/3] Better output during tests --- python/run-tests | 1 + 1 file changed, 1 insertion(+) diff --git a/python/run-tests b/python/run-tests index 3443bf485d10..3b4501178c89 100755 --- a/python/run-tests +++ b/python/run-tests @@ -32,6 +32,7 @@ rm -f unit-tests.log rm -rf metastore warehouse function run_test() { + echo "Running test: $1" SPARK_TESTING=1 $FWDIR/bin/pyspark $1 2>&1 | tee -a > unit-tests.log FAILED=$((PIPESTATUS[0]||$FAILED))