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

java.lang.NullPointerException when publish JUnit.xml result to Zephyr for Jira

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • Ubuntu 14.04.05 x64
      Jenkins 2.32.3
      zephyr-for-jira-test-management 1.4

      I have a Robot Framework test result file "output.xml",
      and I convert this test result file into JUnit format by command below in Build step:

      rebot -x junit.xml -l NONE -r NONE output.xml 
      

      Under Post-Build, I have 2 post-build actions (refer to file Selection_003.png):
      1. Publish Junit test result report
      2. Publish test result to Zephyr for JIRA

      And I'll get:

      + rebot -x junit1.xml -l NONE -r NONE output1.xml
      XUnit:   /var/lib/Jenkins_Backup/jenkins/jobs/Publish_Test_Result_JIRA/workspace/junit1.xml
      Recording test results
      [ZapiTestResultReporter] [INFO] Examining test results...
      Build result is SUCCESS
      Total Test Cases : 8ERROR: Build step failed with exception
      java.lang.NullPointerException
      	at com.thed.zephyr.jenkins.utils.rest.TestCaseUtil.executeTests(TestCaseUtil.java:424)
      	at com.thed.zephyr.jenkins.utils.rest.TestCaseUtil.processTestCaseDetails(TestCaseUtil.java:564)
      	at com.thed.zephyr.jenkins.reporter.ZfjReporter.perform(ZfjReporter.java:99)
      	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:720)
      	at hudson.model.Build$BuildExecution.post2(Build.java:185)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:665)
      	at hudson.model.Run.execute(Run.java:1753)
      	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      	at hudson.model.ResourceController.execute(ResourceController.java:98)
      	at hudson.model.Executor.run(Executor.java:404)
      Build step 'Publish test result to Zephyr for JIRA' marked build as failure
      
      + rebot -x junit2.xml -l NONE -r NONE output2.xml
      XUnit:   /var/lib/Jenkins_Backup/jenkins/jobs/Publish_Test_Result_JIRA/workspace/junit2.xml
      Build step 'Execute shell' marked build as failure
      Recording test results
      [ZapiTestResultReporter] [INFO] Examining test results...
      Build result is FAILURE
      Total Test Cases : 8ERROR: Build step failed with exception
      java.lang.NullPointerException
      	at com.thed.zephyr.jenkins.utils.rest.TestCaseUtil.executeTests(TestCaseUtil.java:404)
      	at com.thed.zephyr.jenkins.utils.rest.TestCaseUtil.processTestCaseDetails(TestCaseUtil.java:564)
      	at com.thed.zephyr.jenkins.reporter.ZfjReporter.perform(ZfjReporter.java:99)
      	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:720)
      	at hudson.model.Build$BuildExecution.post2(Build.java:185)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:665)
      	at hudson.model.Run.execute(Run.java:1753)
      	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      	at hudson.model.ResourceController.execute(ResourceController.java:98)
      	at hudson.model.Executor.run(Executor.java:404)
      Build step 'Publish test result to Zephyr for JIRA' marked build as failure
      

        1. test2.png
          test2.png
          9 kB
        2. test1.png
          test1.png
          9 kB
        3. Selection_003.png
          Selection_003.png
          62 kB
        4. output2.xml
          57 kB
        5. output1.xml
          59 kB
        6. junit2.xml
          0.8 kB
        7. junit1.xml
          0.7 kB

          [JENKINS-43146] java.lang.NullPointerException when publish JUnit.xml result to Zephyr for Jira

          lokman liton added a comment - - edited

          I saw that, this issue is fixed in JENKINS-30091 in windows 7 for Zephyr for Jira plugin version 1.3. But it is being hanged after ...

          Recording test results
          [ZapiTestResultReporter] [INFO] Examining test results...
          Build result is SUCCESS
          

          Jenkins Version: 2.52

          lokman liton added a comment - - edited I saw that, this issue is fixed in JENKINS-30091 in windows 7 for Zephyr for Jira plugin version 1.3. But it is being hanged after ... Recording test results [ZapiTestResultReporter] [INFO] Examining test results... Build result is SUCCESS Jenkins Version: 2.52

          I'm seeing this issue in 1.2, 1.3, 1.4. Admin updated our version of ZAPI and Zephyr for JIRA and I've been seeing this issue. Jenkins 2.46.1 LTS.

          Charles Eakins added a comment - I'm seeing this issue in 1.2, 1.3, 1.4. Admin updated our version of ZAPI and Zephyr for JIRA and I've been seeing this issue. Jenkins 2.46.1 LTS.

          Rick Liu added a comment -

          I also created an issue ticket at Zephyr support website:
          https://support.getzephyr.com/hc/requests/20663

          According to Zephyr support,
          the plugin supports the test report from only Maven surefire report.

          Rick Liu added a comment - I also created an issue ticket at Zephyr support website: https://support.getzephyr.com/hc/requests/20663 According to Zephyr support, the plugin supports the test report from only Maven surefire report.

          Yeah I did also. It's the latest version of ZAPI for JIRA that is causing my issue. It's not returning all the execution ID's, I added a 10 second thread sleep just before the ZAPI rest call to retrieve them, and now I'm not getting NPE's. We didn't start seeing this issue until our admin updated the ZAPI plugin for JIRA. 

           

          Charles Eakins added a comment - Yeah I did also. It's the latest version of ZAPI for JIRA that is causing my issue. It's not returning all the execution ID's, I added a 10 second thread sleep just before the ZAPI rest call to retrieve them, and now I'm not getting NPE's. We didn't start seeing this issue until our admin updated the ZAPI plugin for JIRA.   

          Nil Paul added a comment -

          Using jenkins version 2.121.3.

          I am getting below error:-

           

          [ZapiTestResultReporter] [INFO] Examining test results...
          Build result is UNSTABLE
          Total Test Cases : 4ERROR: Build step failed with exception
          java.lang.NullPointerException
          at com.thed.zephyr.jenkins.utils.rest.TestCaseUtil.executeTestsZFJC(TestCaseUtil.java:1168)
          at com.thed.zephyr.jenkins.utils.rest.TestCaseUtil.processTestCaseDetails(TestCaseUtil.java:715)
          at com.thed.zephyr.jenkins.reporter.ZfjReporter.perform(ZfjReporter.java:101)
          at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
          at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
          at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
          at hudson.model.Build$BuildExecution.post2(Build.java:186)
          at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635)
          at hudson.model.Run.execute(Run.java:1823)
          at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
          at hudson.model.ResourceController.execute(ResourceController.java:97)
          at hudson.model.Executor.run(Executor.java:429)
          Build step 'Publish test result to Zephyr for JIRA' marked build as failure

          Nil Paul added a comment - Using jenkins version  2.121.3. I am getting below error:-   [ZapiTestResultReporter] [INFO] Examining test results... Build result is UNSTABLE Total Test Cases : 4ERROR: Build step failed with exception java.lang.NullPointerException at com.thed.zephyr.jenkins.utils.rest.TestCaseUtil.executeTestsZFJC(TestCaseUtil.java:1168) at com.thed.zephyr.jenkins.utils.rest.TestCaseUtil.processTestCaseDetails(TestCaseUtil.java:715) at com.thed.zephyr.jenkins.reporter.ZfjReporter.perform(ZfjReporter.java:101) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690) at hudson.model.Build$BuildExecution.post2(Build.java:186) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635) at hudson.model.Run.execute(Run.java:1823) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:429) Build step 'Publish test result to Zephyr for JIRA' marked build as failure

            zeedeveloper Zephyr Developer
            totoroliu Rick Liu
            Votes:
            5 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: