Github user JoshRosen commented on a diff in the pull request:
https://github.com/apache/spark/pull/4269#discussion_r32780216
--- Diff: python/tests/common ---
@@ -0,0 +1,133 @@
+# -*- coding: utf-8 -*-
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+function run_test() {
+ echo -en "Running test: $1 ... " | tee -a $LOG_FILE
+ start=$(date +"%s")
+ SPARK_TESTING=1 time "$FWDIR"/bin/pyspark $1 > $LOG_FILE 2>&1
+
+ FAILED=$((PIPESTATUS[0]||$FAILED))
+
+ # Fail and exit on the first test failure.
+ if [[ $FAILED != 0 ]]; then
+ cat $LOG_FILE | grep -v "^[0-9][0-9]*" # filter all lines starting
with a number.
+ echo -en "\033[31m" # Red
+ echo "Had test failures; see logs."
+ echo -en "\033[0m" # No color
+ exit -1
+ else
+ now=$(date +"%s")
+ echo "ok ($(($now - $start))s)"
+ fi
+}
+
+function run_core_tests() {
+ if [ $DO_CORE_TESTS == 0 ]; then
+ return 0
+ fi
+
+ echo "Run core tests ..."
+ run_test "pyspark.rdd"
+ run_test "pyspark.context"
+ run_test "pyspark.conf"
+ run_test "pyspark.broadcast"
+ run_test "pyspark.accumulators"
+ run_test "pyspark.serializers"
+ run_test "pyspark.profiler"
+ run_test "pyspark.shuffle"
+ run_test "pyspark.tests"
+}
+
+function run_sql_tests() {
+ if [ $DO_SQL_TESTS == 0 ]; then
+ return 0
+ fi
+
+ echo "Run sql tests ..."
+ run_test "pyspark.sql.types"
+ run_test "pyspark.sql.context"
+ run_test "pyspark.sql.column"
+ run_test "pyspark.sql.dataframe"
+ run_test "pyspark.sql.group"
+ run_test "pyspark.sql.functions"
+ run_test "pyspark.sql.readwriter"
+ run_test "pyspark.sql.window"
+ run_test "pyspark.sql.tests"
+}
+
+function run_mllib_tests() {
+ if [ $DO_MLLIB_TESTS == 0 ]; then
--- End diff --
From a design perspective, I think it makes more sense to move these
conditionals out of the `run_*_tests` functions and into the `tests/default`
script.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]