Bamboo: Failed to parse test result file

903 views
Skip to first unread message

stephanos

unread,
Mar 10, 2013, 11:37:33 AM3/10/13
to specs2...@googlegroups.com
I just tried out the CI Bamboo, problem is that some of my specs2 test results (exported to JUnit XML) are not parsed:

2013-03-10 15:16:17,650 ERROR [pool-7-thread-8] [TestCollationServiceImpl] Failed to parse test result file "LogItemDocSpec.xml"
java.lang.NullPointerException
at com.atlassian.bamboo.build.test.JunitTestResultsParser$TestCaseElementParser.startElement(JunitTestResultsParser.java:200)
at com.atlassian.bamboo.configuration.DefaultContentHandler.startElement(DefaultContentHandler.java:59)
at com.atlassian.bamboo.build.test.JunitTestResultsParser.startElement(JunitTestResultsParser.java:74)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)

So I'm not sure who is at fault here; Bamboo, Specs2 or me.

Here is one of the files it couldn't parse:

      <testsuite hostname="mac" name="com.myproject.model.LogItemDocSpec" tests="4" errors="0" failures="0" skipped="0" time="0.000">
      <properties>
          ...
      </properties>
 
      <testcase classname="DBObject" time="0.000">
        
      </testcase><testcase name="Log Item Doc should::read from::JSON" classname="com.myproject.model.LogItemDocSpec" time="0.135">
        
      </testcase><testcase name="Log Item Doc should::read from::DBObject" classname="com.myproject.model.LogItemDocSpec" time="0.135">
        
      </testcase><testcase name="Log Item Doc should::write to::JSON" classname="com.myproject.model.LogItemDocSpec" time="0.135">
 
      </testcase>
      <system-out></system-out>
      <system-err></system-err>
      </testsuite>

And here is one that it could parse:

<testsuite hostname="mac" name="com.myproject.model.APIKeySpec" tests="4" errors="0" failures="0" skipped="0" time="0.000">
      <properties>
       ...
      </properties>
      <testcase name="APIKey should::convert to string and back" classname="com.myproject.model.APIKeySpec" time="0.004">
        
      </testcase><testcase name="APIKey should::parse from string" classname="com.myproject.model.APIKeySpec" time="0.005">
        
      </testcase><testcase name="APIKey should::throw exception for invalid key" classname="com.myproject.model.APIKeySpec" time="0.017">
        
      </testcase><testcase name="APIKey should::convert to byte[] and back" classname="com.myproject.model.APIKeySpec" time="0.004">
        
      </testcase>
      <system-out></system-out>
      <system-err></system-err> 
</testsuite>

etorreborre

unread,
Mar 10, 2013, 6:52:04 PM3/10/13
to specs2...@googlegroups.com
So my understanding is that there is a "testcase" element that is missing a "name" attribute. 

However there's only one place in the specs2 code where this attribute is produced and it's not conditional to anything, so I don't see how it cannot be emitted. 

Is it possible for you to shrink your project to something I can reproduce?

Thanks,

Eric.

stephanos

unread,
Mar 11, 2013, 3:51:07 AM3/11/13
to specs2...@googlegroups.com
Here you go: https://github.com/stephanos/specs2-junitxml

It definitely has to do with test cases without actual tests, that are just empty.

etorreborre

unread,
Mar 11, 2013, 7:42:07 AM3/11/13
to specs2...@googlegroups.com
Thanks for the project, the fix in specs2_2.10-1.14.1-SNAPSHOT.jar should fix your Bamboo issue now.

E.

etorreborre

unread,
Mar 11, 2013, 7:42:44 AM3/11/13
to specs2...@googlegroups.com
PS: today I learned that when an xml attribute is null in Scala, the attribute is not emitted.

stephanos

unread,
Mar 11, 2013, 7:44:04 AM3/11/13
to specs2...@googlegroups.com
Awesome, thanks!

Your support is world-class! (faster than Atlassian's :)
Reply all
Reply to author
Forward
0 new messages