Im trying to integrate my PHPUnit tests into Hudson using the xUnit plugin. After a successfull build with Ant in hudson, the console output shows:
Recording test results
None of the test reports contained any result
My junit.xml test output using phpunit –log-junit looks as follows:
<testsuites>
<testsuite name="Unit Tests" tests="1" assertions="1" failures="0" errors="0" time="0.005112">
<testsuite name="DbTest" file="src/tests/unit/DbTest.php" tests="1" assertions="1" failures="0" errors="0" time="0.005112">
<testcase name="testConnection" class="DbTest" file="src/tests/unit/DbTest.php" line="4" assertions="1" time="0.005112"/>
</testsuite>
</testsuite>
</testsuites>
Any help is appreciated
EDIT:
I just created a test junit.xml containing:
<testsuites>
<testsuite name="DbTest" file="src/tests/unit/DbTest.php" tests="1" assertions="1" failures="0" errors="0" time="0.005112">
<testcase name="testConnection" class="DbTest" file="src/tests/unit/DbTest.php" line="4" assertions="1" time="0.005112"/>
</testsuite>
</testsuites>
With this in place, a build was successful. The problem seems to be the nested -tags. Any idea how to prevent PHPUnit to create these nested tags?
I finally found a solution at How might I integrate phpunit with Hudson CI? using th xslt workaround.
If anyone has the same problem: Create a new .xsl file anywhere below your project root:
Then add to your build.xml (don’t forget to include in the build target):
Anyway, this is somehow cumbersome. Therefore I already created a improvement suggestion to the xUnit project.