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

Failing to parse pabot generated output.xml with Robot Framework 7.0

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Major Major
    • robot-plugin
    • None

      When running Robot Framework plugin 3.5.0 with pabot, it fails to parse the output.xml and gives the following error:

      Also:   org.jenkinsci.plugins.workflow.actions.ErrorAction$ErrorId: 392fd72f-5164-49c5-a9d4-11eacbe0a368
      java.lang.NullPointerException: Cannot invoke "String.length()" because "text" is null
      	at java.base/java.text.SimpleDateFormat.parse(SimpleDateFormat.java:1474)
      	at java.base/java.text.DateFormat.parse(DateFormat.java:397)
      	at hudson.plugins.robot.model.RobotCaseResult.timeDifference(RobotCaseResult.java:68)
      	at hudson.plugins.robot.model.RobotCaseResult.getDuration(RobotCaseResult.java:117)
      	at hudson.plugins.robot.model.RobotSuiteResult.tally(RobotSuiteResult.java:405)
      	at hudson.plugins.robot.model.RobotSuiteResult.tally(RobotSuiteResult.java:413)
      	at hudson.plugins.robot.model.RobotSuiteResult.tally(RobotSuiteResult.java:413)
      	at hudson.plugins.robot.model.RobotResult.tally(RobotResult.java:422)
      	at hudson.plugins.robot.RobotBuildAction.setResult(RobotBuildAction.java:124)
      	at hudson.plugins.robot.RobotBuildAction.<init>(RobotBuildAction.java:95)
      	at hudson.plugins.robot.RobotPublisher.perform(RobotPublisher.java:299)
      	at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:101)
      	at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:71)
      	at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
      	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
      	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
      	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
      	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
      	at java.base/java.lang.Thread.run(Thread.java:833)
      Finished: FAILURE
      

      It's trying to parse the endtime attribute from the output.xml, but that attribute was removed in Robot Framework 7.0.

          [JENKINS-72582] Failing to parse pabot generated output.xml with Robot Framework 7.0

          Mark Waite added a comment -

          pavans thanks reporting the issue. We are grateful when a user reports a problem.

          You'll need to provide much more information in order to persuade others to volunteer their time to investigate the issue. The "How to report an issue" page lists the types of details that are needed so that others can investigate an issue. If that information is not provided, this will likely be closed as "Cannot reproduce".

          Mark Waite added a comment - pavans thanks reporting the issue. We are grateful when a user reports a problem. You'll need to provide much more information in order to persuade others to volunteer their time to investigate the issue. The "How to report an issue" page lists the types of details that are needed so that others can investigate an issue. If that information is not provided, this will likely be closed as "Cannot reproduce".

          Pavan added a comment -

          Hi aleksisimell actually I'm getting this error while trying to publish the robot test results to the jenkins Dashboard. I got this exception while assigning the robot results to the build after parsing the results file. 

          Pavan added a comment - Hi aleksisimell actually I'm getting this error while trying to publish the robot test results to the jenkins Dashboard. I got this exception while assigning the robot results to the build after parsing the results file. 

          Pavan added a comment -

          Hi aleksisimell actually I'm getting this error while trying to publish the robot test results to the jenkins Dashboard. I got this exception while assigning the robot results to the build after parsing the results file. 

          Pavan added a comment - Hi aleksisimell actually I'm getting this error while trying to publish the robot test results to the jenkins Dashboard. I got this exception while assigning the robot results to the build after parsing the results file. 

          Aleksi Simell added a comment -

          What versions of the plugin, Robot Framework, and Jenkins are you using? And what does your pipeline look like?

          I can't really even begin to investigate with this bug description as and markewaite said, without further information, I will have to close this ticket due to lacking information.

          Aleksi Simell added a comment - What versions of the plugin, Robot Framework, and Jenkins are you using? And what does your pipeline look like? I can't really even begin to investigate with this bug description as and markewaite said, without further information, I will have to close this ticket due to lacking information.

          Dani added a comment -

          Hi,

          I am facing the same issue while using robot plugin to publish the results. Let me provide more information.

          When the plugin is used:

           

          [Pipeline] End of Pipeline
          Also:   org.jenkinsci.plugins.workflow.actions.ErrorAction$ErrorId: 392fd72f-5164-49c5-a9d4-11eacbe0a368
          java.lang.NullPointerException: Cannot invoke "String.length()" because "text" is null
          	at java.base/java.text.SimpleDateFormat.parse(SimpleDateFormat.java:1474)
          	at java.base/java.text.DateFormat.parse(DateFormat.java:397)
          	at hudson.plugins.robot.model.RobotCaseResult.timeDifference(RobotCaseResult.java:68)
          	at hudson.plugins.robot.model.RobotCaseResult.getDuration(RobotCaseResult.java:117)
          	at hudson.plugins.robot.model.RobotSuiteResult.tally(RobotSuiteResult.java:405)
          	at hudson.plugins.robot.model.RobotSuiteResult.tally(RobotSuiteResult.java:413)
          	at hudson.plugins.robot.model.RobotSuiteResult.tally(RobotSuiteResult.java:413)
          	at hudson.plugins.robot.model.RobotResult.tally(RobotResult.java:422)
          	at hudson.plugins.robot.RobotBuildAction.setResult(RobotBuildAction.java:124)
          	at hudson.plugins.robot.RobotBuildAction.<init>(RobotBuildAction.java:95)
          	at hudson.plugins.robot.RobotPublisher.perform(RobotPublisher.java:299)
          	at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:101)
          	at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:71)
          	at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
          	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
          	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
          	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
          	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
          	at java.base/java.lang.Thread.run(Thread.java:833)
          [Gitea] Notifying branch build status: FAILURE There was a failure building this commit
          [Gitea] Notified
          Finished: FAILURE

           

           

          When the plugin is not used:

           

          [Pipeline] End of Pipeline
          [Gitea] Notifying branch build status: SUCCESS This commit looks good
          [Gitea] Notified
          Finished: SUCCESS

           

           

          The versions:

          - Robot Framework version: 7.0

          • plugin version: 3.5.0
          • Jenkins version: 2.414.2

          Dani added a comment - Hi, I am facing the same issue while using robot plugin to publish the results. Let me provide more information. When the plugin is used:   [Pipeline] End of Pipeline Also: org.jenkinsci.plugins.workflow.actions.ErrorAction$ErrorId: 392fd72f-5164-49c5-a9d4-11eacbe0a368 java.lang.NullPointerException: Cannot invoke "String.length()" because "text" is null at java.base/java.text.SimpleDateFormat.parse(SimpleDateFormat.java:1474) at java.base/java.text.DateFormat.parse(DateFormat.java:397) at hudson.plugins.robot.model.RobotCaseResult.timeDifference(RobotCaseResult.java:68) at hudson.plugins.robot.model.RobotCaseResult.getDuration(RobotCaseResult.java:117) at hudson.plugins.robot.model.RobotSuiteResult.tally(RobotSuiteResult.java:405) at hudson.plugins.robot.model.RobotSuiteResult.tally(RobotSuiteResult.java:413) at hudson.plugins.robot.model.RobotSuiteResult.tally(RobotSuiteResult.java:413) at hudson.plugins.robot.model.RobotResult.tally(RobotResult.java:422) at hudson.plugins.robot.RobotBuildAction.setResult(RobotBuildAction.java:124) at hudson.plugins.robot.RobotBuildAction.<init>(RobotBuildAction.java:95) at hudson.plugins.robot.RobotPublisher.perform(RobotPublisher.java:299) at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:101) at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:71) at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang.Thread.run(Thread.java:833) [Gitea] Notifying branch build status: FAILURE There was a failure building this commit [Gitea] Notified Finished: FAILURE     When the plugin is not used:   [Pipeline] End of Pipeline [Gitea] Notifying branch build status: SUCCESS This commit looks good [Gitea] Notified Finished: SUCCESS     The versions: - Robot Framework version: 7.0 plugin version: 3.5.0 Jenkins version: 2.414.2

          Aleksi Simell added a comment - - edited

          Hi villacisd,

          Thank you for the input! Could you also provide a sample test case or output.xml file and a snippet of a pipeline where this can be reproduced? I'm not getting this error from my test pipelines.

          Are you using pabot or any other additional tool apart from just calling Robot Framework in your pipeline?

          Aleksi Simell added a comment - - edited Hi villacisd , Thank you for the input! Could you also provide a sample test case or output.xml file and a snippet of a pipeline where this can be reproduced? I'm not getting this error from my test pipelines. Are you using pabot or any other additional tool apart from just calling Robot Framework in your pipeline?

          Pavan added a comment -

          Hi aleksisimell

          Yes I use pabot to run the test suites. Do I have to add any other plugin in this case? 

          Pavan added a comment - Hi aleksisimell ,  Yes I use pabot to run the test suites. Do I have to add any other plugin in this case? 

          Aleksi Simell added a comment -

          You don't need an additional plugin, but there's the problem.

          I narrowed this down to pabot, because the plugin version 3.5.0 uses Robot Framework's schemaVersion attribute to define which properties to set. With Robot Framework, the schemaVersion 5 means Robot Framework version 7. Pabot is not adding this attribute to the output.xml file, but otherwise it's similar to Robot Framework output.xml. Which means that there's the "elapsed" attribute and no "endtime" attribute. However, the plugin doesn't know this, since it hasn't parsed the "schemaVersion" attribute to determine which attributes to use... So it tries to parse the non-existent "endtime" attribute causing this nullPointerException.

          I'm not sure this works, but could you try to run the output.xml through rebot and then pass that to the plugin to see if that helps you pass?

          As a workaround you can also run Robot Framework with the --legacy-output option to give it the old attributes from RF 6.x.

          Aleksi Simell added a comment - You don't need an additional plugin, but there's the problem. I narrowed this down to pabot, because the plugin version 3.5.0 uses Robot Framework's schemaVersion attribute to define which properties to set. With Robot Framework, the schemaVersion 5 means Robot Framework version 7. Pabot is not adding this attribute to the output.xml file, but otherwise it's similar to Robot Framework output.xml. Which means that there's the "elapsed" attribute and no "endtime" attribute. However, the plugin doesn't know this, since it hasn't parsed the "schemaVersion" attribute to determine which attributes to use... So it tries to parse the non-existent "endtime" attribute causing this nullPointerException. I'm not sure this works, but could you try to run the output.xml through rebot and then pass that to the plugin to see if that helps you pass? As a workaround you can also run Robot Framework with the --legacy-output option to give it the old attributes from RF 6.x.

          Tatu Kairi added a comment -

          pavans , Additionally, you should check if the latest version of pabot (2.17.0, released 3 days ago at the time of writing) helps as that now has RF7.0 support as well

          Tatu Kairi added a comment - pavans , Additionally, you should check if the latest version of pabot (2.17.0, released 3 days ago at the time of writing) helps as that now has RF7.0 support as well

          Aleksi Simell added a comment -

          When using the newest pabot version (2.17.0), the plugin works as expected and the output file is parsed correctly. Closing issue as not a defect.

          Aleksi Simell added a comment - When using the newest pabot version (2.17.0), the plugin works as expected and the output file is parsed correctly. Closing issue as not a defect.

            aleksisimell Aleksi Simell
            pavans Pavan
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: