ソースを参照

HADOOP-7578. Fix test-patch to be able to run on MR patches. (mahadev and tom white)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1161711 13f79535-47bb-0310-9956-ffa450edef68
Mahadev Konar 13 年 前
コミット
01f24e1af7

+ 3 - 3
dev-support/smart-apply-patch.sh

@@ -56,18 +56,18 @@ fi
 PREFIX_DIRS=$(cut -d '/' -f 1 $TMP | sort | uniq)
 
 # if we are at the project root then nothing more to do
-if [[ -d hadoop-common ]]; then
+if [[ -d hadoop-common-project ]]; then
   echo Looks like this is being run at project root
 
 # if all of the lines start with hadoop-common/, hadoop-hdfs/, or hadoop-mapreduce/, this is
 # relative to the hadoop root instead of the subproject root, so we need
 # to chop off another layer
-elif [[ "$PREFIX_DIRS" =~ ^(hadoop-alfredo|hadoop-annotations|hadoop-common|hadoop-hdfs|hadoop-mapreduce)$ ]]; then
+elif [[ "$PREFIX_DIRS" =~ ^(hadoop-common-project|hadoop-hdfs-project|hadoop-mapreduce-project)$ ]]; then
 
   echo Looks like this is relative to project root. Increasing PLEVEL
   PLEVEL=$[$PLEVEL + 1]
 
-elif ! echo "$PREFIX_DIRS" | grep -vxq 'hadoop-alfredo\|hadoop-annotations\|hadoop-common\|hadoop-hdfs\|hadoop-mapreduce' ; then
+elif ! echo "$PREFIX_DIRS" | grep -vxq 'hadoop-common-project\|hadoop-hdfs-project\|hadoop-mapreduce-project' ; then
   echo Looks like this is a cross-subproject patch. Try applying from the project root
   exit 1
 fi

+ 8 - 7
dev-support/test-patch.sh

@@ -370,8 +370,8 @@ checkJavadocWarnings () {
   if [ -d hadoop-project ]; then
     (cd hadoop-project; $MVN install)
   fi
-  if [ -d hadoop-annotations ]; then  
-    (cd hadoop-annotations; $MVN install)
+  if [ -d hadoop-common-project/hadoop-annotations ]; then  
+    (cd hadoop-common-project/hadoop-annotations; $MVN install)
   fi
   $MVN clean compile javadoc:javadoc -DskipTests -Pdocs -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}'`
@@ -520,8 +520,8 @@ checkFindbugsWarnings () {
   echo "======================================================================"
   echo ""
   echo ""
-  echo "$MVN clean compile findbugs:findbugs -D${PROJECT_NAME}PatchProcess"
-  $MVN clean compile findbugs:findbugs -D${PROJECT_NAME}PatchProcess
+  echo "$MVN clean compile findbugs:findbugs -D${PROJECT_NAME}PatchProcess" 
+  $MVN clean compile findbugs:findbugs -D${PROJECT_NAME}PatchProcess < /dev/null
 
   if [ $? != 0 ] ; then
     JIRA_COMMENT="$JIRA_COMMENT
@@ -536,6 +536,7 @@ checkFindbugsWarnings () {
     relative_file=${file#$BASEDIR/} # strip leading $BASEDIR prefix
     if [ ! $relative_file == "target/findbugsXml.xml" ]; then
       module_suffix=${relative_file%/target/findbugsXml.xml} # strip trailing path
+      module_suffix=`basename ${module_suffix}`
     fi
     
     cp $file $PATCH_DIR/patchFindbugsWarnings${module_suffix}.xml
@@ -630,12 +631,12 @@ findModules () {
 
   PREFIX_DIRS=$(cut -d '/' -f 1 $TMP | sort | uniq)
 
-  # if all of the lines start with hadoop-common/, hadoop-hdfs/, or hadoop-mapreduce/, this is
+  # if all of the lines start with hadoop-common-project/, hadoop-hdfs-project/, or hadoop-mapreduce-project/, this is
   # relative to the hadoop root instead of the subproject root
-  if [[ "$PREFIX_DIRS" =~ ^(hadoop-alfredo|hadoop-annotations|hadoop-common|hadoop-hdfs|hadoop-mapreduce)$ ]]; then
+  if [[ "$PREFIX_DIRS" =~ ^(hadoop-common-project|hadoop-hdfs-project|hadoop-mapreduce-project)$ ]]; then
     echo $PREFIX_DIRS
     return 0
-  elif ! echo "$PREFIX_DIRS" | grep -vxq 'hadoop-alfredo\|hadoop-annotations\|hadoop-common\|hadoop-hdfs\|hadoop-mapreduce' ; then
+  elif ! echo "$PREFIX_DIRS" | grep -vxq 'hadoop-common-project\|hadoop-hdfs-project\|hadoop-mapreduce-project' ; then
     echo $PREFIX_DIRS
     return 0
   fi

+ 0 - 0
hadoop-common-project/hadoop-common/dev-support/test-patch.properties → hadoop-common-project/dev-support


+ 0 - 0
hadoop-hdfs-project/hadoop-hdfs/dev-support/test-patch.properties → hadoop-hdfs-project/dev-support


+ 0 - 0
hadoop-mapreduce-project/src/test/test-patch.properties → hadoop-mapreduce-project/dev-support/test-patch.properties