You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by ni...@apache.org on 2008/05/04 08:51:20 UTC

svn commit: r653184 - in /hadoop/core/trunk: CHANGES.txt build.xml src/test/bin/test-patch.sh

Author: nigel
Date: Sat May  3 23:51:19 2008
New Revision: 653184

URL: http://svn.apache.org/viewvc?rev=653184&view=rev
Log:
HADOOP-3345. Enhance the hudson-test-patch target to cleanup messages, fix minor defects, and add eclipse plugin and python unit tests. Contributed by Nigel Daley.

Modified:
    hadoop/core/trunk/CHANGES.txt
    hadoop/core/trunk/build.xml
    hadoop/core/trunk/src/test/bin/test-patch.sh

Modified: hadoop/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=653184&r1=653183&r2=653184&view=diff
==============================================================================
--- hadoop/core/trunk/CHANGES.txt (original)
+++ hadoop/core/trunk/CHANGES.txt Sat May  3 23:51:19 2008
@@ -72,6 +72,9 @@
     HADOOP-2799. Deprecate o.a.h.io.Closable in favor of java.io.Closable.
     (Tsz Wo (Nicholas), SZE via cdouglas)
 
+    HADOOP-3345. Enhance the hudson-test-patch target to cleanup messages,
+    fix minor defects, and add eclipse plugin and python unit tests. (nigel)
+
   OPTIMIZATIONS
 
     HADOOP-3274. The default constructor of BytesWritable creates empty 

Modified: hadoop/core/trunk/build.xml
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/build.xml?rev=653184&r1=653183&r2=653184&view=diff
==============================================================================
--- hadoop/core/trunk/build.xml (original)
+++ hadoop/core/trunk/build.xml Sat May  3 23:51:19 2008
@@ -1146,8 +1146,8 @@
   </exec>
 </target>
 
-<target name="hudson-test-patch" depends="patch.check,findbugs.check,forrest.check">
-  <exec executable="sh" failonerror="true">
+<target name="hudson-test-patch" depends="findbugs.check,forrest.check">
+  <exec executable="bash" failonerror="true">
     <arg value="${basedir}/src/test/bin/test-patch.sh"/>
     <arg value="HUDSON"/>
     <arg value="${scratch.dir}"/>
@@ -1160,6 +1160,8 @@
     <arg value="${patch.cmd}"/>
     <arg value="${findbugs.home}"/>
     <arg value="${forrest.home}"/>
+    <arg value="${eclipse.home}"/>
+    <arg value="${python.home}"/>
     <arg value="${basedir}"/>
     <arg value="${trigger.url}"/>
     <arg value="${jira.passwd}"/>

Modified: hadoop/core/trunk/src/test/bin/test-patch.sh
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/test/bin/test-patch.sh?rev=653184&r1=653183&r2=653184&view=diff
==============================================================================
--- hadoop/core/trunk/src/test/bin/test-patch.sh (original)
+++ hadoop/core/trunk/src/test/bin/test-patch.sh Sat May  3 23:51:19 2008
@@ -12,8 +12,8 @@
     HUDSON)
       ### Set HUDSON to true to indicate that this script is being run by Hudson
       HUDSON=true
