I'm trying to use the JUnit parser with bamboo and my casperjs tests.
<?xml version="1.0" encoding="UTF-8"?>
<testsuites duration="8.321">
<testsuite name="Untitled suite in demo.js" tests="1" failures="0" errors="0" time="6.469" timestamp="2013-05-28T11:47:57.440Z" package="demo/demo">
<testcase name="Subject equals the expected value" classname="demo/demo" time="6.469"></testcase>
<system-out></system-out>
</testsuite>
<testsuite name="Untitled suite in demofunctional.js" tests="5" failures="0" errors="0" time="1.852" timestamp="2013-05-28T11:47:57.441Z" package="demo/demofunctional">
<testcase name="google homepage title is the one expected" classname="demo/demofunctional" time="0.499"></testcase>
<testcase name="main form is found" classname="demo/demofunctional" time="0.001"></testcase>
<testcase name="google title is ok" classname="demo/demofunctional" time="1.35"></testcase>
<testcase name="search term has been submitted" classname="demo/demofunctional" time="0.001">
</testcase><testcase name="google search for "foo" retrieves 10 or more results" classname="demo/demofunctional" time="0.001"></testcase>
<system-out>done() `planned` arg is deprecated as of 1.1</system-out>
</testsuite>
</testsuites>
command 28-May-2013 13:59:47 Substituting variable: ${bamboo.build.working.directory} with /mnt/bamboo-ebs/bamboo-agent/build-dir/XXXXXXXXX
simple 28-May-2013 13:59:47 Starting task 'JUnit Parser' of type 'com.atlassian.bamboo.plugins.testresultparser:task.testresultparser.junit'
simple 28-May-2013 13:59:47 Parsing test results...
simple 28-May-2013 13:59:47 Failing task since test cases were expected but none were found.
simple 28-May-2013 13:59:47 Finished task 'JUnit Parser'
When validating the XML output using
http://www.freeformatter.com/xml-validator-xsd.html and this XSD
http://windyroad.com.au/dl/Open%20Source/JUnit.xsd, here are the errors I got :
- Cvc-complex-type.3.2.2: Attribute 'duration' Is Not Allowed To Appear In Element 'testsuites'.. Line '2', Column '30'.
- Cvc-pattern-valid: Value '2013-05-28T11:47:57.440Z' Is Not Facet-valid With Respect To Pattern '[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}' For Type 'ISO8601_DATETIME_PATTERN'.. Line '3', Column '188'.
- Cvc-attribute.3: The Value '2013-05-28T11:47:57.440Z' Of Attribute 'timestamp' On Element 'testsuite' Is Not Valid With Respect To Its Type, 'ISO8601_DATETIME_PATTERN'.. Line '3', Column '188'.
- Cvc-complex-type.4: Attribute 'id' Must Appear On Element 'testsuite'.. Line '3', Column '188'.
- Cvc-complex-type.4: Attribute 'hostname' Must Appear On Element 'testsuite'.. Line '3', Column '188'.
- Cvc-complex-type.2.4.a: Invalid Content Was Found Starting With Element 'testcase'. One Of '{properties}' Is Expected.. Line '4', Column '89'.
- Cvc-pattern-valid: Value '2013-05-28T11:47:57.441Z' Is Not Facet-valid With Respect To Pattern '[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}' For Type 'ISO8601_DATETIME_PATTERN'.. Line '7', Column '208'.
- Cvc-attribute.3: The Value '2013-05-28T11:47:57.441Z' Of Attribute 'timestamp' On Element 'testsuite' Is Not Valid With Respect To Its Type, 'ISO8601_DATETIME_PATTERN'.. Line '7', Column '208'.
- Cvc-complex-type.4: Attribute 'id' Must Appear On Element 'testsuite'.. Line '7', Column '208'.
- Cvc-complex-type.4: Attribute 'hostname' Must Appear On Element 'testsuite'.. Line '7', Column '208'.
- Cvc-complex-type.2.4.a: Invalid Content Was Found Starting With Element 'testcase'. One Of '{properties}' Is Expected.. Line '8', Column '107'.
My thoughts are that the wrong format is making bamboo refusing to parse the file.
Has anyone got this error ? Or am I wrongly configuring the task ?
Cheers,
Erwan