Skip to content

Commit 0d8d3a4

Browse files
committed
Always run Python Spark SQL tests.
1 parent 2fc8aca commit 0d8d3a4

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

dev/run-tests

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ if [ -n "$AMPLAB_JENKINS" ]; then
5858
diffs=`git diff --name-only master | grep "^sql/"`
5959
if [ -n "$diffs" ]; then
6060
echo "Detected changes in SQL. Will run Hive test suite."
61-
export _RUN_SQL_TESTS=true # exported for PySpark tests
61+
_RUN_SQL_TESTS=true
6262
fi
6363
fi
6464

@@ -89,13 +89,22 @@ echo "========================================================================="
8989
echo "Running Spark unit tests"
9090
echo "========================================================================="
9191

92+
# Build Spark; we always build with Hive because the PySpark SparkSQL tests need it.
93+
# echo "q" is needed because sbt on encountering a build file with failure
94+
# (either resolution or compilation) prompts the user for input either q, r,
95+
# etc to quit or retry. This echo is there to make it not block.
96+
BUILD_MVN_PROFILE_ARGS="$SBT_MAVEN_PROFILES_ARGS -Phive -Phive-thriftserver "
97+
echo -e "q\n" | sbt/sbt $BUILD_MVN_PROFILE_ARGS clean package assembly/assembly | \
98+
grep -v -e "info.*Resolving" -e "warn.*Merging" -e "info.*Including"
99+
100+
# If the Spark SQL tests are enabled, run the tests with the Hive profiles enabled:
92101
if [ -n "$_RUN_SQL_TESTS" ]; then
93102
SBT_MAVEN_PROFILES_ARGS="$SBT_MAVEN_PROFILES_ARGS -Phive -Phive-thriftserver"
94103
fi
95-
# echo "q" is needed because sbt on encountering a build file with failure
96-
# (either resolution or compilation) prompts the user for input either q, r,
104+
# echo "q" is needed because sbt on encountering a build file with failure
105+
# (either resolution or compilation) prompts the user for input either q, r,
97106
# etc to quit or retry. This echo is there to make it not block.
98-
echo -e "q\n" | sbt/sbt $SBT_MAVEN_PROFILES_ARGS clean package assembly/assembly test | \
107+
echo -e "q\n" | sbt/sbt $SBT_MAVEN_PROFILES_ARGS test | \
99108
grep -v -e "info.*Resolving" -e "warn.*Merging" -e "info.*Including"
100109

101110
echo ""

python/run-tests

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,7 @@ $PYSPARK_PYTHON --version
5959
run_test "pyspark/rdd.py"
6060
run_test "pyspark/context.py"
6161
run_test "pyspark/conf.py"
62-
if [ -n "$_RUN_SQL_TESTS" ]; then
63-
run_test "pyspark/sql.py"
64-
fi
62+
run_test "pyspark/sql.py"
6563
# These tests are included in the module-level docs, and so must
6664
# be handled on a higher level rather than within the python file.
6765
export PYSPARK_DOC_TEST=1

0 commit comments

Comments
 (0)