From 01f24e1af76c41d3fc0fb7179d4a715a5f6061e0 Mon Sep 17 00:00:00 2001 From: Mahadev Konar Date: Thu, 25 Aug 2011 19:31:02 +0000 Subject: [PATCH] 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 --- dev-support/smart-apply-patch.sh | 6 +++--- dev-support/test-patch.sh | 15 ++++++++------- .../test-patch.properties => dev-support} | 0 .../test-patch.properties => dev-support} | 0 .../test => dev-support}/test-patch.properties | 0 5 files changed, 11 insertions(+), 10 deletions(-) rename hadoop-common-project/{hadoop-common/dev-support/test-patch.properties => dev-support} (100%) rename hadoop-hdfs-project/{hadoop-hdfs/dev-support/test-patch.properties => dev-support} (100%) rename hadoop-mapreduce-project/{src/test => dev-support}/test-patch.properties (100%) diff --git a/dev-support/smart-apply-patch.sh b/dev-support/smart-apply-patch.sh index 815e45b675..4ef1e8ae37 100755 --- a/dev-support/smart-apply-patch.sh +++ b/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 diff --git a/dev-support/test-patch.sh b/dev-support/test-patch.sh index 43eba2abe1..d70af6832e 100755 --- a/dev-support/test-patch.sh +++ b/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 diff --git a/hadoop-common-project/hadoop-common/dev-support/test-patch.properties b/hadoop-common-project/dev-support similarity index 100% rename from hadoop-common-project/hadoop-common/dev-support/test-patch.properties rename to hadoop-common-project/dev-support diff --git a/hadoop-hdfs-project/hadoop-hdfs/dev-support/test-patch.properties b/hadoop-hdfs-project/dev-support similarity index 100% rename from hadoop-hdfs-project/hadoop-hdfs/dev-support/test-patch.properties rename to hadoop-hdfs-project/dev-support diff --git a/hadoop-mapreduce-project/src/test/test-patch.properties b/hadoop-mapreduce-project/dev-support/test-patch.properties similarity index 100% rename from hadoop-mapreduce-project/src/test/test-patch.properties rename to hadoop-mapreduce-project/dev-support/test-patch.properties