Skip to content

Commit

Permalink
[Truffle] Calculate spec skip percentage in the XSL.
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvdrum committed Feb 24, 2015
1 parent 36e8a87 commit 66f549a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
21 changes: 15 additions & 6 deletions spec/truffle/junit-frames.xsl
Expand Up @@ -659,13 +659,18 @@
<td><xsl:value-of select="sum($insamepackage/@errors)"/></td>
<td><xsl:value-of select="sum($insamepackage/@failures)"/></td>
<td><xsl:value-of select="sum($insamepackage/@skipped)" /></td>
<td>
<xsl:if test="sum($insamepackage/@skipped) > 0">
<xsl:call-template name="display-percent">
<xsl:with-param name="value" select="sum($insamepackage/@skipped) div sum($insamepackage/@tests)"/>
</xsl:call-template>
</xsl:if>
</td>
<td>
<xsl:call-template name="display-time">
<xsl:with-param name="value" select="sum($insamepackage/@time)"/>
</xsl:call-template>
</td>
<td><xsl:value-of select="$insamepackage/@timestamp"/></td>
<td><xsl:value-of select="$insamepackage/@hostname"/></td>
</tr>
</xsl:for-each>
</table>
Expand Down Expand Up @@ -754,9 +759,8 @@
<th>Errors</th>
<th>Failures</th>
<th>Skipped</th>
<th>Skip %</th>
<th nowrap="nowrap">Time(s)</th>
<th nowrap="nowrap">Time Stamp</th>
<th>Host</th>
</tr>
</xsl:template>

Expand Down Expand Up @@ -817,12 +821,17 @@
</xsl:otherwise>
</xsl:choose>
</td>
<td>
<xsl:if test="@skipped > 0">
<xsl:call-template name="display-percent">
<xsl:with-param name="value" select="@skipped div @tests"/>
</xsl:call-template>
</xsl:if>
</td>
<td><xsl:call-template name="display-time">
<xsl:with-param name="value" select="@time"/>
</xsl:call-template>
</td>
<td><xsl:apply-templates select="@timestamp"/></td>
<td><xsl:apply-templates select="@hostname"/></td>
</tr>
</xsl:template>

Expand Down
9 changes: 0 additions & 9 deletions spec/truffle/truffle_formatter.rb
Expand Up @@ -73,22 +73,13 @@ def unload
failures = @local_tally.counter.failures
tagged = @local_tally.counter.tagged

skipped_stats = if tagged > 0
# TODO (nirvdrum 23-Feb-15) Clean this up when Truffle supports Float#round(int)
skipped_percentage = ((tagged / tests.to_f) * 1000).round / 10.0
"#{skipped_percentage}% Skipped"
else
''
end

@file.puts <<-XML
<testsuite
tests="#{tests}"
errors="#{errors}"
failures="#{failures}"
skipped="#{tagged}"
time="#{current_time - @file_time}"
hostname="#{skipped_stats}"
name="#{@testsuite_name}">
XML

Expand Down

0 comments on commit 66f549a

Please sign in to comment.