File tree 4 files changed +43
-11
lines changed
4 files changed +43
-11
lines changed Original file line number Diff line number Diff line change @@ -47,3 +47,4 @@ spark-*-bin.tar.gz
47
47
unit-tests.log
48
48
/lib /
49
49
rat-results.txt
50
+ scalastyle.txt
Original file line number Diff line number Diff line change @@ -39,18 +39,17 @@ JAVA_VERSION=$($java_cmd -version 2>&1 | sed 's/java version "\(.*\)\.\(.*\)\..*
39
39
echo " ========================================================================="
40
40
echo " Running Apache RAT checks"
41
41
echo " ========================================================================="
42
-
43
42
dev/check-license
44
43
45
44
echo " ========================================================================="
46
45
echo " Running Scala style checks"
47
46
echo " ========================================================================="
48
- sbt/sbt clean scalastyle
47
+ dev/ scalastyle
49
48
50
49
echo " ========================================================================="
51
50
echo " Running Spark unit tests"
52
51
echo " ========================================================================="
53
- sbt/sbt assembly test
52
+ sbt/sbt assembly test | grep -v -e " info.*Resolving " -e " warn.*Merging " -e " info.*Including "
54
53
55
54
echo " ========================================================================="
56
55
echo " Running PySpark tests"
@@ -64,5 +63,5 @@ echo "========================================================================="
64
63
echo " Detecting binary incompatibilites with MiMa"
65
64
echo " ========================================================================="
66
65
./bin/spark-class org.apache.spark.tools.GenerateMIMAIgnore
67
- sbt/sbt mima-report-binary-issues
66
+ sbt/sbt mima-report-binary-issues | grep -v -e " info.*Resolving "
68
67
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ #
4
+ # Licensed to the Apache Software Foundation (ASF) under one or more
5
+ # contributor license agreements. See the NOTICE file distributed with
6
+ # this work for additional information regarding copyright ownership.
7
+ # The ASF licenses this file to You under the Apache License, Version 2.0
8
+ # (the "License"); you may not use this file except in compliance with
9
+ # the License. You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing, software
14
+ # distributed under the License is distributed on an "AS IS" BASIS,
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ # See the License for the specific language governing permissions and
17
+ # limitations under the License.
18
+ #
19
+
20
+ sbt/sbt clean scalastyle > scalastyle.txt
21
+ ERRORS=$( cat scalastyle.txt | grep -e " error file" )
22
+ if test ! -z " $ERRORS " ; then
23
+ echo -e " Scalastyle checks failed at following occurrences:\n$ERRORS "
24
+ exit 1
25
+ else
26
+ echo -e " Scalastyle checks passed.\n"
27
+ fi
Original file line number Diff line number Diff line change @@ -29,8 +29,18 @@ FAILED=0
29
29
rm -f unit-tests.log
30
30
31
31
function run_test() {
32
- SPARK_TESTING=0 $FWDIR /bin/pyspark $1 2>&1 | tee -a unit-tests.log
32
+ SPARK_TESTING=0 $FWDIR /bin/pyspark $1 2>&1 | tee -a > unit-tests.log
33
33
FAILED=$(( PIPESTATUS[0 ]|| $FAILED ))
34
+
35
+ # Fail and exit on the first test failure.
36
+ if [[ $FAILED != 0 ]]; then
37
+ cat unit-tests.log | grep -v " ^[0-9][0-9]*" # filter all lines starting with a number.
38
+ echo -en " \033[31m" # Red
39
+ echo " Had test failures; see logs."
40
+ echo -en " \033[0m" # No color
41
+ exit -1
42
+ fi
43
+
34
44
}
35
45
36
46
run_test " pyspark/rdd.py"
@@ -46,12 +56,7 @@ run_test "pyspark/mllib/clustering.py"
46
56
run_test " pyspark/mllib/recommendation.py"
47
57
run_test " pyspark/mllib/regression.py"
48
58
49
- if [[ $FAILED != 0 ]]; then
50
- echo -en " \033[31m" # Red
51
- echo " Had test failures; see logs."
52
- echo -en " \033[0m" # No color
53
- exit -1
54
- else
59
+ if [[ $FAILED == 0 ]]; then
55
60
echo -en " \033[32m" # Green
56
61
echo " Tests passed."
57
62
echo -en " \033[0m" # No color
You can’t perform that action at this time.
0 commit comments