Likewise, I also do it via a cron'd shell script. I pipe the output from the call to Maven to a log and if the call to Maven exits with a non-zero error-code, i.e. if (( $? != 0 ));, I email the output. I also have it send failed unit test traces by email.

My grep script to locate the names of failed tests is:

---------------
# script for grepping test reports and stripping the output to lines containing failed tests


SRCROOT=$1

for i in `find $SRCROOT -name test-reports -print`;
do grep -l -E -s "FAILED|ERROR" $i/*.txt | sed "s/TEST-//" | sed "s/.txt//" |
sed "s/.*test-reports\///";
done
----------------


Then I check on each line from the above script, build a log and send that:

----------------
find-failed-tests $SRCROOT > /tmp/$BUILDNAME.failedtests
linecount=`wc -l < /tmp/$BUILDNAME.failedtests`
if (( $linecount > 0 ));
then
echo "$BUILDNAME ---Test log---" > /usr/local/ci/$BUILDNAME.testlog.txt
for i in `find $SRCROOT -name test-reports -print`;
do
for j in `grep -l -E -s "FAILED|ERROR" $i/*.txt`;
do
cat $j >> /usr/local/ci/$BUILDNAME.testlog.txt
done
done
cat /tmp/$BUILDNAME.failedtests /usr/local/ci/$BUILDNAME.testlog.txt | mail -s "[Maven] Unit test failures: $BUILDNAME" $NOTIFICATIONEMAIL
fi
-----------------


The variables are all set by command line arguments so that I can use the same scripts across several super-projects and branches.

Gareth.


matthew.hawthorne wrote:
Vincent Massol wrote:

Acutally I work with Dominique. We only need to send emails for now (we
do not need the modificationset Ant task from CC). CC is a good idea but
we'll need to do some research to see how it would work and how to
integrate it with our current continuous build. For now, would you know
of a solution to use the reactor and still be able to send emails on
build errors?

Anyone sending emails while using the reactor?



This is one of the unfortunate things that was so easy to do in Ant but just doesn't have an
equivalent in Maven.


I wrote a shell script that pipes Maven's standard out to a file, then I grep the file for the word
"failed" and send an email with the content of the file if it matches.


Not the most elegant solution... but it works.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-- ------------------- Gareth Cronin Analyst/Programmer Kiwiplan NZ Ltd www.kiwiplan.com Ph 2727622 x854 -------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to