Skip to content

Commit

Permalink
[JENKINS-29316] mark inconclusive tests as 'skipped'
Browse files Browse the repository at this point in the history
  • Loading branch information
nilleb committed Jul 29, 2015
1 parent 7ad3d29 commit 11249bc
Show file tree
Hide file tree
Showing 4 changed files with 5,403 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/resources/hudson/plugins/mstest/mstest-to-junit.xsl
Expand Up @@ -8,8 +8,8 @@
<xsl:variable name="numberOfTests" select="sum(/a:TestRun/a:ResultSummary/a:Counters/@total | /b:TestRun/b:ResultSummary/b:Counters/@total)"/>
<xsl:variable name="numberOfFailures" select="sum(/a:TestRun/a:ResultSummary/a:Counters/@failed | /b:TestRun/b:ResultSummary/b:Counters/@failed)" />
<xsl:variable name="numberOfErrors" select="sum(/a:TestRun/a:ResultSummary/a:Counters/@error | /b:TestRun/b:ResultSummary/b:Counters/@error | /a:TestRun/a:ResultSummary/a:Counters/@timeout | /b:TestRun/b:ResultSummary/b:Counters/@timeout)" />
<xsl:variable name="skipped2006" select="/a:TestRun/a:ResultSummary/a:Counters/@total - /a:TestRun/a:ResultSummary/a:Counters/@executed"/>
<xsl:variable name="skipped2010" select="/b:TestRun/b:ResultSummary/b:Counters/@total - /b:TestRun/b:ResultSummary/b:Counters/@executed"/>
<xsl:variable name="skipped2006" select="/a:TestRun/a:ResultSummary/a:Counters/@inconclusive + /a:TestRun/a:ResultSummary/a:Counters/@total - /a:TestRun/a:ResultSummary/a:Counters/@executed"/>
<xsl:variable name="skipped2010" select="/b:TestRun/b:ResultSummary/b:Counters/@inconclusive + /b:TestRun/b:ResultSummary/b:Counters/@total - /b:TestRun/b:ResultSummary/b:Counters/@executed"/>
<xsl:variable name="numberSkipped">
<xsl:choose>
<xsl:when test="$skipped2006 > 0"><xsl:value-of select="$skipped2006"/></xsl:when>
Expand Down Expand Up @@ -113,7 +113,7 @@
<xsl:variable name="tag">
<xsl:choose>
<xsl:when test="$outcome = 'Failed'">failure</xsl:when>
<xsl:when test="$outcome = 'NotExecuted'">skipped</xsl:when>
<xsl:when test="$outcome = 'NotExecuted' or $outcome = 'Inconclusive'">skipped</xsl:when>
<xsl:otherwise>error</xsl:otherwise>
</xsl:choose>
</xsl:variable>
Expand Down
11 changes: 11 additions & 0 deletions src/test/java/hudson/plugins/mstest/MSTestReportConverterTest.java
Expand Up @@ -195,6 +195,17 @@ public void testDataDriven2013() throws Exception {
assertTrue("XSL transformation did not work" + myDiff, myDiff.similar());
}

@Test
public void testInconclusive() throws Exception {

Transform myTransform = new Transform(
new InputSource(this.getClass().getResourceAsStream("DATAFEED.Tests.trx")),
new InputSource(this.getClass().getResourceAsStream(MSTestReportConverter.MSTEST_TO_JUNIT_XSLFILE_STR)));

Diff myDiff = new Diff(readXmlAsString("DATAFEED.Tests.xml"), myTransform);
assertTrue("XSL transformation did not work" + myDiff, myDiff.similar());
}

private String readXmlAsString(String resourceName) throws IOException {
String xmlString = "";

Expand Down

0 comments on commit 11249bc

Please sign in to comment.