You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@oozie.apache.org by rk...@apache.org on 2013/02/04 18:57:26 UTC
svn commit: r1442216 - /oozie/branches/branch-3.3/bin/
Author: rkanter
Date: Mon Feb 4 17:57:26 2013
New Revision: 1442216
URL: http://svn.apache.org/viewvc?rev=1442216&view=rev
Log:
OOZIE-992 Add overall status to test-patch messages and add some color-coding for negative results (tucu)
Modified:
oozie/branches/branch-3.3/bin/test-patch
oozie/branches/branch-3.3/bin/test-patch-05-patch-raw-analysis
oozie/branches/branch-3.3/bin/test-patch-08-rat
oozie/branches/branch-3.3/bin/test-patch-09-javadoc
oozie/branches/branch-3.3/bin/test-patch-10-compile
oozie/branches/branch-3.3/bin/test-patch-15-backwards-compatibility
oozie/branches/branch-3.3/bin/test-patch-20-tests
oozie/branches/branch-3.3/bin/test-patch-30-distro
oozie/branches/branch-3.3/bin/test-patch-XX-template
Modified: oozie/branches/branch-3.3/bin/test-patch
URL: http://svn.apache.org/viewvc/oozie/branches/branch-3.3/bin/test-patch?rev=1442216&r1=1442215&r2=1442216&view=diff
==============================================================================
--- oozie/branches/branch-3.3/bin/test-patch (original)
+++ oozie/branches/branch-3.3/bin/test-patch Mon Feb 4 17:57:26 2013
@@ -272,7 +272,7 @@ applyPatch() {
>> $STDOUT
if [[ ${PIPESTATUS[0]} != 0 ]] ; then
echo "Patch failed to apply to head of branch"
- echo "Patch failed to apply to head of branch" >> ${SUMMARYFILE}
+ echo "{color:red}-1{code} Patch failed to apply to head of branch" >> ${SUMMARYFILE}
echo "" >> ${SUMMARYFILE}
echo "----------------------------" >> ${SUMMARYFILE}
if [ "${JIRAUPDATE}" == "true" ] ; then
@@ -289,7 +289,7 @@ applyPatch() {
fi
echo "" >> $STDOUT
echo "Patch applied"
- echo "+1 PATCH_APPLIES" >> $SUMMARYFILE
+ echo "{color:green}+1{color} PATCH_APPLIES" >> $SUMMARYFILE
echo
}
###############################################################################
@@ -372,10 +372,6 @@ if [ "${PATCHFILE}" == "" ] ; then
downloadPatch ${JIRAISSUE}
fi
-if [ "${JIRAUPDATE}" == "true" ] ; then
- echo "{code}" >> ${SUMMARYFILE}
-fi
-
echo "----------------------------" >> ${SUMMARYFILE}
echo "" >> ${SUMMARYFILE}
getAllTasks
@@ -385,11 +381,12 @@ postPatchRun
createReports
echo "" >> ${SUMMARYFILE}
echo "----------------------------" >> ${SUMMARYFILE}
-
-if [ "${JIRAUPDATE}" == "true" ] ; then
- echo "{code}" >> ${SUMMARYFILE}
+MINUSONES=`grep -c "\-1" ${SUMMARYFILE}`
+if [[ $MINUSONES == 0 ]]; then
+ echo "{color:green}Overall result: Good!, no -1s{color}" >> ${SUMMARYFILE}
+else
+ echo "{color:red}Overall result: Please check the reported -1(s){color}" >> ${SUMMARYFILE}
fi
-
echo "" >> ${SUMMARYFILE}
if [ ! -z "${JIRAISSUE}" ]; then
Modified: oozie/branches/branch-3.3/bin/test-patch-05-patch-raw-analysis
URL: http://svn.apache.org/viewvc/oozie/branches/branch-3.3/bin/test-patch-05-patch-raw-analysis?rev=1442216&r1=1442215&r2=1442216&view=diff
==============================================================================
--- oozie/branches/branch-3.3/bin/test-patch-05-patch-raw-analysis (original)
+++ oozie/branches/branch-3.3/bin/test-patch-05-patch-raw-analysis Mon Feb 4 17:57:26 2013
@@ -76,27 +76,27 @@ parseArgs() {
checkNoAuthors() {
authorTags=`grep "^+ " ${PATCHFILE} | grep -c -i -e ".*\*.* @author"`
if [[ ${authorTags} != 0 ]] ; then
- REPORT+=("-1 the patch seems to contain ${authorTags} line(s) with @author tags")
+ REPORT+=("{color:red}-1{color} the patch seems to contain ${authorTags} line(s) with @author tags")
else
- REPORT+=("+1 the patch does not introduce any @author tags")
+ REPORT+=("{color:green}+1{code} the patch does not introduce any @author tags")
fi
}
###############################################################################
checkNoTabs() {
tabs=`grep "^+ " ${PATCHFILE} | grep -c -P "\t"`
if [[ ${tabs} != 0 ]] ; then
- REPORT+=("-1 the patch contains ${tabs} line(s) with tabs")
+ REPORT+=("{color:red}-1{code} the patch contains ${tabs} line(s) with tabs")
else
- REPORT+=("+1 the patch does not introduce any tabs")
+ REPORT+=("{color:green}+1{code} the patch does not introduce any tabs")
fi
}
###############################################################################
checkNoTrailingSpaces() {
trailingSpaces=`grep "^+ " ${PATCHFILE} | grep -c -e " $"`
if [[ ${trailingSpaces} != 0 ]] ; then
- REPORT+=("-1 the patch contains ${trailingSpaces} line(s) with trailing spaces")
+ REPORT+=("{color:red}-1{code} the patch contains ${trailingSpaces} line(s) with trailing spaces")
else
- REPORT+=("+1 the patch does not introduce any trailing spaces")
+ REPORT+=("{color:green}+1{code} the patch does not introduce any trailing spaces")
fi
}
###############################################################################
@@ -104,20 +104,20 @@ checkLinesLength() {
# We check for > 133 to account for the "+" sign
longLines=`grep "^+ " ${PATCHFILE} | awk 'BEGIN{count=0}{if ( length > 133 ) { count=count+1} }END{ print count}'`
if [[ ${longLines} != 0 ]] ; then
- REPORT+=("-1 the patch contains ${longLines} line(s) longer than 132 characters")
+ REPORT+=("{color:red}-1{code} the patch contains ${longLines} line(s) longer than 132 characters")
else
- REPORT+=("+1 the patch does not introduce any line longer than 132")
+ REPORT+=("{color:green}+1{code} the patch does not introduce any line longer than 132")
fi
}
###############################################################################
checkForTestcases() {
testcases=`grep -c -i -e '^+++.*/test' ${PATCHFILE}`
if [[ ${testcases} == 0 ]] ; then
- REPORT+=("-1 the patch does not add/modify any testcase")
+ REPORT+=("{color:red}-1{code} the patch does not add/modify any testcase")
#reverting for summary +1 calculation
testcases=1
else
- REPORT+=("+1 the patch does adds/modifies ${testcases} testcase(s)")
+ REPORT+=("{color:green}+1{code} the patch does adds/modifies ${testcases} testcase(s)")
#reverting for summary +1 calculation
testcases=0
fi
@@ -140,9 +140,9 @@ case $OP in
checkForTestcases
total=`expr $authorTags + $tabs + $trailingSpaces + $longLines + $testcases`
if [[ $total == 0 ]] ; then
- echo "+1 ${TASKNAME}" >> $SUMMARYFILE
+ echo "{color:green}+1{code} ${TASKNAME}" >> $SUMMARYFILE
else
- echo "-1 ${TASKNAME}" >> $SUMMARYFILE
+ echo "{color:red}-1{code} ${TASKNAME}" >> $SUMMARYFILE
fi
for line in "${REPORT[@]}" ; do
echo " ${line}" >> $SUMMARYFILE
Modified: oozie/branches/branch-3.3/bin/test-patch-08-rat
URL: http://svn.apache.org/viewvc/oozie/branches/branch-3.3/bin/test-patch-08-rat?rev=1442216&r1=1442215&r2=1442216&view=diff
==============================================================================
--- oozie/branches/branch-3.3/bin/test-patch-08-rat (original)
+++ oozie/branches/branch-3.3/bin/test-patch-08-rat Mon Feb 4 17:57:26 2013
@@ -81,14 +81,14 @@ checkForWarnings() {
patchWarns=`grep -c '\!?????' ${REPORTDIR}/${TASKNAME}-patch.txt`
newWarns=`expr $patchWarns - $cleanWarns`
if [[ $newWarns -le 0 ]] ; then
- REPORT+=("+1 the patch does not seem to introduce new RAT warnings")
+ REPORT+=("{color:green}+1{code} the patch does not seem to introduce new RAT warnings")
newWarns=0
else
- REPORT+=("-1 the patch seems to introduce $newWarns new RAT warning(s)")
+ REPORT+=("{color:red}-1{code} the patch seems to introduce $newWarns new RAT warning(s)")
newWarns=1
fi
if [[ $cleanWarns != 0 ]] ; then
- REPORT+=("WARNING: the current HEAD has $cleanWarns RAT warning(s), they should be addressed ASAP")
+ REPORT+=("{color:red}WARNING: the current HEAD has $cleanWarns RAT warning(s), they should be addressed ASAP{color}")
fi
}
###############################################################################
@@ -106,9 +106,9 @@ case $OP in
report)
checkForWarnings
if [[ $newWarns == 0 ]] ; then
- echo "+1 ${TASKNAME}" >> $SUMMARYFILE
+ echo "{color:green}+1{code} ${TASKNAME}" >> $SUMMARYFILE
else
- echo "-1 ${TASKNAME}" >> $SUMMARYFILE
+ echo "{color:red}-1{code} ${TASKNAME}" >> $SUMMARYFILE
fi
for line in "${REPORT[@]}" ; do
echo " ${line}" >> $SUMMARYFILE
Modified: oozie/branches/branch-3.3/bin/test-patch-09-javadoc
URL: http://svn.apache.org/viewvc/oozie/branches/branch-3.3/bin/test-patch-09-javadoc?rev=1442216&r1=1442215&r2=1442216&view=diff
==============================================================================
--- oozie/branches/branch-3.3/bin/test-patch-09-javadoc (original)
+++ oozie/branches/branch-3.3/bin/test-patch-09-javadoc Mon Feb 4 17:57:26 2013
@@ -81,10 +81,10 @@ checkForWarnings() {
patchWarns=`grep '\[WARNING\]' ${REPORTDIR}/${TASKNAME}-patch.txt | awk '/Javadoc Warnings/,EOF' | grep warning | awk 'BEGIN {total = 0} {total += 1} END {print total}'`
newWarns=`expr $patchWarns - $cleanWarns`
if [[ $newWarns -le 0 ]] ; then
- REPORT+=("+1 the patch does not seem to introduce new Javadoc warnings")
+ REPORT+=("{color:green}+1{code} the patch does not seem to introduce new Javadoc warnings")
newWarns=0
else
- REPORT+=("-1 the patch seems to introduce $newWarns new Javadoc warning(s)")
+ REPORT+=("{color:red}-1{code} the patch seems to introduce $newWarns new Javadoc warning(s)")
newWarns=1
fi
if [[ $cleanWarns != 0 ]] ; then
@@ -105,9 +105,9 @@ case $OP in
report)
checkForWarnings
if [[ $newWarns == 0 ]] ; then
- echo "+1 ${TASKNAME}" >> $SUMMARYFILE
+ echo "{color:green}+1{code} ${TASKNAME}" >> $SUMMARYFILE
else
- echo "-1 ${TASKNAME}" >> $SUMMARYFILE
+ echo "{color:red}-1{code} ${TASKNAME}" >> $SUMMARYFILE
fi
for line in "${REPORT[@]}" ; do
echo " ${line}" >> $SUMMARYFILE
Modified: oozie/branches/branch-3.3/bin/test-patch-10-compile
URL: http://svn.apache.org/viewvc/oozie/branches/branch-3.3/bin/test-patch-10-compile?rev=1442216&r1=1442215&r2=1442216&view=diff
==============================================================================
--- oozie/branches/branch-3.3/bin/test-patch-10-compile (original)
+++ oozie/branches/branch-3.3/bin/test-patch-10-compile Mon Feb 4 17:57:26 2013
@@ -87,10 +87,10 @@ checkForWarnings() {
patchWarns=`cat ${TEMPDIR}/${TASKNAME}-javacwarns-patch.txt | awk 'BEGIN {total = 0} {total += 1} END {print total}'`
newWarns=`expr $patchWarns - $cleanWarns`
if [[ $newWarns -le 0 ]] ; then
- REPORT+=("+1 the patch does not seem to introduce new javac warnings")
+ REPORT+=("{color:green}+1{code} the patch does not seem to introduce new javac warnings")
newWarns=0
else
- REPORT+=("-1 the patch seems to introduce $newWarns new javac warning(s)")
+ REPORT+=("{color:red}-1{code} the patch seems to introduce $newWarns new javac warning(s)")
newWarns=1
fi
}
@@ -103,17 +103,17 @@ case $OP in
pre)
mvn clean test -PtestPatchCompile -DskipTests ${MVNPASSTHRU} | tee ${REPORTDIR}/${TASKNAME}-clean.txt >> $STDOUT
if [[ ${PIPESTATUS[0]} == 0 ]] ; then
- echo "+1 HEAD compiles" >> ${TEMPDIR}/${TASKNAME}-compile.txt
+ echo "{color:green}+1{code} HEAD compiles" >> ${TEMPDIR}/${TASKNAME}-compile.txt
else
- echo "-1 HEAD does not compile" >> ${TEMPDIR}/${TASKNAME}-compile.txt
+ echo "{color:red}-1{code} HEAD does not compile" >> ${TEMPDIR}/${TASKNAME}-compile.txt
fi
;;
post)
mvn clean test -PtestPatchCompile -DskipTests ${MVNPASSTHRU} | tee ${REPORTDIR}/${TASKNAME}-patch.txt >> $STDOUT
if [[ ${PIPESTATUS[0]} == 0 ]] ; then
- echo "+1 patch compiles" >> ${TEMPDIR}/${TASKNAME}-compile.txt
+ echo "{color:green}+1{code} patch compiles" >> ${TEMPDIR}/${TASKNAME}-compile.txt
else
- echo "-1 patch does not compile" >> ${TEMPDIR}/${TASKNAME}-compile.txt
+ echo "{color:red}-1{code} patch does not compile" >> ${TEMPDIR}/${TASKNAME}-compile.txt
fi
;;
report)
@@ -128,9 +128,9 @@ case $OP in
checkForWarnings
total=`expr $compileErrors + $newWarns`
if [[ $total == 0 ]] ; then
- echo "+1 ${TASKNAME}" >> $SUMMARYFILE
+ echo "{color:green}+1{code} ${TASKNAME}" >> $SUMMARYFILE
else
- echo "-1 ${TASKNAME}" >> $SUMMARYFILE
+ echo "{color:red}-1{code} ${TASKNAME}" >> $SUMMARYFILE
fi
for line in "${REPORT[@]}" ; do
echo " ${line}" >> $SUMMARYFILE
Modified: oozie/branches/branch-3.3/bin/test-patch-15-backwards-compatibility
URL: http://svn.apache.org/viewvc/oozie/branches/branch-3.3/bin/test-patch-15-backwards-compatibility?rev=1442216&r1=1442215&r2=1442216&view=diff
==============================================================================
--- oozie/branches/branch-3.3/bin/test-patch-15-backwards-compatibility (original)
+++ oozie/branches/branch-3.3/bin/test-patch-15-backwards-compatibility Mon Feb 4 17:57:26 2013
@@ -76,9 +76,9 @@ parseArgs() {
checkJPAAnnotations() {
annotations=`grep -c -E "^(\+|\-).*(@Column|@Lob|@Basic|@Entity|@Transient)" ${PATCHFILE}`
if [[ ${annotations} != 0 ]] ; then
- REPORT+=("-1 the patch seems to change ${annotations} line(s) with JPA Entity/Colum/Basic/Lob/Transient annotations")
+ REPORT+=("{color:red}-1{code} the patch seems to change ${annotations} line(s) with JPA Entity/Colum/Basic/Lob/Transient annotations")
else
- REPORT+=("+1 the patch does not change any JPA Entity/Colum/Basic/Lob/Transient annotations")
+ REPORT+=("{color:green}+1{code} the patch does not change any JPA Entity/Colum/Basic/Lob/Transient annotations")
fi
}
###############################################################################
@@ -87,9 +87,9 @@ checkJPAFiles() {
ormXml=`grep -c -i -E '^\+\+\+.*/*-orm.xml' ${PATCHFILE}`
jpaFiles=`expr $persistenceXml + $ormXml`
if [[ ${jpaFiles} != 0 ]] ; then
- REPORT+=("-1 the patch modifies ${jpaFiles} JPA file(s), persistence.xml or *-orm.xml")
+ REPORT+=("{color:red}-1{code} the patch modifies ${jpaFiles} JPA file(s), persistence.xml or *-orm.xml")
else
- REPORT+=("+1 the patch does not modify JPA files")
+ REPORT+=("{color:green}+1{code} the patch does not modify JPA files")
fi
}
###############################################################################
@@ -107,9 +107,9 @@ case $OP in
checkJPAFiles
total=`expr $annotations + $jpaFiles`
if [[ $total == 0 ]] ; then
- echo "+1 ${TASKNAME}" >> $SUMMARYFILE
+ echo "{color:green}+1{code} ${TASKNAME}" >> $SUMMARYFILE
else
- echo "-1 ${TASKNAME}" >> $SUMMARYFILE
+ echo "{color:red}-1{code} ${TASKNAME}" >> $SUMMARYFILE
fi
for line in "${REPORT[@]}" ; do
echo " ${line}" >> $SUMMARYFILE
Modified: oozie/branches/branch-3.3/bin/test-patch-20-tests
URL: http://svn.apache.org/viewvc/oozie/branches/branch-3.3/bin/test-patch-20-tests?rev=1442216&r1=1442215&r2=1442216&view=diff
==============================================================================
--- oozie/branches/branch-3.3/bin/test-patch-20-tests (original)
+++ oozie/branches/branch-3.3/bin/test-patch-20-tests Mon Feb 4 17:57:26 2013
@@ -110,15 +110,15 @@ case $OP in
testsExitCode=`cat ${TEMPDIR}/${TASKNAME}.exitCode`
if [[ "$testsExitCode" != "0" ]] ; then
if [ -n "${failedTests}" ] ; then
- echo "-1 ${TASKNAME} - the patch failed the following testcases:" >> $SUMMARYFILE
+ echo "{color:red}-1{code} ${TASKNAME} - the patch failed the following testcases:" >> $SUMMARYFILE
echo "" >> ${SUMMARYFILE}
echo "${failedTests}" >> $SUMMARYFILE
echo "" >> ${SUMMARYFILE}
else
- echo "-1 ${TASKNAME} - patch does not compile, cannot run testcases" >> $SUMMARYFILE
+ echo "{color:red}-1{code} ${TASKNAME} - patch does not compile, cannot run testcases" >> $SUMMARYFILE
fi
else
- echo "+1 ${TASKNAME}" >> $SUMMARYFILE
+ echo "{color:green}+1{code} ${TASKNAME}" >> $SUMMARYFILE
fi
echo " $testsRun" >> $SUMMARYFILE
echo " $testsFailed" >> $SUMMARYFILE
Modified: oozie/branches/branch-3.3/bin/test-patch-30-distro
URL: http://svn.apache.org/viewvc/oozie/branches/branch-3.3/bin/test-patch-30-distro?rev=1442216&r1=1442215&r2=1442216&view=diff
==============================================================================
--- oozie/branches/branch-3.3/bin/test-patch-30-distro (original)
+++ oozie/branches/branch-3.3/bin/test-patch-30-distro Mon Feb 4 17:57:26 2013
@@ -94,11 +94,11 @@ case $OP in
report)
exitCode=`cat ${TEMPDIR}/${TASKNAME}.exitCode`
if [[ "$exitCode" != "0" ]] ; then
- echo "-1 ${TASKNAME}" >> $SUMMARYFILE
- echo " -1 distro tarball fails with the patch" >> $SUMMARYFILE
+ echo "{color:red}-1{code} ${TASKNAME}" >> $SUMMARYFILE
+ echo " {color:red}-1{code} distro tarball fails with the patch" >> $SUMMARYFILE
else
- echo "+1 ${TASKNAME}" >> $SUMMARYFILE
- echo " +1 distro tarball builds with the patch " >> $SUMMARYFILE
+ echo "{color:green}+1{code} ${TASKNAME}" >> $SUMMARYFILE
+ echo " {color:green}+1{code} distro tarball builds with the patch " >> $SUMMARYFILE
fi
;;
esac
Modified: oozie/branches/branch-3.3/bin/test-patch-XX-template
URL: http://svn.apache.org/viewvc/oozie/branches/branch-3.3/bin/test-patch-XX-template?rev=1442216&r1=1442215&r2=1442216&view=diff
==============================================================================
--- oozie/branches/branch-3.3/bin/test-patch-XX-template (original)
+++ oozie/branches/branch-3.3/bin/test-patch-XX-template Mon Feb 4 17:57:26 2013
@@ -84,7 +84,7 @@ case $OP in
post)
;;
report)
- echo "+1 ${TASKNAME}" >> $SUMMARYFILE
+ echo "{color:green}+1{code} ${TASKNAME}" >> $SUMMARYFILE
;;
esac