Skip to content

Commit

Permalink
HOTFIX: Fix Python tests on Jenkins.
Browse files Browse the repository at this point in the history
Author: Patrick Wendell <[email protected]>

Closes apache#1036 from pwendell/jenkins-test and squashes the following commits:

9c99856 [Patrick Wendell] Better output during tests
71e7b74 [Patrick Wendell] Removing incorrect python path
74984db [Patrick Wendell] HOTFIX: Allow PySpark tests to run on Jenkins.
  • Loading branch information
pwendell committed Jun 10, 2014
1 parent db0c038 commit fb499be
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
6 changes: 5 additions & 1 deletion bin/pyspark
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 0 additions & 3 deletions dev/run-tests
Original file line number Diff line number Diff line change
Expand Up @@ -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 "========================================================================="
Expand Down
11 changes: 7 additions & 4 deletions python/run-tests
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ 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
echo "Running test: $1"
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.
Expand All @@ -46,15 +47,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"
Expand Down

0 comments on commit fb499be

Please sign in to comment.