-      if [[ $# != 14 ]] ; then
-        echo "ERROR: usage $0 HUDSON <PATCH_DIR> <SUPPORT_DIR> <PS_CMD> <WGET_CMD> <JIRACLI> <SVN_CMD> <GREP_CMD> <PATCH_CMD> <FINDBUGS_HOME> <FORREST_HOME> <WORKSPACE_BASEDIR> <TRIGGER_BUILD> <JIRA_PASSWD>"
+      if [[ $# != 16 ]] ; then
+        echo "ERROR: usage $0 HUDSON <PATCH_DIR> <SUPPORT_DIR> <PS_CMD> <WGET_CMD> <JIRACLI> <SVN_CMD> <GREP_CMD> <PATCH_CMD> <FINDBUGS_HOME> <FORREST_HOME> <ECLIPSE_HOME> <PYTHON_HOME> <WORKSPACE_BASEDIR> <TRIGGER_BUILD> <JIRA_PASSWD>"
         cleanupAndExit 0
       fi
       PATCH_DIR=$2
@@ -26,9 +26,11 @@
       PATCH=$9
       FINDBUGS_HOME=${10}
       FORREST_HOME=${11}
-      BASEDIR=${12}
-      TRIGGER_BUILD_URL=${13}
-      JIRA_PASSWD=${14}
+      ECLIPSE_HOME=${12}
+      PYTHON_HOME=${13}
+      BASEDIR=${14}
+      TRIGGER_BUILD_URL=${15}
+      JIRA_PASSWD=${16}
       ### Retrieve the defect number
       if [ ! -e $PATCH_DIR/defectNum ] ; then
         echo "Could not determine the patch to test.  Exiting."
@@ -39,6 +41,8 @@
         echo "Could not determine the patch to test.  Exiting."
         cleanupAndExit 0
       fi
+      ECLIPSE_PROPERTY="-Declipse.home=$ECLIPSE_HOME"
+      PYTHON_PROPERTY="-Dpython.home=$PYTHON_HOME"
       ;;
     DEVELOPER)
       ### Set HUDSON to false to indicate that this script is being run by a developer
@@ -154,8 +158,16 @@
   if [[ $HUDSON == "true" ]] ; then
     $ANT_HOME/bin/ant -Dversion="${VERSION}" -DHadoopPatchProcess= releaseaudit &> $PATCH_DIR/trunkReleaseAuditWarnings.txt
   fi
-  $ANT_HOME/bin/ant -Dversion="${VERSION}" -Djavac.args="-Xlint -Xmaxwarns 1000" -DHadoopPatchProcess= clean tar &> $PATCH_DIR/trunkJavacWarnings.txt
+  $ANT_HOME/bin/ant -Dversion="${VERSION}" -Djavac.args="-Xlint -Xmaxwarns 1000" $ECLIPSE_PROPERTY -DHadoopPatchProcess= clean tar &> $PATCH_DIR/trunkJavacWarnings.txt
+  if [[ $? != 0 ]] ; then
+    echo "Trunk compilation is broken?"
+    cleanupAndExit 1
+  fi
   $ANT_HOME/bin/ant -Dversion="${VERSION}" -Dfindbugs.home=$FINDBUGS_HOME -DHadoopPatchProcess= findbugs &> /dev/null
+  if [[ $? != 0 ]] ; then
+    echo "Trunk findbugs is broken?"
+    cleanupAndExit 1
+  fi
   cp $BASEDIR/build/test/findbugs/*.xml $PATCH_DIR/trunkFindbugsWarnings.xml
 }
 
@@ -176,12 +188,12 @@
   if [[ $authorTags != 0 ]] ; then
     JIRA_COMMENT="$JIRA_COMMENT
 
-    @author -1.  The patch appears to contain $authorTags @author tags which the Hadoop community has agreed to not allow in code contributions."
+    -1 @author.  The patch appears to contain $authorTags @author tags which the Hadoop community has agreed to not allow in code contributions."
     return 1
   fi
   JIRA_COMMENT="$JIRA_COMMENT
 
-    @author +1.  The patch does not contain any @author tags."
+    +1 @author.  The patch does not contain any @author tags."
   return 0
 }
 
@@ -202,13 +214,13 @@
   if [[ $testReferences == 0 ]] ; then
     JIRA_COMMENT="$JIRA_COMMENT
 
-    tests included -1.  The patch doesn't appear to include any new or modified tests.
+    -1 tests included.  The patch doesn't appear to include any new or modified tests.
                         Please justify why no tests are needed for this patch."
     return 1
   fi
   JIRA_COMMENT="$JIRA_COMMENT
 
-    tests included +1.  The patch appears to include $testReferences new or modified tests."
+    +1 tests included.  The patch appears to include $testReferences new or modified tests."
   return 0
 }
 
@@ -229,7 +241,7 @@
     echo "PATCH APPLICATION FAILED"
     JIRA_COMMENT="$JIRA_COMMENT
 
-    patch -1.  The patch command could not apply the patch."
+    -1 patch.  The patch command could not apply the patch."
     return 1
   fi
   return 0
@@ -255,12 +267,12 @@
   if [[ $javadocWarnings != 0 ]] ; then
     JIRA_COMMENT="$JIRA_COMMENT
 
-    javadoc -1.  The javadoc tool appears to have generated $javadocWarnings warning messages."
+    -1 javadoc.  The javadoc tool appears to have generated $javadocWarnings warning messages."
     return 1
   fi
   JIRA_COMMENT="$JIRA_COMMENT
 
-    javadoc +1.  The javadoc tool did not generate any warning messages."
+    +1 javadoc.  The javadoc tool did not generate any warning messages."
 return 0
 }
 
@@ -276,7 +288,7 @@
   echo "======================================================================"
   echo ""
   echo ""
-  $ANT_HOME/bin/ant -Dversion="${VERSION}" -Djavac.args="-Xlint -Xmaxwarns 1000" -DHadoopPatchProcess= tar &> $PATCH_DIR/patchJavacWarnings.txt
+  $ANT_HOME/bin/ant -Dversion="${VERSION}" -Djavac.args="-Xlint -Xmaxwarns 1000" $ECLIPSE_PROPERTY -DHadoopPatchProcess= tar &> $PATCH_DIR/patchJavacWarnings.txt
 
   ### Compare trunk and patch javac warning numbers
   if [[ -f $PATCH_DIR/patchJavacWarnings.txt ]] ; then
@@ -287,14 +299,14 @@
       if [[ $patchJavacWarnings > $trunkJavacWarnings ]] ; then
         JIRA_COMMENT="$JIRA_COMMENT
 
-    javac -1.  The applied patch generated $patchJavacWarnings javac compiler warnings (more than the trunk's current $trunkJavacWarnings warnings)."
+    -1 javac.  The applied patch generated $patchJavacWarnings javac compiler warnings (more than the trunk's current $trunkJavacWarnings warnings)."
         return 1
       fi
     fi
   fi
   JIRA_COMMENT="$JIRA_COMMENT
 
-    javac +1.  The applied patch does not generate any new javac compiler warnings."
+    +1 javac.  The applied patch does not increase the total number of javac compiler warnings."
   return 0
 }
 
@@ -323,7 +335,7 @@
       if [[ $patchReleaseAuditWarnings > $trunkReleaseAuditWarnings ]] ; then
         JIRA_COMMENT="$JIRA_COMMENT
 
-    release audit -1.  The applied patch generated $patchReleaseAuditWarnings release audit warnings (more than the trunk's current $trunkReleaseAuditWarnings warnings)."
+    -1 release audit.  The applied patch generated $patchReleaseAuditWarnings release audit warnings (more than the trunk's current $trunkReleaseAuditWarnings warnings)."
         $GREP '\!?????' $PATCH_DIR/patchReleaseAuditWarnings.txt > $PATCH_DIR/patchReleaseAuditProblems.txt
         $GREP '\!?????' $PATCH_DIR/trunkReleaseAuditWarnings.txt > $PATCH_DIR/trunkReleaseAuditProblems.txt
         echo "A diff of patched release audit warnings with trunk release audit warnings." > $PATCH_DIR/releaseAuditDiffWarnings.txt
@@ -338,7 +350,7 @@
   fi
   JIRA_COMMENT="$JIRA_COMMENT
 
-    release audit +1.  The applied patch does not generate any new release audit warnings."
+    +1 release audit.  The applied patch does not increase the total number of release audit warnings."
   return 0
 }
 
@@ -365,12 +377,12 @@
 #  if [[ $patchStyleErrors != 0 ]] ; then
 #    JIRA_COMMENT="$JIRA_COMMENT
 #
-#    checkstyle -1.  The patch generated $patchStyleErrors code style errors."
+#    -1 checkstyle.  The patch generated $patchStyleErrors code style errors."
 #    return 1
 #  fi
 #  JIRA_COMMENT="$JIRA_COMMENT
 #
-#    checkstyle +1.  The patch generated 0 code style errors."
+#    +1 checkstyle.  The patch generated 0 code style errors."
   return 0
 }
 
@@ -390,7 +402,7 @@
   if [ $? != 0 ] ; then
     JIRA_COMMENT="$JIRA_COMMENT
 
-    findbugs -1.  The patch appears to cause Findbugs to fail."
+    -1 findbugs.  The patch appears to cause Findbugs to fail."
     return 1
   fi
 JIRA_COMMENT_FOOTER="Findbugs warnings: http://hudson.zones.apache.org/hudson/job/$JOB_NAME/$BUILD_NUMBER/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
@@ -413,12 +425,12 @@
   if [[ $findbugsWarnings != 0 ]] ; then
     JIRA_COMMENT="$JIRA_COMMENT
 
-    findbugs -1.  The patch appears to introduce $findbugsWarnings new Findbugs warnings."
+    -1 findbugs.  The patch appears to introduce $findbugsWarnings new Findbugs warnings."
     return 1
   fi
   JIRA_COMMENT="$JIRA_COMMENT
 
-    findbugs +1.  The patch does not introduce any new Findbugs warnings."
+    +1 findbugs.  The patch does not introduce any new Findbugs warnings."
   return 0
 }
 
@@ -442,12 +454,12 @@
   if [[ $? != 0 ]] ; then
     JIRA_COMMENT="$JIRA_COMMENT
 
-    core tests -1.  The patch failed core unit tests."
+    -1 core tests.  The patch failed core unit tests."
     return 1
   fi
   JIRA_COMMENT="$JIRA_COMMENT
 
-    core tests +1.  The patch passed core unit tests."
+    +1 core tests.  The patch passed core unit tests."
   return 0
 }
 
@@ -467,16 +479,16 @@
   ### Kill any rogue build processes from the last attempt
   $PS -auxwww | $GREP HadoopPatchProcess | /usr/bin/nawk '{print $2}' | /usr/bin/xargs -t -I {} /usr/bin/kill -9 {} > /dev/null
 
-  $ANT_HOME/bin/ant -Dversion="${VERSION}" -DHadoopPatchProcess= -Dtest.junit.output.format=xml -Dtest.output=yes test-contrib
+  $ANT_HOME/bin/ant -Dversion="${VERSION}" $ECLIPSE_PROPERTY $PYTHON_PROPERTY -DHadoopPatchProcess= -Dtest.junit.output.format=xml -Dtest.output=yes test-contrib
   if [[ $? != 0 ]] ; then
     JIRA_COMMENT="$JIRA_COMMENT
 
-    contrib tests -1.  The patch failed contrib unit tests."
+    -1 contrib tests.  The patch failed contrib unit tests."
     return 1
   fi
   JIRA_COMMENT="$JIRA_COMMENT
 
-    contrib tests +1.  The patch passed contrib unit tests."
+    +1 contrib tests.  The patch passed contrib unit tests."
   return 0
 }
 
@@ -573,9 +585,10 @@
 checkTests
 (( RESULT = RESULT + $? ))
 applyPatch
-if [[ $? != 0 ]] ; then
+(( RESULT = RESULT + $? ))
+if [[ $RESULT != 0 ]] ; then
   submitJiraComment 1
-  cleanupAndExit $?
+  cleanupAndExit $RESULT
 fi
 checkJavadocWarnings
 (( RESULT = RESULT + $? ))