Skip to content

Commit 74984db

Browse files
committed
HOTFIX: Allow PySpark tests to run on Jenkins.
This makes some small changes that allow the PySpark tests to work correctly on Jenkins.
1 parent 15ddbef commit 74984db

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
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

python/run-tests

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ 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+
SPARK_TESTING=1 $FWDIR/bin/pyspark $1 2>&1 | tee -a > unit-tests.log
3636
FAILED=$((PIPESTATUS[0]||$FAILED))
3737

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

4747
}
4848

49+
echo "Running PySpark tests. Output is in python/unit-tests.log."
50+
4951
run_test "pyspark/rdd.py"
5052
run_test "pyspark/context.py"
5153
run_test "pyspark/conf.py"
5254
if [ -n "$_RUN_SQL_TESTS" ]; then
5355
run_test "pyspark/sql.py"
5456
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"
57+
run_test "pyspark/broadcast.py"
58+
run_test "pyspark/accumulators.py"
59+
run_test "pyspark/serializers.py"
5860
run_test "pyspark/tests.py"
5961
run_test "pyspark/mllib/_common.py"
6062
run_test "pyspark/mllib/classification.py"

0 commit comments

Comments
 (0)