Jenkins fails to read Junit xml for publishing Junit Test Results
Posted: Tue Jul 16, 2019 9:01 pm
I am using Jenkins for CI, and as such, I am creating a junit xml file after my test suites executes to post results in Jenkins. I have done this within the test suite, as a property AND I have also tried this in the build passing it as a parameter. The junit xml file generates, however, Jenkins fails to read the xml file from time to time because it states the format has trailing content and can not be published. As a result it changes my builds to FAIL or unstable in Jenkins. My tests can all be passing , but because Ranorex is producing/translating a bad xml file, it is causing issues in Jenkins. Has anyone else run into this issue?
I am running Ranorex 9.1.0 and the latest release of Jenkins.
Here is an example of what the output looks in Jenkins:
14:14:57 Object reference not set to an instance of an object.
14:14:59 Execution finished with result Success
14:14:59 Publishing test results
14:14:59 Publishing C:\Users\Stacey.Strand\AppData\Local\Temp\Ranorex\0e8cea6b197816e15504ce44eadca3cc\Report.rxzlog to http://127.0.0.1:8081/api/files/C:/ProgramData/Ranorex Agent/Uploads/files/
14:14:59 Publishing C:\Users\Stacey.Strand\AppData\Local\Temp\Ranorex\0e8cea6b197816e15504ce44eadca3cc\Report.rxlog.junit.xml to http://127.0.0.1:8081/api/files/C:/ProgramData/Ranorex Agent/Uploads/files/
14:14:59 Test results published
14:14:59 --------------------------------------------------------------------------------
14:14:59 | D O W N L O A D R E S U L T S |
14:14:59 --------------------------------------------------------------------------------
14:14:59 Download Report.rxzlog
14:15:00 10%
14:15:00 20%
....
14:15:00 70%
14:15:00 80%
14:15:00 90%
14:15:00 100%
14:15:00 Download Report.rxlog.junit.xml
14:15:00 11%
....
14:15:00 100%
14:15:00 --------------------------------------------------------------------------------
14:15:00 | D O N E |
14:15:00 --------------------------------------------------------------------------------
14:15:00 Job completed: Success
14:15:00 Test execution succeeded
14:15:00 Report: C:\Jenkins\workspace\NGPWand\M103_TestSuite\Report.rxzlog
14:15:00 Report: C:\Jenkins\workspace\NGPWand\M103_TestSuite\Report.rxlog.junit.xml
14:15:00
14:15:00 C:\Jenkins\workspace\NGPWand\M103_TestSuite>exit 0
14:15:00 Archiving artifacts
14:15:02 Recording test results
14:15:02 Build step 'Publish JUnit test result report' changed build result to UNSTABLE
14:15:02 Gitcolony notification failed - java.lang.IllegalArgumentException: Invalid url:
14:15:02 [BFA] Scanning build for known causes...
14:15:02 [BFA] No failure causes found
14:15:02 [BFA] Done. 0s
14:15:02 Disk usage plugin fails during calculation disk usage of this build.
14:15:03 No emails were triggered.
14:15:03 Finished: UNSTABLE
When looking at the xml it has the following information in Jenkins
Stacktrace
Failed to read test report file C:\Jenkins\workspace\NGPWand\M103_TestSuite\Report.rxlog.junit.xml
org.dom4j.DocumentException: Error on line 35207 of document : Content is not allowed in trailing section. Nested exception: Content is not allowed in trailing section.
I am running Ranorex 9.1.0 and the latest release of Jenkins.
Here is an example of what the output looks in Jenkins:
14:14:57 Object reference not set to an instance of an object.
14:14:59 Execution finished with result Success
14:14:59 Publishing test results
14:14:59 Publishing C:\Users\Stacey.Strand\AppData\Local\Temp\Ranorex\0e8cea6b197816e15504ce44eadca3cc\Report.rxzlog to http://127.0.0.1:8081/api/files/C:/ProgramData/Ranorex Agent/Uploads/files/
14:14:59 Publishing C:\Users\Stacey.Strand\AppData\Local\Temp\Ranorex\0e8cea6b197816e15504ce44eadca3cc\Report.rxlog.junit.xml to http://127.0.0.1:8081/api/files/C:/ProgramData/Ranorex Agent/Uploads/files/
14:14:59 Test results published
14:14:59 --------------------------------------------------------------------------------
14:14:59 | D O W N L O A D R E S U L T S |
14:14:59 --------------------------------------------------------------------------------
14:14:59 Download Report.rxzlog
14:15:00 10%
14:15:00 20%
....
14:15:00 70%
14:15:00 80%
14:15:00 90%
14:15:00 100%
14:15:00 Download Report.rxlog.junit.xml
14:15:00 11%
....
14:15:00 100%
14:15:00 --------------------------------------------------------------------------------
14:15:00 | D O N E |
14:15:00 --------------------------------------------------------------------------------
14:15:00 Job completed: Success
14:15:00 Test execution succeeded
14:15:00 Report: C:\Jenkins\workspace\NGPWand\M103_TestSuite\Report.rxzlog
14:15:00 Report: C:\Jenkins\workspace\NGPWand\M103_TestSuite\Report.rxlog.junit.xml
14:15:00
14:15:00 C:\Jenkins\workspace\NGPWand\M103_TestSuite>exit 0
14:15:00 Archiving artifacts
14:15:02 Recording test results
14:15:02 Build step 'Publish JUnit test result report' changed build result to UNSTABLE
14:15:02 Gitcolony notification failed - java.lang.IllegalArgumentException: Invalid url:
14:15:02 [BFA] Scanning build for known causes...
14:15:02 [BFA] No failure causes found
14:15:02 [BFA] Done. 0s
14:15:02 Disk usage plugin fails during calculation disk usage of this build.
14:15:03 No emails were triggered.
14:15:03 Finished: UNSTABLE
When looking at the xml it has the following information in Jenkins
Stacktrace
Failed to read test report file C:\Jenkins\workspace\NGPWand\M103_TestSuite\Report.rxlog.junit.xml
org.dom4j.DocumentException: Error on line 35207 of document : Content is not allowed in trailing section. Nested exception: Content is not allowed in trailing section.