Skip to content

Commit

Permalink
Merge branch '2.5.x'
Browse files Browse the repository at this point in the history
Conflicts:
	travis-after-failure.sh
  • Loading branch information
lhotari committed Nov 28, 2014
2 parents 87a22ed + b27e2f2 commit ad8faf7
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 0 deletions.
1 change: 1 addition & 0 deletions travis-after-failure.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
./travis/junit-errors-to-stdout.sh
if [[ $TRAVIS_BRANCH =~ ^master|grails-shell|2\..\.x$ && $TRAVIS_REPO_SLUG == grails/*
&& $TRAVIS_PULL_REQUEST == 'false' ]]; then
echo "Install duplicity with S3 support"
Expand Down
19 changes: 19 additions & 0 deletions travis/junit-errors-to-stdout.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash
IFS='
'
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
sudo apt-get install -y --force-yes xml-twig-tools xsltproc
ROOTDIR="$1"
if [ -z "$ROOTDIR" ]; then
ROOTDIR="."
fi
FILES=$(find "$ROOTDIR" -path '*/build/test-results/*.xml' | xargs --no-run-if-empty xml_grep --files --cond 'testsuite[@failures > 0 or @errors > 0]')
if [ -n "$FILES" ]; then
for file in "$FILES"; do
if [ -f "$file" ]; then
echo '====================================================='
xsltproc "$DIR/junit-xml-format-errors.xsl" "$file"
fi
done
echo '====================================================='
fi
60 changes: 60 additions & 0 deletions travis/junit-xml-format-errors.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:str="http://xsltproc.org/xslt/string" extension-element-prefixes="str">
<xsl:output method="text" indent="no"/>
<xsl:template match="/testsuite">
<xsl:text>Testsuite: </xsl:text><xsl:value-of select="@name" />
<xsl:text>
Tests run: </xsl:text>
<xsl:value-of select="@tests" />
<xsl:text>, Failures: </xsl:text>
<xsl:value-of select="@failures" />
<xsl:text>, Errors: </xsl:text>
<xsl:value-of select="@errors" />
<xsl:text>, Time elapsed: </xsl:text>
<xsl:value-of select="@time" />
<xsl:text> sec</xsl:text>
<xsl:text>
--------- ----------- ---------</xsl:text>
<xsl:apply-templates select="testcase" />
<xsl:apply-templates select="system-out" />
<xsl:apply-templates select="system-err" />
</xsl:template>

<xsl:template match="testcase">
<xsl:text>
Testcase: </xsl:text>
<xsl:value-of select="@name" />
<xsl:text> took </xsl:text>
<xsl:value-of select="@time" />
<xsl:choose>
<xsl:when test="failure"><xsl:text> FAILURE </xsl:text><xsl:apply-templates select="failure"/></xsl:when>
<xsl:when test="error"><xsl:text> ERROR </xsl:text><xsl:apply-templates select="error"/></xsl:when>
<xsl:otherwise><xsl:text> SUCCESS</xsl:text></xsl:otherwise>
</xsl:choose>
</xsl:template>

<xsl:template match="error | failure">
<xsl:value-of select="@message" />
<xsl:if test="@type != @message">
<xsl:text> </xsl:text><xsl:value-of select="@type" />
</xsl:if>
<xsl:text>
</xsl:text>
<xsl:value-of select="." />
</xsl:template>

<xsl:template match="system-out">
<xsl:text>
------ Standard output ------
</xsl:text>
<xsl:value-of select="." />
</xsl:template>

<xsl:template match="system-err">
<xsl:text>
------ Error output ------
</xsl:text>
<xsl:value-of select="." />
</xsl:template>

</xsl:stylesheet>

0 comments on commit ad8faf7

Please sign in to comment.