commit a3168ffdfde81583e8aa81f739d3a23792d0ed35 Author: Enis Soztutar Date: Tue Jan 27 11:42:42 2015 -0800 HBASE-12920 v1 diff --git dev-support/test-patch.properties dev-support/test-patch.properties index 4ecad34..df6f6d5 100644 --- dev-support/test-patch.properties +++ dev-support/test-patch.properties @@ -24,3 +24,7 @@ OK_FINDBUGS_WARNINGS=95 OK_JAVADOC_WARNINGS=2 MAX_LINE_LENGTH=100 + +# All supported Hadoop versions that we want to test the compilation with +HADOOP2_VERSIONS="2.4.1 2.5.2 2.6.0" +HADOOP3_VERSIONS="3.0.0-SNAPSHOT" diff --git dev-support/test-patch.sh dev-support/test-patch.sh index f99eefd..ceaa4de 100755 --- dev-support/test-patch.sh +++ dev-support/test-patch.sh @@ -342,17 +342,21 @@ checkTests () { ### Check there are no compilation errors, passing a file to be parsed. checkCompilationErrors() { local file=$1 + hadoopVersion="" + if [ "$#" -ne 1 ]; then + hadoopVersion="with Hadoop version $2" + fi COMPILATION_ERROR=false eval $(awk '/ERROR/ {print "COMPILATION_ERROR=true"}' $file) if $COMPILATION_ERROR ; then ERRORS=$($AWK '/ERROR/ { print $0 }' $file) echo "======================================================================" - echo "There are compilation errors." + echo "There are compilation errors $hadoopVersion." echo "======================================================================" echo "$ERRORS" JIRA_COMMENT="$JIRA_COMMENT - {color:red}-1 javac{color}. The patch appears to cause mvn compile goal to fail. + {color:red}-1 javac{color}. The patch appears to cause mvn compile goal to fail $hadoopVersion. Compilation errors resume: $ERRORS @@ -469,6 +473,30 @@ $JIRA_COMMENT_FOOTER" return 0 } +checkBuildWithHadoopVersions() { + echo "" + echo "" + echo "======================================================================" + echo "======================================================================" + echo " Building with all supported Hadoop versions ." + echo "======================================================================" + echo "======================================================================" + echo "" + echo "" + export MAVEN_OPTS="${MAVEN_OPTS}" + for HADOOP2_VERSION in $HADOOP2_VERSIONS ; do + echo "$MVN clean install -DskipTests -D${PROJECT_NAME}PatchProcess -Dhadoop-two.version=$HADOOP2_VERSION > $PATCH_DIR/patchJavacWithHadoop-$HADOOP2_VERSION.txt 2>&1" + $MVN clean install -DskipTests -D${PROJECT_NAME}PatchProcess -Dhadoop-two.version=$HADOOP2_VERSION > $PATCH_DIR/patchJavacWithHadoop-$HADOOP2_VERSION.txt 2>&1 + checkCompilationErrors $PATCH_DIR/patchJavacWithHadoop-$HADOOP2_VERSION.txt $HADOOP2_VERSION + done + + # TODO: add Hadoop3 versions and compilation here when we get the hadoop.profile=3.0 working + + JIRA_COMMENT="$JIRA_COMMENT + {color:green}+1 hadoop versions{color}. The patch compiles with all supported hadoop versions ($HADOOP2_VERSIONS)" + return 0 +} + ############################################################################### ### Check there are no changes in the number of Javac warnings checkJavacWarnings () { @@ -921,6 +949,8 @@ fi checkAntiPatterns (( RESULT = RESULT + $? )) +checkBuildWithHadoopVersions +(( RESULT = RESULT + $? )) checkJavacWarnings (( RESULT = RESULT + $? )) checkProtocErrors