Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-68228

Upload test result to ALM failed to parse file with Java 11

      Hello,
      the ALM Plugin should support Java 8 and above, but after I switch to Java 11 the JUnit result file can not parsed by the plugin.

      15:33:37 [Checks API] No suitable checks publisher found.
      15:33:37 INFO: 'Upload test result to ALM' Post Build Step is being invoked by q-was-alm.
      15:33:37 INFO: 1 test result file found.
      15:33:37 INFO: Start to upload /usd/as97385a/work/jenkins/jobs/Introscope/jobs/agent_java-alm/builds/5/results_junit.xml
      15:33:37 INFO: Start to parse file: /usd/as97385a/work/jenkins/jobs/Introscope/jobs/agent_java-alm/builds/5/results_junit.xml
      15:33:37 Failed to parse file with: com.microfocus.application.automation.tools.results.parser.jenkinsjunit.JenkinsJUnitReportParserImpl
      15:33:37 Failed to parse file with: com.microfocus.application.automation.tools.results.parser.mavensurefire.MavenSureFireReportParserImpl
      15:33:37 Failed to parse file with: com.microfocus.application.automation.tools.results.parser.testngxml.TestNGXmlReportParserImpl
      15:33:38 Failed to parse file with: com.microfocus.application.automation.tools.results.parser.nunit3.NUnit3ReportParserImpl
      15:33:38 Failed to parse file with: com.microfocus.application.automation.tools.results.parser.nunit.NUnitReportParserImpl
      15:33:38 Failed to parse file with: com.microfocus.application.automation.tools.results.parser.antjunit.AntJUnitReportParserImpl
      15:33:38 ERR: There's exception while uploading /usd/as97385a/work/jenkins/jobs/Introscope/jobs/agent_java-alm/builds/5/results_junit.xml. Failed to parse file: /usd/as97385a/work/jenkins/jobs/Introscope/jobs/agent_java-alm/builds/5/results_junit.xml
      15:33:38 INFO: 'Upload test result to ALM' Completed.
      15:33:38 Build step 'Upload test result to ALM' changed build result to UNSTABLE
      15:33:38 [lockable-resources] released lock on [INTROSCOPE_ALM, INTROSCOPE_JAVA]
      15:33:38 Finished: UNSTABLE
      

      Based on Java 8 the JUnit result file was read by the Antjunit report parser.

      Any idea what is going wrong.

      I do all tests based on Jenkins 2.319.2, 2.319.3 and 2.332.2
      and Micro Focus Application Automation Tools 7.2 and 7.3

      The import works well in a java version "1.8.0_321" environment but
      does not with java version "11.0.14" 2022-01-18 LTS

      With regards,
      Lutz

          [JENKINS-68228] Upload test result to ALM failed to parse file with Java 11

          Lutz Mader created issue -

          Hilda added a comment -

          Hello,

          Currently our plugin is working as expected with Java 8.

          We are planning to upgrade to Java 11 and optimize it in our next release, version 7.4, which will be in the end of June.

          We will handle this issue as well.

          Thank you,

          Hilda 

          Hilda added a comment - Hello, Currently our plugin is working as expected with Java 8. We are planning to upgrade to Java 11 and optimize it in our next release, version 7.4, which will be in the end of June. We will handle this issue as well. Thank you, Hilda 

          Lutz Mader added a comment - - edited

          Hello Hilda,
          you are right, the plugin is working as expected with Java 8, unfortunately Jenkins will move to Java 11.

          Nice to know someone have a look to the problem, thanks for all information. I will switch to version 7.4 in June.

          With regards,
          Lutz

          Lutz Mader added a comment - - edited Hello Hilda, you are right, the plugin is working as expected with Java 8, unfortunately Jenkins will move to Java 11. Nice to know someone have a look to the problem, thanks for all information. I will switch to version 7.4 in June. With regards, Lutz
          Basil Crow made changes -
          Epic Link New: JENKINS-68446 [ 215257 ]

          Basil Crow added a comment -

          Adding the JAXB plugin as a plugin-to-plugin dependency as in jenkinsci/hpe-application-automation-tools-plugin#493 should be a good place to start. Once that is done, the calls to javax.xml.bind.JAXBContext.newInstance in com.hp.alm.ali.hudson.JAXBApi.marshall (is the source code to this class on GitHub?) need to be wrapped in the correct context class loader as in jenkinsci/xcode-plugin#113.

          Basil Crow added a comment - Adding the JAXB plugin as a plugin-to-plugin dependency as in jenkinsci/hpe-application-automation-tools-plugin#493 should be a good place to start. Once that is done, the calls to javax.xml.bind.JAXBContext.newInstance in com.hp.alm.ali.hudson.JAXBApi.marshall (is the source code to this class on GitHub?) need to be wrapped in the correct context class loader as in jenkinsci/xcode-plugin#113 .

          Dorin Bogdan added a comment -

          Hi basil ,

          We reproduced the issue using a recent build.
          For the fix I followed your suggestion from jenkinsci/xcode-plugin#113 and applied it on several classes.
          If you have any observation, please let me know.
          For example, do you suspect any negative effect on the static methods affected in this PR?

          Thank you.

          Dorin Bogdan added a comment - Hi basil , We reproduced the issue using a recent build. For the fix I followed your suggestion from  jenkinsci/xcode-plugin#113  and applied it on several classes. If you have any observation, please let me know. For example, do you suspect any negative effect on the static methods affected in this PR ? Thank you.

          Basil Crow added a comment -

          Great! BTW this document explains the gory details about why this is necessary in the Jenkins plugin class loading system. In the future I hope to provide a utility class in Jenkins core that will make it easier to set the context class loader, but for the time being this is the recommended practice. Thanks!

          Basil Crow added a comment - Great! BTW this document explains the gory details about why this is necessary in the Jenkins plugin class loading system. In the future I hope to provide a utility class in Jenkins core that will make it easier to set the context class loader, but for the time being this is the recommended practice. Thanks!

          Hilda added a comment -

          Hello,

          The new version for "Micro Focus Application Automation Tools" version 7.4 is available with the fix for the parsing issue.

          Thank you,

          Hilda Both

          Hilda added a comment - Hello, The new version for "Micro Focus Application Automation Tools" version 7.4 is available with the fix for the parsing issue. Thank you, Hilda Both
          Hilda made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Closed [ 6 ]

          Lutz Mader added a comment - - edited

          Hello,
          I am on Jenkins 2.346.1 with Java 11.0.15.1 2022-04-22 LTS

          After I update the "Micro Focus Application Automation Tools" from 7.3 to 7.4.
          In "Pipeline", "Definition Pipeline script" the "Script" will not shown (the field is empty),
          but the script is still available in the "config.xml" file of the job. I can start the jobs.
          After I go back to 7.3 the "Script" will shown again!

          I will try to find some useful error messages, but I have not found anything, sorry.

          A warning only,
          Lutz

          Lutz Mader added a comment - - edited Hello, I am on Jenkins 2.346.1 with Java 11.0.15.1 2022-04-22 LTS After I update the "Micro Focus Application Automation Tools" from 7.3 to 7.4. In "Pipeline", "Definition Pipeline script" the "Script" will not shown (the field is empty), but the script is still available in the "config.xml" file of the job. I can start the jobs. After I go back to 7.3 the "Script" will shown again! I will try to find some useful error messages, but I have not found anything, sorry. A warning only, Lutz

            hildaboth Hilda
            lutzmad Lutz Mader
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: