From 8c8d9d50085ddd31379c2b7319162ab472502f14 Mon Sep 17 00:00:00 2001 From: Ted Yu Date: Thu, 19 Jun 2014 23:46:22 +0000 Subject: [PATCH] HBASE-11375 Validate compile-protobuf profile in test-patch.sh --- dev-support/test-patch.sh | 46 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/dev-support/test-patch.sh b/dev-support/test-patch.sh index 0fccef17759..c42b8432eaf 100755 --- a/dev-support/test-patch.sh +++ b/dev-support/test-patch.sh @@ -349,6 +349,29 @@ checkCompilationErrors() { fi } +############################################################################### +### Check there are no protoc compilation errors, passing a file to be parsed. +checkProtocCompilationErrors() { + local file=$1 + 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 Protoc compilation errors." + echo "======================================================================" + echo "$ERRORS" + JIRA_COMMENT="$JIRA_COMMENT + + {color:red}-1 javac{color}. The patch appears to cause mvn compile-protobuf profile to fail. + + Protoc Compilation errors resume: + $ERRORS + " + cleanupAndExit 1 + fi +} + ############################################################################### ### Attempt to apply the patch applyPatch () { @@ -466,6 +489,27 @@ checkJavacWarnings () { return 0 } +############################################################################### +checkProtocErrors () { + echo "" + echo "" + echo "======================================================================" + echo "======================================================================" + echo " Determining whether there is patched protoc error." + echo "======================================================================" + echo "======================================================================" + echo "" + echo "" + echo "$MVN clean install -DskipTests -Pcompile-protobuf -X -D${PROJECT_NAME}PatchProcess > $PATCH_DIR/patchProtocErrors.txt 2>&1" + export MAVEN_OPTS="${MAVEN_OPTS}" + $MVN clean install -DskipTests -Pcompile-protobuf -X -D${PROJECT_NAME}PatchProcess > $PATCH_DIR/patchProtocErrors.txt 2>&1 + checkProtocCompilationErrors $PATCH_DIR/patchProtocErrors.txt + JIRA_COMMENT="$JIRA_COMMENT + + {color:green}+1 javac{color}. The applied patch does not increase the total number of javac compiler warnings." + return 0 +} + ############################################################################### ### Check there are no changes in the number of release audit (RAT) warnings checkReleaseAuditWarnings () { @@ -859,6 +903,8 @@ checkAntiPatterns (( RESULT = RESULT + $? )) checkJavacWarnings (( RESULT = RESULT + $? )) +checkProtocErrors +(( RESULT = RESULT + $? )) checkJavadocWarnings (( RESULT = RESULT + $? )) ### Checkstyle not implemented yet