Browse Source

HADOOP-4244. Change test-patch.sh to check Eclipse classpath no matter it is run by Hudson or not. (szetszwo)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/trunk@698721 13f79535-47bb-0310-9956-ffa450edef68
Tsz-wo Sze 16 years ago
parent
commit
b178f62823
2 changed files with 31 additions and 3 deletions
  1. 3 0
      CHANGES.txt
  2. 28 3
      src/test/bin/test-patch.sh

+ 3 - 0
CHANGES.txt

@@ -14,6 +14,9 @@ Trunk (unreleased changes)
     HADOOP-4245. Update to latest version of KFS "glue" library jar. 
     (Sriram Rao via lohit)
 
+    HADOOP-4244. Change test-patch.sh to check Eclipse classpath no matter
+    it is run by Hudson or not. (szetszwo)
+
   OPTIMIZATIONS
 
   BUG FIXES

+ 28 - 3
src/test/bin/test-patch.sh

@@ -491,7 +491,7 @@ runCoreTests () {
 
 ###############################################################################
 ### Tests parts of contrib specific to the eclipse files
-runContribTestOnEclipseFiles () {
+checkJarFilesDeclaredInEclipse () {
   export DECLARED_JARS=$(sed -n 's@.*kind="lib".*path="\(.*jar\)".*@\1@p' < .eclipse.templates/.classpath)
   export PRESENT_JARS=$(find lib/ src/test/lib/ -name '*.jar' |sort)
   # When run by Hudson, consider libs from ${SUPPORT_DIR} declared
@@ -515,6 +515,29 @@ FAILED: $dir is referenced in the Eclipse project although it doesn't exists any
   return 0
 }
 
+checkEclipse () {
+  echo ""
+  echo ""
+  echo "======================================================================"
+  echo "======================================================================"
+  echo "    Running Eclipse classpath verification."
+  echo "======================================================================"
+  echo "======================================================================"
+  echo ""
+  echo ""
+
+  checkJarFilesDeclaredInEclipse
+  if [[ $? != 0 ]] ; then
+    JIRA_COMMENT="$JIRA_COMMENT
+
+    -1 Eclipse classpath. The patch causes the Eclipse classpath to differ from the contents of the lib directories."
+    return 1
+  fi
+  JIRA_COMMENT="$JIRA_COMMENT
+
+    +1 Eclipse classpath. The patch retains Eclipse classpath integrity."
+  return 0
+}
 ###############################################################################
 ### Run the test-contrib target
 runContribTests () {
@@ -531,8 +554,8 @@ runContribTests () {
   ### 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
 
-  echo "$ANT_HOME/bin/ant -Dversion="${VERSION}" $ECLIPSE_PROPERTY $PYTHON_PROPERTY -DHadoopPatchProcess= -Dtest.junit.output.format=xml -Dtest.output=yes test-contrib && runContribTestOnEclipseFiles"
-  $ANT_HOME/bin/ant -Dversion="${VERSION}" $ECLIPSE_PROPERTY $PYTHON_PROPERTY -DHadoopPatchProcess= -Dtest.junit.output.format=xml -Dtest.output=yes test-contrib && runContribTestOnEclipseFiles
+  echo "$ANT_HOME/bin/ant -Dversion="${VERSION}" $ECLIPSE_PROPERTY $PYTHON_PROPERTY -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
 
@@ -650,6 +673,8 @@ checkStyle
 (( RESULT = RESULT + $? ))
 checkFindbugsWarnings
 (( RESULT = RESULT + $? ))
+checkEclipse
+(( RESULT = RESULT + $? ))
 ### Do not call these when run by a developer 
 if [[ $HUDSON == "true" ]] ; then
   ### DISABLE RELEASE AUDIT UNTIL HADOOP-4074 IS FIXED