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
This commit is contained in:
Mahadev Konar 2011-08-25 19:31:02 +00:00
parent 58676edf98
commit 01f24e1af7
5 changed files with 11 additions and 10 deletions

View File

@ -56,18 +56,18 @@ fi
PREFIX_DIRS=$(cut -d '/' -f 1 $TMP | sort | uniq) PREFIX_DIRS=$(cut -d '/' -f 1 $TMP | sort | uniq)
# if we are at the project root then nothing more to do # 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 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 # 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 # relative to the hadoop root instead of the subproject root, so we need
# to chop off another layer # 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 echo Looks like this is relative to project root. Increasing PLEVEL
PLEVEL=$[$PLEVEL + 1] 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 echo Looks like this is a cross-subproject patch. Try applying from the project root
exit 1 exit 1
fi fi

View File

@ -370,8 +370,8 @@ checkJavadocWarnings () {
if [ -d hadoop-project ]; then if [ -d hadoop-project ]; then
(cd hadoop-project; $MVN install) (cd hadoop-project; $MVN install)
fi fi
if [ -d hadoop-annotations ]; then if [ -d hadoop-common-project/hadoop-annotations ]; then
(cd hadoop-annotations; $MVN install) (cd hadoop-common-project/hadoop-annotations; $MVN install)
fi fi
$MVN clean compile javadoc:javadoc -DskipTests -Pdocs -D${PROJECT_NAME}PatchProcess > $PATCH_DIR/patchJavadocWarnings.txt 2>&1 $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}'` 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 ""
echo "" echo ""
echo "$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 $MVN clean compile findbugs:findbugs -D${PROJECT_NAME}PatchProcess < /dev/null
if [ $? != 0 ] ; then if [ $? != 0 ] ; then
JIRA_COMMENT="$JIRA_COMMENT JIRA_COMMENT="$JIRA_COMMENT
@ -536,6 +536,7 @@ checkFindbugsWarnings () {
relative_file=${file#$BASEDIR/} # strip leading $BASEDIR prefix relative_file=${file#$BASEDIR/} # strip leading $BASEDIR prefix
if [ ! $relative_file == "target/findbugsXml.xml" ]; then if [ ! $relative_file == "target/findbugsXml.xml" ]; then
module_suffix=${relative_file%/target/findbugsXml.xml} # strip trailing path module_suffix=${relative_file%/target/findbugsXml.xml} # strip trailing path
module_suffix=`basename ${module_suffix}`
fi fi
cp $file $PATCH_DIR/patchFindbugsWarnings${module_suffix}.xml cp $file $PATCH_DIR/patchFindbugsWarnings${module_suffix}.xml
@ -630,12 +631,12 @@ findModules () {
PREFIX_DIRS=$(cut -d '/' -f 1 $TMP | sort | uniq) 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 # 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 echo $PREFIX_DIRS
return 0 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 echo $PREFIX_DIRS
return 0 return 0
fi fi