HADOOP-7042. Updates to test-patch.sh to include failed test names and improve other messaging. Contributed by nigel.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1036694 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Nigel Daley 2010-11-19 00:44:11 +00:00
parent 64f710109d
commit 916e3011db
3 changed files with 12 additions and 6 deletions

View File

@ -8,6 +8,9 @@ Trunk (unreleased changes)
IMPROVEMENTS IMPROVEMENTS
HADOOP-7042. Updates to test-patch.sh to include failed test names and
improve other messaging. (nigel)
OPTIMIZATIONS OPTIMIZATIONS
BUG FIXES BUG FIXES

View File

@ -18,7 +18,7 @@ ulimit -n 1024
### Setup some variables. ### Setup some variables.
### SVN_REVISION and BUILD_URL are set by Hudson if it is run by patch process ### SVN_REVISION and BUILD_URL are set by Hudson if it is run by patch process
### Read variables from properties file ### Read variables from properties file
. `dirname $0`/test-patch.properties . `dirname $0`/../test-patch.properties
############################################################################### ###############################################################################
parseArgs() { parseArgs() {
@ -433,6 +433,7 @@ $JIRA_COMMENT_FOOTER"
############################################################################### ###############################################################################
### Check there are no changes in the number of Findbugs warnings ### Check there are no changes in the number of Findbugs warnings
checkFindbugsWarnings () { checkFindbugsWarnings () {
findbugs_version=`${FINDBUGS_HOME}/bin/findbugs -version`
echo "" echo ""
echo "" echo ""
echo "======================================================================" echo "======================================================================"
@ -447,7 +448,7 @@ checkFindbugsWarnings () {
if [ $? != 0 ] ; then if [ $? != 0 ] ; then
JIRA_COMMENT="$JIRA_COMMENT JIRA_COMMENT="$JIRA_COMMENT
-1 findbugs. The patch appears to cause Findbugs to fail." -1 findbugs. The patch appears to cause Findbugs (version ${findbugs_version}) to fail."
return 1 return 1
fi fi
JIRA_COMMENT_FOOTER="Findbugs warnings: $BUILD_URL/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html JIRA_COMMENT_FOOTER="Findbugs warnings: $BUILD_URL/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
@ -468,12 +469,12 @@ $JIRA_COMMENT_FOOTER"
if [[ $findbugsWarnings > $OK_FINDBUGS_WARNINGS ]] ; then if [[ $findbugsWarnings > $OK_FINDBUGS_WARNINGS ]] ; then
JIRA_COMMENT="$JIRA_COMMENT JIRA_COMMENT="$JIRA_COMMENT
-1 findbugs. The patch appears to introduce `expr $(($findbugsWarnings-$OK_FINDBUGS_WARNINGS))` new Findbugs warnings." -1 findbugs. The patch appears to introduce `expr $(($findbugsWarnings-$OK_FINDBUGS_WARNINGS))` new Findbugs (version ${findbugs_version}) warnings."
return 1 return 1
fi fi
JIRA_COMMENT="$JIRA_COMMENT JIRA_COMMENT="$JIRA_COMMENT
+1 findbugs. The patch does not introduce any new Findbugs warnings." +1 findbugs. The patch does not introduce any new Findbugs (version ${findbugs_version}) warnings."
return 0 return 0
} }
@ -500,9 +501,11 @@ runCoreTests () {
echo "$ANT_HOME/bin/ant -Dversion="${VERSION}" -DHadoopPatchProcess= -Dtest.junit.output.format=xml -Dtest.output=yes -Dcompile.c++=yes -Dforrest.home=$FORREST_HOME -Djava5.home=$JAVA5_HOME $PreTestTarget test-core" echo "$ANT_HOME/bin/ant -Dversion="${VERSION}" -DHadoopPatchProcess= -Dtest.junit.output.format=xml -Dtest.output=yes -Dcompile.c++=yes -Dforrest.home=$FORREST_HOME -Djava5.home=$JAVA5_HOME $PreTestTarget test-core"
$ANT_HOME/bin/ant -Dversion="${VERSION}" -DHadoopPatchProcess= -Dtest.junit.output.format=xml -Dtest.output=yes -Dcompile.c++=yes -Dforrest.home=$FORREST_HOME -Djava5.home=$JAVA5_HOME $PreTestTarget test-core $ANT_HOME/bin/ant -Dversion="${VERSION}" -DHadoopPatchProcess= -Dtest.junit.output.format=xml -Dtest.output=yes -Dcompile.c++=yes -Dforrest.home=$FORREST_HOME -Djava5.home=$JAVA5_HOME $PreTestTarget test-core
if [[ $? != 0 ]] ; then if [[ $? != 0 ]] ; then
failed_tests=`grep -l "<failure" build/test/*.xml | sed -e "s|build/test/TEST-| |g" | sed -e "s|\.xml||g"`
JIRA_COMMENT="$JIRA_COMMENT JIRA_COMMENT="$JIRA_COMMENT
-1 core tests. The patch failed core unit tests." -1 core tests. The patch failed these core unit tests:
$failed_tests"
return 1 return 1
fi fi
JIRA_COMMENT="$JIRA_COMMENT JIRA_COMMENT="$JIRA_COMMENT

View File

@ -14,5 +14,5 @@
# limitations under the License. # limitations under the License.
OK_RELEASEAUDIT_WARNINGS=1 OK_RELEASEAUDIT_WARNINGS=1
OK_FINDBUGS_WARNINGS=0 OK_FINDBUGS_WARNINGS=1
OK_JAVADOC_WARNINGS=6 OK_JAVADOC_WARNINGS=6