HBASE-14310 test-patch.sh should handle spurious non-zero exit code from maven

This commit is contained in:
tedyu 2015-08-26 09:37:41 -07:00
parent ff86749cae
commit aca8c3b74b
1 changed files with 6 additions and 3 deletions

View File

@ -335,10 +335,13 @@ setup () {
$MVN clean package checkstyle:checkstyle-aggregate findbugs:findbugs -DskipTests \
-D${PROJECT_NAME}PatchProcess > $PATCH_DIR/trunkJavacWarnings.txt 2>&1
if [[ $? != 0 ]] ; then
echo "mvn exit code was $?"
ERR=`$GREP -A 5 'Compilation failure' $PATCH_DIR/trunkJavacWarnings.txt`
echo "Trunk compilation is broken?
{code}$ERR{code}"
cleanupAndExit 1
if [[ ${#ERR} -ge 1 ]] ; then
echo "Trunk compilation is broken?
{code}$ERR{code}"
cleanupAndExit 1
fi
fi
mv target/checkstyle-result.xml $PATCH_DIR/trunkCheckstyle.xml
collectFindbugsReports trunk $BASEDIR $PATCH_DIR