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

the robotframwork plugin throws an exception when parsing output.xml

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • robot-plugin
    • None
    • 3.3.0

      when i run my testcases the try to publish the tobot results using the plugin i fails to parse giving this :

      Robot results publisher started...
      -Parsing output xml:
      ERROR: Build step failed with exception
      Also: hudson.remoting.Channel$CallSiteStackTrace: Remote call to telefonica-Cats-Lab3
      at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1784)
      at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:356)
      at hudson.remoting.Channel.call(Channel.java:1000)
      at hudson.FilePath.act(FilePath.java:1194)
      at hudson.FilePath.act(FilePath.java:1183)
      at hudson.plugins.robot.RobotParser.parse(RobotParser.java:48)
      at hudson.plugins.robot.RobotPublisher.parse(RobotPublisher.java:245)
      at hudson.plugins.robot.RobotPublisher.perform(RobotPublisher.java:267)
      at jenkins.tasks.SimpleBuildStep.perform(SimpleBuildStep.java:123)
      at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:79)
      at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:816)
      at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:765)
      at hudson.model.Build$BuildExecution.post2(Build.java:179)
      at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:709)
      at hudson.model.Run.execute(Run.java:1922)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:44)
      at hudson.model.ResourceController.execute(ResourceController.java:101)
      at hudson.model.Executor.run(Executor.java:442)
      java.lang.IllegalStateException: Not a textual event (END_ELEMENT)
      at com.ctc.wstx.sr.BasicStreamReader.throwNotTextual(BasicStreamReader.java:5595)
      at com.ctc.wstx.sr.BasicStreamReader.getText(BasicStreamReader.java:891)
      at hudson.plugins.robot.RobotParser$RobotParserCallable.processArgs(RobotParser.java:516)
      at hudson.plugins.robot.RobotParser$RobotParserCallable.processKeyword(RobotParser.java:475)
      at hudson.plugins.robot.RobotParser$RobotParserCallable.processKeyword(RobotParser.java:482)
      at hudson.plugins.robot.RobotParser$RobotParserCallable.processKeyword(RobotParser.java:482)
      at hudson.plugins.robot.RobotParser$RobotParserCallable.processTest(RobotParser.java:302)
      at hudson.plugins.robot.RobotParser$RobotParserCallable.processSuite(RobotParser.java:153)
      at hudson.plugins.robot.RobotParser$RobotParserCallable.parseResult(RobotParser.java:121)
      at hudson.plugins.robot.RobotParser$RobotParserCallable.invoke(RobotParser.java:97)
      at hudson.plugins.robot.RobotParser$RobotParserCallable.invoke(RobotParser.java:52)
      at hudson.FilePath$FileCallableWrapper.call(FilePath.java:3502)
      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.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
      at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
      at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
      at java.base/java.lang.Thread.run(Thread.java:834)
      Build step 'Publish Robot Framework test results' marked build as failure

       

      after an initial investigation  and not 100% sure the issue with a keyword we use alot in robot framework which has the following as argument:

      def disconnect(self):
              self.__save_current_index()
              try:
                  self.__switch_to_my_connection()
                  self.BI.run_keyword("SSHLibrary.Write Bare", chr(int(3)))
                  self.BI.run_keyword("SSHLibrary.Write Bare", "exit\n")
                  self.BI.run_keyword("SSHLibrary.Close Connection")
                  self.__my_index = None

      that the argument chr(int(3)) isnt considered textual somehow

      and may be the fix be around line 515 in the java code

      of course i may be wrong but when i run another test doesnt have this keyword it works fine

       

      the output xml is attached

          [JENKINS-69544] the robotframwork plugin throws an exception when parsing output.xml

          Aleksi Simell added a comment -

          Hi,

          I just debugged with your output.xml file and I can indeed reproduce this. The issue is that twice in your output  XML you have an empty <arg></arg>(lines 4736 and 4793), which is not handled by the plugin.

          I can modify the parser to be able to handle these situations, but I'm more curious as to how you even ended up in a situation like this? As to my knowledge Robot Framework shouldn't produce empty <arg> tags at all.

          Aleksi Simell added a comment - Hi, I just debugged with your output.xml file and I can indeed reproduce this. The issue is that twice in your output  XML you have an empty <arg></arg>(lines 4736 and 4793) , which is not handled by the plugin. I can modify the parser to be able to handle these situations, but I'm more curious as to how you even ended up in a situation like this? As to my knowledge Robot Framework shouldn't produce empty <arg> tags at all.

          yes i understand you ......we tried to debug the reason behind this but i didnt find it ... but this is the case in our work environment ....so if the parser would be able to handle it that is great ....( cause now we are using rebot to snip out the part the is causing issues from the code)

          moataz elshorbagy added a comment - yes i understand you ......we tried to debug the reason behind this but i didnt find it ... but this is the case in our work environment ....so if the parser would be able to handle it that is great ....( cause now we are using rebot to snip out the part the is causing issues from the code)

          aleksisimell  if its possible to accommodate this in a new update that would be great

          moataz elshorbagy added a comment - aleksisimell   if its possible to accommodate this in a new update that would be great

          Aleksi Simell added a comment -

          Aleksi Simell added a comment - https://github.com/jenkinsci/robot-plugin/pull/52 Created to resolve this issue.

          Aleksi Simell added a comment -

          PR merged. Fix will be available in the next release.

          Aleksi Simell added a comment - PR merged. Fix will be available in the next release.

          thanks alot 

          moataz elshorbagy added a comment - thanks alot 

            aleksisimell Aleksi Simell
            mo3tazsame7 moataz elshorbagy
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: