From c43f444c7c565933e1d7ca5af21bc07a5e3f526a Mon Sep 17 00:00:00 2001 From: Michael Stack Date: Fri, 14 Dec 2012 00:46:35 +0000 Subject: [PATCH] HBASE-7349 Jenkins build should compare trunk vs patch for Javadoc warnings git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1421629 13f79535-47bb-0310-9956-ffa450edef68 --- dev-support/test-patch.properties | 1 - dev-support/test-patch.sh | 34 ++++++++++++++++++++++--------- 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/dev-support/test-patch.properties b/dev-support/test-patch.properties index 3374978a2f0..9cf01825a18 100644 --- a/dev-support/test-patch.properties +++ b/dev-support/test-patch.properties @@ -20,4 +20,3 @@ MAVEN_OPTS="-Xmx3g" OK_RELEASEAUDIT_WARNINGS=84 OK_FINDBUGS_WARNINGS=517 -OK_JAVADOC_WARNINGS=169 diff --git a/dev-support/test-patch.sh b/dev-support/test-patch.sh index c8041b8e954..c9e8200fe70 100755 --- a/dev-support/test-patch.sh +++ b/dev-support/test-patch.sh @@ -225,18 +225,17 @@ setup () { fi . $BASEDIR/dev-support/test-patch.properties ### exit if warnings are NOT defined in the properties file - if [ -z "$OK_FINDBUGS_WARNINGS" ] || [[ -z "$OK_JAVADOC_WARNINGS" ]] || [[ -z $OK_RELEASEAUDIT_WARNINGS ]] ; then + if [[ -z "$OK_FINDBUGS_WARNINGS" ]] || [[ -z "$OK_RELEASEAUDIT_WARNINGS" ]] ; then echo "Please define the following properties in test-patch.properties file" echo "OK_FINDBUGS_WARNINGS" echo "OK_RELEASEAUDIT_WARNINGS" - echo "OK_JAVADOC_WARNINGS" cleanupAndExit 1 fi echo "" echo "" echo "======================================================================" echo "======================================================================" - echo " Pre-build trunk to verify trunk stability and javac warnings" + echo " Pre-build trunk to verify trunk stability and javac warnings." echo "======================================================================" echo "======================================================================" echo "" @@ -250,6 +249,21 @@ setup () { cleanupAndExit 1 fi + echo "" + echo "" + echo "======================================================================" + echo "======================================================================" + echo " Pre-build trunk to determine number of trunk javadoc warnings." + echo "======================================================================" + echo "======================================================================" + echo "" + echo "" + echo "$MVN clean package javadoc:javadoc -DskipTests -D${PROJECT_NAME}PatchProcess > $PATCH_DIR/trunkJavadocWarnings.txt 2>&1" + $MVN clean package javadoc:javadoc -DskipTests -D${PROJECT_NAME}PatchProcess > $PATCH_DIR/trunkJavadocWarnings.txt 2>&1 + trunkJavadocWarnings=`$GREP '\[WARNING\]' $PATCH_DIR/trunkJavadocWarnings.txt | $AWK '/Javadoc Warnings/,EOF' | $GREP warning | $AWK 'BEGIN {total = 0} {total += 1} END {print total}'` + echo "" + echo "" + echo "There appear to be $trunkJavadocWarnings javadoc warnings generated on trunk." } ############################################################################### @@ -348,7 +362,7 @@ checkHadoop20Compile () { echo "" echo "======================================================================" echo "======================================================================" - echo " Checking against hadoop 2.0 build" + echo " Checking against hadoop 2.0 build." echo "======================================================================" echo "======================================================================" echo "" @@ -385,21 +399,21 @@ checkJavadocWarnings () { echo "$MVN clean package javadoc:javadoc -DskipTests -D${PROJECT_NAME}PatchProcess > $PATCH_DIR/patchJavadocWarnings.txt 2>&1" export MAVEN_OPTS="${MAVEN_OPTS}" $MVN clean package javadoc:javadoc -DskipTests -D${PROJECT_NAME}PatchProcess > $PATCH_DIR/patchJavadocWarnings.txt 2>&1 - javadocWarnings=`$GREP '\[WARNING\]' $PATCH_DIR/patchJavadocWarnings.txt | $AWK '/Javadoc Warnings/,EOF' | $GREP warning | $AWK 'BEGIN {total = 0} {total += 1} END {print total}'` + patchJavadocWarnings=`$GREP '\[WARNING\]' $PATCH_DIR/patchJavadocWarnings.txt | $AWK '/Javadoc Warnings/,EOF' | $GREP warning | $AWK 'BEGIN {total = 0} {total += 1} END {print total}'` echo "" echo "" - echo "There appear to be $javadocWarnings javadoc warnings generated by the patched build." + echo "There appear to be $patchJavadocWarnings javadoc warnings generated by the patched build." - ### if current warnings greater than OK_JAVADOC_WARNINGS - if [[ $javadocWarnings -gt $OK_JAVADOC_WARNINGS ]] ; then + ### if patch warnings greater than trunk warnings + if [[ $patchJavadocWarnings -gt $trunkJavadocWarnings ]] ; then JIRA_COMMENT="$JIRA_COMMENT - {color:red}-1 javadoc{color}. The javadoc tool appears to have generated `expr $(($javadocWarnings-$OK_JAVADOC_WARNINGS))` warning messages." + {color:red}-1 javadoc{color}. The javadoc tool generates `expr $(($patchJavadocWarnings-$trunkJavadocWarnings))` additional warning messages with this patch." return 1 fi JIRA_COMMENT="$JIRA_COMMENT - {color:green}+1 javadoc{color}. The javadoc tool did not generate any warning messages." + {color:green}+1 javadoc{color}. The javadoc tool did not generate any additional warning messages." return 0 }