You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Michael Osipov (Jira)" <ji...@apache.org> on 2024/06/04 21:46:00 UTC

[jira] [Comment Edited] (SUREFIRE-2084) Jenkins junit plugin fails to parse surefire reports of failed tests

    [ https://issues.apache.org/jira/browse/SUREFIRE-2084?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17533240#comment-17533240 ] 

Michael Osipov edited comment on SUREFIRE-2084 at 6/4/24 9:45 PM:
------------------------------------------------------------------

I think I have found a similar issue - SUREFIRE-1556 - and it seems to have been fixed in M6 release by [https://github.com/apache/maven-surefire/pull/450], I will try the new release and will monitor.


was (Author: JIRAUSER289138):
I think I have found a similar issue - https://issues.apache.org/jira/browse/SUREFIRE-1556 - and it seems to have been fixed in M6 release by [https://github.com/apache/maven-surefire/pull/450], I will try the new release and will monitor.

> Jenkins junit plugin fails to parse surefire reports of failed tests
> --------------------------------------------------------------------
>
>                 Key: SUREFIRE-2084
>                 URL: https://issues.apache.org/jira/browse/SUREFIRE-2084
>             Project: Maven Surefire
>          Issue Type: Bug
>    Affects Versions: 3.0.0-M4
>            Reporter: Praveen Sreepada
>            Priority: Major
>
> We use junit plugin in jenkins to export the results of the test runs. While doing so for the failed tests, I see the plugin throwing the following exception:
> {code:java}
> Failed to read test report file <redacted>.xml
> org.dom4j.DocumentException: Error on line 144 of document  : The content of elements must consist of well-formed character data or markup.
> 	at org.dom4j.io.SAXReader.read(SAXReader.java:511)
> 	at org.dom4j.io.SAXReader.read(SAXReader.java:392)
> 	at hudson.tasks.junit.SuiteResult.parse(SuiteResult.java:177)
> 	at hudson.tasks.junit.TestResult.parse(TestResult.java:349)
> 	at hudson.tasks.junit.TestResult.parsePossiblyEmpty(TestResult.java:279)
> 	at hudson.tasks.junit.TestResult.parse(TestResult.java:223)
> 	at hudson.tasks.junit.TestResult.parse(TestResult.java:197)
> 	at hudson.tasks.junit.TestResult.<init>(TestResult.java:151)
> 	at hudson.tasks.junit.JUnitParser$ParseResultCallable.invoke(JUnitParser.java:147)
> 	at hudson.FilePath$FileCallableWrapper.call(FilePath.java:3329)
> 	at hudson.remoting.UserRequest.perform(UserRequest.java:211)
> 	at hudson.remoting.UserRequest.perform(UserRequest.java:54)
> 	at hudson.remoting.Request$2.run(Request.java:376)
> 	at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:78)
> 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
> 	at java.lang.Thread.run(Thread.java:748)
> Caused by: org.xml.sax.SAXParseException; lineNumber: 144; columnNumber: 6; The content of elements must consist of well-formed character data or markup.
> 	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)
> 	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177)
> 	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:400)
> 	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327)
> 	at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1473)
> 	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.startOfMarkup(XMLDocumentFragmentScannerImpl.java:2635)
> 	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2732)
> 	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602)
> 	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:112)
> 	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505)
> 	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:842)
> 	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:771)
> 	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
> 	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
> 	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643)
> 	at org.dom4j.io.SAXReader.read(SAXReader.java:494)
> 	... 17 more{code}
> Upon opening the generated xml file, this is what I found - This is the point (line 144) where it is failing to parse the XML, due to an extra space between `<` and `message=`
> {code:java}
>     <rerunError type="java.lang.NullPointerException">
>       <stackTrace><![CDATA[java.lang.NullPointerException
> ]]></stackTrace>
>     </rerunError>
>     < message="Tests enabled on ONS3(stage and Prod) stack only ">{code}
> This message has been added due to a `Assume.assumeTrue` statement in the test
> We use maven-surefire-plugin version 3.0.0-M4
> Is this a known issue that has been fixed in later releases? if not, can this be fixed? Please let me know if you need any more information
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)