Skip to content

Commit

Permalink
build-and-test.sh: only rerun Spark tests if Java build passes
Browse files Browse the repository at this point in the history
Otherwise, the output of a failing Spark test from the first build is
overwritten by the second build.

The alternative is to configure Maven to use a different build directory [1]
for the second build, but I think that's more trouble than it's worth.

1. https://stackoverflow.com/questions/3908013/maven-how-to-change-path-to-target-directory-from-command-line

Change-Id: Ief21061be0615ca4d9d8980430f4982c8c43d77c
Reviewed-on: http://gerrit.cloudera.org:8080/7090
Tested-by: Adar Dembo <[email protected]>
Reviewed-by: Dan Burkert <[email protected]>
  • Loading branch information
adembo committed Jun 6, 2017
1 parent 86116e4 commit cdf0fee
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions build-support/jenkins/build-and-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -353,20 +353,26 @@ if [ "$BUILD_JAVA" == "1" ]; then
pushd $SOURCE_ROOT/java
export TSAN_OPTIONS="$TSAN_OPTIONS suppressions=$SOURCE_ROOT/build-support/tsan-suppressions.txt history_size=7"
set -x

# Run the full Maven build (with Spark 2.x).
if ! mvn $MVN_FLAGS \
-Dsurefire.rerunFailingTestsCount=3 \
-Dfailsafe.rerunFailingTestsCount=3 \
clean verify ; then
EXIT_STATUS=1
FAILURES="$FAILURES"$'Java build/test failed\n'
else
# If there were no failures, remove the Spark output and rerun the build,
# this time just to test Spark 1.x with Scala 2.10.
#
# Note: this won't work if there are ever Spark integration tests!
rm -rf kudu-spark/target/
if ! mvn $MVN_FLAGS -Pspark_2.10 -Dtest="org.apache.kudu.spark.*.*" test; then
EXIT_STATUS=1
FAILURES="$FAILURES"$'spark build/test failed\n'
fi
fi
# Test kudu-spark with Spark 1.x + Scala 2.10 profile
# This won't work if there are ever Spark integration tests!
rm -rf kudu-spark/target/
if ! mvn $MVN_FLAGS -Pspark_2.10 -Dtest="org.apache.kudu.spark.*.*" test; then
EXIT_STATUS=1
FAILURES="$FAILURES"$'spark build/test failed\n'
fi

set +x
popd
fi
Expand Down

0 comments on commit cdf0fee

Please sign in to comment.