Tweak build-and-test.sh to fix spark1 test failures Maven seems to be caching old artifacts which is leading to hard-to-diagnose test failures in some branches. This commit changes the spark1 test to do a full clean/rebuild instead of selectively removing the kudu-spark target dir. I've also snuck in a change to add the -B 'batch' flag to maven invocations, which should help with the verbose download progress log spam, as well as the -Dmaven.javadoc.skip flag in order to speed up the builds, since javadocs aren't necessary.
Change-Id: I92fb0c05a9da65e1a41eb9017050cd8f957ce3a8 Reviewed-on: http://gerrit.cloudera.org:8080/7129 Reviewed-by: Adar Dembo <[email protected]> Tested-by: Kudu Jenkins Project: http://git-wip-us.apache.org/repos/asf/kudu/repo Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/8d2ca982 Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/8d2ca982 Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/8d2ca982 Branch: refs/heads/master Commit: 8d2ca982fe24170c6a8b899e4751a29f05d05f39 Parents: 3e24969 Author: Dan Burkert <[email protected]> Authored: Thu Jun 8 15:06:22 2017 -0700 Committer: Dan Burkert <[email protected]> Committed: Fri Jun 9 20:28:15 2017 +0000 ---------------------------------------------------------------------- build-support/jenkins/build-and-test.sh | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kudu/blob/8d2ca982/build-support/jenkins/build-and-test.sh ---------------------------------------------------------------------- diff --git a/build-support/jenkins/build-and-test.sh b/build-support/jenkins/build-and-test.sh index 5ebe1dd..c2c67d6 100755 --- a/build-support/jenkins/build-and-test.sh +++ b/build-support/jenkins/build-and-test.sh @@ -355,22 +355,19 @@ if [ "$BUILD_JAVA" == "1" ]; then set -x # Run the full Maven build (with Spark 2.x). - if ! mvn $MVN_FLAGS \ - -Dsurefire.rerunFailingTestsCount=3 \ - -Dfailsafe.rerunFailingTestsCount=3 \ - clean verify ; then + MVN_FLAGS="$MVN_FLAGS -B" + MVN_FLAGS="$MVN_FLAGS -Dsurefire.rerunFailingTestsCount=3" + MVN_FLAGS="$MVN_FLAGS -Dfailsafe.rerunFailingTestsCount=3" + MVN_FLAGS="$MVN_FLAGS -Dmaven.javadoc.skip" + if ! mvn $MVN_FLAGS 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 + + # If there are no failures, rerun the build with Spark 1.x with Scala 2.10. + # Note: this won't work if there are ever Spark integration tests! + elif ! mvn $MVN_FLAGS -Dtest="org.apache.kudu.spark.*.*" -Pspark_2.10 clean verify ; then + EXIT_STATUS=1 + FAILURES="$FAILURES"$'Spark 1.x build/test failed\n' fi set +x
