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

Support multiple output.xml's to support parallel test executions in pipeline

    • Icon: Improvement Improvement
    • Resolution: Won't Do
    • Icon: Trivial Trivial
    • robot-plugin
    • None

      I am building running my robot framework test case parallel in Jenkins pipeline. However the Robot Test Summary generated post build is not correct, it displaying the count/summary of last finished in parallelism, however it should show the count of individual job. It was overwriting the report also earlier but that I saved as different name & it worked fine, but still the Robot Test Summary is problem(please not my both suite below have different number of test cases).

      suite1:{
      try

      { mvn -s /settings.xml install robotframework:run -Dexcludes=inprogress -Dsuites=test1 -DLogFileName=suite1_log.html -DoutputFileName=suite1_output.xml -DreportFileName=suite1_report.html' currentBuild.result = 'SUCCESS' }

      catch(any)

      { currentBuild.result = 'FAILURE' throw any }

      finally

      { step([$class: 'RobotPublisher', outputPath:'/source/xxxxxx/target/robotframework-reports', passThreshold: 0, unstableThreshold: 0, otherFiles: "", logFileName: 'suite1_log.html', outputFileName: 'suite1_output.xml', reportFileName: 'suite1_report.html']) }

      },
      suite2:{
      try

      { mvn -s /settings.xml robotframework:run -Dexcludes=inprogress -Dsuites=test2 -DLogFileName=suite2_log.html -DoutputFileName=suite2_output.xml -DreportFileName=suite2_report.html' currentBuild.result = 'SUCCESS' }

      catch(any)

      { currentBuild.result = 'FAILURE' //sendMail() throw any }

      finally

      { step([$class: 'RobotPublisher', outputPath:'/source/xxxxxx/target/robotframework-reports/', passThreshold: 0, unstableThreshold: 0, otherFiles: "", logFileName: 'suite2_log.html', outputFileName: 'suite2_output.xml', reportFileName: 'suite2_report.html']) }

          [JENKINS-37739] Support multiple output.xml's to support parallel test executions in pipeline

          Tatu Kairi added a comment - - edited

          If you are running tests in parallel, there's few best practices to keep in mind:

          • if the paraller runs are writing in to same Jenkins workspace, the Robot outputs' file names will clash. Easy fix is to utilise --timestampoutputs or write different test executions into separate folders with --outputdir/-d.
          • after runs had been made, one can combine separate output.xml's into one with rebot
            • if you are combining outputs, it's good idea for the sake of performance to use -l NONE and -r NONE. this way in the end, there's only one output.xml, log.html and report.html from the entire pipeline, that can then be handled by robot Jenkins plugin as normal.

          Tatu Kairi added a comment - - edited If you are running tests in parallel, there's few best practices to keep in mind: if the paraller runs are writing in to same Jenkins workspace, the Robot outputs' file names will clash. Easy fix is to utilise --timestampoutputs or write different test executions into separate folders with --outputdir/-d . after runs had been made, one can combine separate output.xml 's into one with rebot if you are combining outputs, it's good idea for the sake of performance to use -l NONE and -r NONE . this way in the end, there's only one output.xml , log.html and report.html from the entire pipeline, that can then be handled by robot Jenkins plugin as normal.

          Tatu Kairi added a comment -

          singhshyam astaruch

          Hi,
          Do I understand the request correctly: you would wish an option in plugin that if there are multiple output.xml's available, the plugin would show the Robot Test Summary for each?

          (Also see my comment above this one)

          Tatu Kairi added a comment - singhshyam astaruch Hi, Do I understand the request correctly: you would wish an option in plugin that if there are multiple output.xml's available, the plugin would show the Robot Test Summary for each? (Also see my comment above this one)

          shyam singh added a comment - - edited

          tattoo, Yes if you have multiple output.xml plugin should show summary for each. Regarding merging please refer my comment above(https://issues.jenkins.io/browse/JENKINS-37739?focusedCommentId=312799&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-312799).  We have address this issue by modifying the plugin & it's displaying as we desired(please refer my comment above and sample screen shot of the same, same is running fine for long & we didn't see issue so far https://issues.jenkins.io/browse/JENKINS-37739?focusedCommentId=360583&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-360583 ). We are happy to create a pull request and deliver the same if other folks need it and agreed on same.

          shyam singh added a comment - - edited tattoo , Yes if you have multiple output.xml plugin should show summary for each. Regarding merging please refer my comment above( https://issues.jenkins.io/browse/JENKINS-37739?focusedCommentId=312799&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-312799 ).  We have address this issue by modifying the plugin & it's displaying as we desired(please refer my comment above and sample screen shot of the same, same is running fine for long & we didn't see issue so far https://issues.jenkins.io/browse/JENKINS-37739?focusedCommentId=360583&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-360583  ). We are happy to create a pull request and deliver the same if other folks need it and agreed on same.

          Tatu Kairi added a comment -

          singhshyam,

          Just wanted to clarify what is the exact issue discussed here. I have edited the issue title accordingly for it to be more clear.

          As said in my previous comment, parallel test executions with plugin can be done already by utilising Robot's built-in tool rebot and designing the jobs well. That's at least our own personal experience using the plugin in a wide variety of customer cases and never having a need for the feature(s) this issue discusses. After talking with other maintainers, our current view is that this is already-supported, generic way that does not increase the complexity of the plugin itself. This route has also been taken by the parallel executor tool pabot. We do not therefore plan to include this feature in the plugin, unless something changes. We're keeping this issue open for such future discoveries.

          It surprises me that combining 10 output.xml's would take five minutes to complete. Can you share what is roughly the file size of these output.xml's? There might be a case to be made to make Robot Framework core devs improve the performance of rebot if it's demonstrable that performance is that bad. "The overhead" of combining different results is being payed somewhere in any case, be it in RF itself or in the plugin.

          Also, be aware that Robot Framework 4.0 is due to be released this month and the new release introduces changes the structure of output.xml. We have had to make changes in the plugin for that and I'm guessing you might need to do so too.

          Tatu Kairi added a comment - singhshyam , Just wanted to clarify what is the exact issue discussed here. I have edited the issue title accordingly for it to be more clear. As said in my previous comment , parallel test executions with plugin can be done already by utilising Robot's built-in tool rebot and designing the jobs well. That's at least our own personal experience using the plugin in a wide variety of customer cases and never having a need for the feature(s) this issue discusses. After talking with other maintainers, our current view is that this is already-supported, generic way that does not increase the complexity of the plugin itself. This route has also been taken by the parallel executor tool pabot . We do not therefore plan to include this feature in the plugin, unless something changes. We're keeping this issue open for such future discoveries. It surprises me that combining 10 output.xml 's would take five minutes to complete. Can you share what is roughly the file size of these output.xml 's? There might be a case to be made to make Robot Framework core devs improve the performance of rebot  if it's demonstrable that performance is that bad. "The overhead" of combining different results is being payed somewhere in any case, be it in RF itself or in the plugin. Also, be aware that Robot Framework 4.0 is due to be released this month and the new release introduces changes the structure of output.xml . We have had to make changes in the plugin for that and I'm guessing you might need to do so too.

          shyam singh added a comment - - edited

          tattoo, thanks for your reply. 

          I captured the issue in description,  also I wouldn't call this as an issue, instead some expected behavior is missing, so it's an improvement good to have . Let me explain again

          1. Is running in parallel is an issue? --> No, it's not an issue, we can very well do it Jenkins parallel concept(please note we are using maven-robotframework plugin)  and it's running fine.
          2. Is merging is an issue? --> No, as I mention in earlier comment, merging can very well done and final output.xml can be passed to robot plugin & it plugin worked well.
          3. Why not going for merging?–> Indeed we were doing that, but with number of parallel run increases and kind of test we have size of output.xml also increases(each output.xml vary from 30MB to 60MB, depend upon kind of test, logging type and other factor) & we observed the merging time was on higher side, it was ~5 min when I file an improvement, it increases more further, as we increases in term of parallel job. So definitely it's not the right choice to merge the report(it may work well with light reports). One more disadvantage it has, the final html log report become too bulky that it will hang browser, also navigation/expand/collapse etc. is the biggest challenge. I really want to share dev feedback on this, & frankly none of them likes it.
          4. What was the issue with plugin?–> Plugin work well with what it stated, no doubt in that, but if we pass multiple output.xml, it's not considering and this is expected behavior.
          5. What advantage if we can publish in parallel–> We will not have extra overhead for merging. People who has bulky report can easily publish the report. Direct insight on reports, like which TAG/Plan fail so I can directly go to that report. Reports are lighter, & easy to navigate/collapse/expand. Also some user on this ticket has interest on such view 
          6. Do we still face the issue:- No, we don't, we modify the plugin & it worked well, no overhead of merging the report. Without merging we are publishing the consolidated count, as well as we are publishing the report in tabular format, each has a link to it's own report. It's very fast. In some Jobs we are publishing 50+ output.xml in parallel and we don't see any issue.

           

          I fully agree with you that with robot  Robot Framework 4.0 , output.xml has some changes, it may impact, but we have a plan to adopt for it, once we go on 4.0. I kept this open as some other might have interest and good to have such nice feature.

          Attaching a snips how it looks like in our production jenkins(dummy report), Ignore the time part, since it;s dummy output.xml so showing 0, it's showing actual time in production

           

          shyam singh added a comment - - edited tattoo , thanks for your reply.  I captured the issue in description,  also I wouldn't call this as an issue, instead some expected behavior is missing, so it's an improvement good to have . Let me explain again Is running in parallel is an issue? --> No, it's not an issue, we can very well do it Jenkins parallel concept(please note we are using maven-robotframework plugin)  and it's running fine. Is merging is an issue? --> No, as I mention in earlier comment, merging can very well done and final output.xml can be passed to robot plugin & it plugin worked well. Why not going for merging?–> Indeed we were doing that, but with number of parallel run increases and kind of test we have size of output.xml also increases(each output.xml vary from 30MB to 60MB , depend upon kind of test, logging type and other factor) & we observed the merging time was on higher side, it was ~5 min when I file an improvement, it increases more further, as we increases in term of parallel job. So definitely it's not the right choice to merge the report(it may work well with light reports). One more disadvantage it has, the final html log report become too bulky that it will hang browser, also navigation/expand/collapse etc. is the biggest challenge. I really want to share dev feedback on this, & frankly none of them likes it. What was the issue with plugin?–> Plugin work well with what it stated, no doubt in that, but if we pass multiple output.xml, it's not considering and this is expected behavior. What advantage if we can publish in parallel–> We will not have extra overhead for merging. People who has bulky report can easily publish the report. Direct insight on reports, like which TAG/Plan fail so I can directly go to that report. Reports are lighter, & easy to navigate/collapse/expand. Also some user on this ticket has interest on such view  Do we still face the issue:- No, we don't, we modify the plugin & it worked well, no overhead of merging the report. Without merging we are publishing the consolidated count, as well as we are publishing the report in tabular format, each has a link to it's own report. It's very fast. In some Jobs we are publishing 50+ output.xml in parallel and we don't see any issue.   I fully agree with you that with robot   Robot Framework 4.0  , output.xml has some changes, it may impact, but we have a plan to adopt for it, once we go on 4.0. I kept this open as some other might have interest and good to have such nice feature. Attaching a snips how it looks like in our production jenkins(dummy report), Ignore the time part, since it;s dummy output.xml so showing 0, it's showing actual time in production  

          Dirk Richter added a comment -

          concerning point 6.: if you already have a working implementation, why you don't create a pull request here: https://github.com/jenkinsci/robot-plugin/pulls ? I can see there a pull request for RobotFramework 4.0 support, too...

          Dirk Richter added a comment - concerning point 6.: if you already have a working implementation, why you don't create a pull request here: https://github.com/jenkinsci/robot-plugin/pulls ? I can see there a pull request for RobotFramework 4.0 support, too...

          shyam singh added a comment -

          dirkrichter, Yes we can create pull request if it's agreed , as it will change the report view in Jenkins also.

          shyam singh added a comment - dirkrichter , Yes we can create pull request if it's agreed , as it will change the report view in Jenkins also.

          Prabhav added a comment -

          Hi, is there any update on releasing this feature.

          We have a scenario where this is required.

          Prabhav added a comment - Hi, is there any update on releasing this feature. We have a scenario where this is required.

          Tatu Kairi added a comment -

          prabhav,

          As said in my previous comment, parallel test executions with plugin can be done already by utilising Robot's built-in tool rebot and designing the jobs well. That's at least our own personal experience using the plugin in a wide variety of customer cases and never having a need for the feature(s) this issue discusses. After talking with other maintainers, our current view is that this is already-supported, generic way that does not increase the complexity of the plugin itself. This route has also been taken by the parallel executor tool pabot. We do not therefore plan to include this feature in the plugin, unless something changes. We're keeping this issue open for such future discoveries.

          Tatu Kairi added a comment - prabhav , As said in my previous comment , parallel test executions with plugin can be done already by utilising Robot's built-in tool rebot and designing the jobs well. That's at least our own personal experience using the plugin in a wide variety of customer cases and never having a need for the feature(s) this issue discusses. After talking with other maintainers, our current view is that this is already-supported, generic way that does not increase the complexity of the plugin itself. This route has also been taken by the parallel executor tool pabot . We do not therefore plan to include this feature in the plugin, unless something changes. We're keeping this issue open for such future discoveries.

          Aleksi Simell added a comment -

          We decided not to add this functionality to the plugin as discussed in the comments.

          Aleksi Simell added a comment - We decided not to add this functionality to the plugin as discussed in the comments.

            hifi Juho Saarinen
            singhshyam shyam singh
            Votes:
            10 Vote for this issue
            Watchers:
            20 Start watching this issue

              Created:
              Updated:
              Resolved: