Question

I am having problems getting Jenkins to parse a xunit.xml report file when there are exceptions in the tests. The XML looks well-formed so I can't see any problem just by looking at it. Is there a xsd file somewhere that I can compare my xml against to see what actually causing the file to be unparsable?

About my setup: I set up a nightly job in Jenkins for a PHP project. We are using Cakephp 1.3 therefore we are still using SimpleTest instead of PHPUnit. The only way I could figure out to easily produce the report xml while using simpletest was to use stagehand_testrunner (http://redmine.piece-framework.com/projects/stagehand-testrunner). In my build script I did something like: cakerunner --cakephp-app-path=src/app --log- junit=build/test-results/junit.xml -R src/app/tests

This works great, however jenkins is unable to parse the junit.xml if there were exceptions thrown in the tests.

Was it helpful?

Solution

This was silly of me. I believe that stagehand-test runner already formats the resulting xml in JUnit format. I was trying to convert a JUnit xml report from PHPUnit to JUnit.

In Jenkins I needed to use the option "Publish JUnit test result report" instead of "Publish testing tools result report" The latter is for use with other testing frameworks to convert them to JUnit format. Since I already have a file in JUnit format, I do not need to convert it.

I need to verify this but I believe it to be the case.

I will be glad when we move to CakePHP 2.0 and use PHPUnit.

OTHER TIPS

xUnit Plugin can solve this issue.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top