Skip to content

Commit

Permalink
[JENKINS-42715] xUnit does not support PHPUnit 5.x skipped attribute
Browse files Browse the repository at this point in the history
Support skipped attribute during PHPUnit validation. The attribute is
supported since PHPUnit version 5.4/6.5 with the PR

* sebastianbergmann/phpunit#2144
  • Loading branch information
rrehbein authored and nfalco79 committed May 7, 2018
1 parent 845615f commit a1eb808
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 0 deletions.
Expand Up @@ -38,6 +38,12 @@ THE SOFTWARE.
</xs:complexType>
</xs:element>

<xs:element name="skipped">
<xs:complexType mixed="true">
<xs:attribute name="message" type="xs:string" use="optional"/>
</xs:complexType>
</xs:element>

<xs:element name="properties">
<xs:complexType>
<xs:sequence>
Expand Down Expand Up @@ -68,6 +74,7 @@ THE SOFTWARE.
<xs:element ref="failure" minOccurs="0" maxOccurs="1"/>
<xs:element ref="system-err" minOccurs="0" maxOccurs="1"/>
<xs:element ref="system-out" minOccurs="0" maxOccurs="1"/>
<xs:element ref="skipped" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
<xs:attribute name="classname" type="xs:string" use="optional"/>
<xs:attribute name="name" type="xs:string" use="required"/>
Expand Down
10 changes: 10 additions & 0 deletions src/test/java/org/jenkinsci/plugins/xunit/types/PHPUnitTest.java
Expand Up @@ -61,4 +61,14 @@ public void testcase6() throws Exception {
public void testcase7() throws Exception {
convertAndValidate(PHPUnit.class, "phpunit/testcase7/testresult.xml", "phpunit/testcase7/junit-result.xml");
}

@Test
public void testcase8() throws Exception {
convertAndValidate(PHPUnit.class, "phpunit/testcase8/testresult.xml", "phpunit/testcase8/junit-result.xml");
}

@Test
public void testcase9() throws Exception {
convertAndValidate(PHPUnit.class, "phpunit/testcase9/testresult.xml", "phpunit/testcase9/junit-result.xml");
}
}
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
<testsuite name="SampleTest" tests="2" failures="0" errors="0" skipped="2"
time="0.001106"
timestamp="">
<testcase classname="SampleTest" name="testSkippingTest" time="0.000948"
assertions="0"/>
<testcase classname="SampleTest" name="testSkippingTestWithReason" time="0.000158"
assertions="0"/>
</testsuite>
</testsuites>
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
<testsuite name="SampleTest" file="/tmp/sample/test.php" tests="2" assertions="0" errors="0" failures="0" skipped="2" time="0.001106">
<testcase name="testSkippingTest" class="SampleTest" file="/tmp/sample/test.php" line="7" assertions="0" time="0.000948">
<skipped/>
</testcase>
<testcase name="testSkippingTestWithReason" class="SampleTest" file="/tmp/sample/test.php" line="12" assertions="0" time="0.000158">
<skipped/>
</testcase>
</testsuite>
</testsuites>
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
<testsuite name="SampleTest" tests="2" failures="0" errors="0" skipped="2"
time="0.001725"
timestamp="">
<testcase classname="SampleTest" name="testSkippingTest" time="0.001648"
assertions="0"/>
<testcase classname="SampleTest" name="testSkippingTestWithReason" time="0.000077"
assertions="0"/>
</testsuite>
</testsuites>
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
<testsuite name="SampleTest" file="/tmp/sample/test.php" tests="2" assertions="0" errors="0" failures="0" skipped="2" time="0.001725">
<testcase name="testSkippingTest" class="SampleTest" classname="SampleTest" file="/tmp/sample/test.php" line="7" assertions="0" time="0.001648">
<skipped/>
</testcase>
<testcase name="testSkippingTestWithReason" class="SampleTest" classname="SampleTest" file="/tmp/sample/test.php" line="12" assertions="0" time="0.000077">
<skipped/>
</testcase>
</testsuite>
</testsuites>

0 comments on commit a1eb808

Please sign in to comment.