Skip to content

Commit fb499be

Browse files
committed
HOTFIX: Fix Python tests on Jenkins.
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.
1 parent db0c038 commit fb499be

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

bin/pyspark

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ else
8686
if [[ "$IPYTHON" = "1" ]]; then
8787
exec ipython $IPYTHON_OPTS
8888
else
89-
exec "$PYSPARK_PYTHON"
89+
if [[ -n $SPARK_TESTING ]]; then
90+
exec "$PYSPARK_PYTHON" -m doctest
91+
else
92+
exec "$PYSPARK_PYTHON"
93+
fi
9094
fi
9195
fi

dev/run-tests

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,6 @@ fi
7373
echo "========================================================================="
7474
echo "Running PySpark tests"
7575
echo "========================================================================="
76-
if [ -z "$PYSPARK_PYTHON" ]; then
77-
export PYSPARK_PYTHON=/usr/local/bin/python2.7
78-
fi
7976
./python/run-tests
8077

8178
echo "========================================================================="

python/run-tests

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ rm -f unit-tests.log
3232
rm -rf metastore warehouse
3333

3434
function run_test() {
35-
SPARK_TESTING=0 $FWDIR/bin/pyspark $1 2>&1 | tee -a > unit-tests.log
35+
echo "Running test: $1"
36+
SPARK_TESTING=1 $FWDIR/bin/pyspark $1 2>&1 | tee -a > unit-tests.log
3637
FAILED=$((PIPESTATUS[0]||$FAILED))
3738

3839
# Fail and exit on the first test failure.
@@ -46,15 +47,17 @@ function run_test() {
4647

4748
}
4849

50+
echo "Running PySpark tests. Output is in python/unit-tests.log."
51+
4952
run_test "pyspark/rdd.py"
5053
run_test "pyspark/context.py"
5154
run_test "pyspark/conf.py"
5255
if [ -n "$_RUN_SQL_TESTS" ]; then
5356
run_test "pyspark/sql.py"
5457
fi
55-
run_test "-m doctest pyspark/broadcast.py"
56-
run_test "-m doctest pyspark/accumulators.py"
57-
run_test "-m doctest pyspark/serializers.py"
58+
run_test "pyspark/broadcast.py"
59+
run_test "pyspark/accumulators.py"
60+
run_test "pyspark/serializers.py"
5861
run_test "pyspark/tests.py"
5962
run_test "pyspark/mllib/_common.py"
6063
run_test "pyspark/mllib/classification.py"

0 commit comments

Comments
 (0)