Hi,
my JUnit passrates are no longer showing when using dashboard version
1.9. I traced the problem down to the JUnit aggregator. It contains
these linen:
<j:choose>
<x:set var="nbTests" select="sum($doc/testsuites/testsuite/@tests)"/>
<a:echo>nr of tests: ${nbTests}</a:echo>
<j:when test="${nbTests != 0}">
<x:parse var="doc" xml="${artifactAsFile}"/>
<x:expr select="floor(100 - 100 *
(sum($doc/testsuites/testsuite/@failures) +
sum($doc/testsuites/testsuite/@errors)) div
sum($doc/testsuites/testsuite/@tests))"/>
%
</j:when>
<j:otherwise>
<j:expr value="-"/>
</j:otherwise>
</j:choose>
The problem is that the xml file is being parsed after the nr of unit
tests has been calculated (using the $doc variable, but it is not
initialized yet). The solution: move the parsing of the xml file
higher, like this:
<x:parse var="doc" xml="${artifactAsFile}"/>
<j:choose>
<x:set var="nbTests" select="sum($doc/testsuites/testsuite/@tests)"/>
<a:echo>nr of tests: ${nbTests}</a:echo>
<j:when test="${nbTests != 0}">
<x:expr select="floor(100 - 100 *
(sum($doc/testsuites/testsuite/@failures) +
sum($doc/testsuites/testsuite/@errors)) div
sum($doc/testsuites/testsuite/@tests))"/>
%
</j:when>
<j:otherwise>
<j:expr value="-"/>
</j:otherwise>
</j:choose>
regards,
Wim
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]