There are two main issues I've seen attempting to use the RunResultRecorder in a pipelines job. First, when trying to use the Pipeline Syntax UI to create the correct step, the result is not useful as shown below:

      So after some digging, I was able to construct a general step using the class name and came up with: 

      step $class: 'RunResultRecorder', archiveTestResultsMode: 'Always archive HPE test reports'

      This structure produces the an error during execution:

      java.lang.ClassCastException: org.jenkinsci.plugins.workflow.job.WorkflowJob cannot be cast to hudson.model.Project
      	at com.hpe.application.automation.tools.results.RunResultRecorder.perform(RunResultRecorder.java:1242)
      	at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:78)
      	at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:65)
      	at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1$1.call(SynchronousNonBlockingStepExecution.java:49)
      	at hudson.security.ACL.impersonate(ACL.java:260)
      	at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1.run(SynchronousNonBlockingStepExecution.java:46)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at java.lang.Thread.run(Thread.java:748)

      I tried to use a non-pipeline job to test this out and the plugin worked fine, but we need to use pipelines for this job.

      Thanks!

      Possibly related to JENKINS-51293

          [JENKINS-52464] Issues using RunResultRecorder in pipelines

          Daniel Gront added a comment -

          Hey crock, what step are you trying to record with the RunResultRecorder?

          Daniel Gront added a comment - Hey crock , what step are you trying to record with the RunResultRecorder?

          Chris Rock added a comment -

          I'm using runFromAlmBuilder. I never found any documentation on what the possible values are for almRunResultsMode even though it's a required field. Maybe that can help?

          runFromAlmBuilder almServerName: 'ALM Server',
          		almDomain: 'some_domain',
          		almProject: 'some_project',
          		almUserName: '*****',
          		almPassword: '*****',
          		almRunMode: 'RUN_REMOTE',
          		almRunHost: 'hostname',
          		almRunResultsMode: '',
          		almTestSets: 'test\\set',
          		almTimeout: ''
          

          Chris Rock added a comment - I'm using runFromAlmBuilder. I never found any documentation on what the possible values are for almRunResultsMode even though it's a required field. Maybe that can help? runFromAlmBuilder almServerName: 'ALM Server' , almDomain: 'some_domain' , almProject: 'some_project' , almUserName: '*****' , almPassword: '*****' , almRunMode: 'RUN_REMOTE' , almRunHost: 'hostname' , almRunResultsMode: '', almTestSets: 'test\\set' , almTimeout: ''

          Daniel Gront added a comment -

          crock, We are currently working on resolving this issue.

          Daniel Gront added a comment - crock , We are currently working on resolving this issue.

          Daniel Gront added a comment -

          The issue is resolved at https://github.com/jenkinsci/hpe-application-automation-tools-plugin/pull/130

          And will be published the next release or the next beta.

          Daniel Gront added a comment - The issue is resolved at https://github.com/jenkinsci/hpe-application-automation-tools-plugin/pull/130 And will be published the next release or the next beta.

          Chris Rock added a comment -

          Thanks so much gront

          Chris Rock added a comment - Thanks so much gront

          Chris Rock added a comment -

          I've updated to 5.5 and I'm still running into the WorkflowJob to Project conversion error. The first part of this bug is fixed and I can now generate the pipeline step for the run result recorder but that step still doesn't work. I tested both putting the runResultRecorder step immediately after the runFromAlmBuilder step and putting the recorder step into a declarative post action.  None of the other information has changed.

          One thing I may not have mentioned but I'm not sure it makes a difference is that we are using Declarative Pipelines.

          The error again for reference:

          java.lang.ClassCastException: org.jenkinsci.plugins.workflow.job.WorkflowJob cannot be cast to hudson.model.Project
          	at com.microfocus.application.automation.tools.results.RunResultRecorder.perform(RunResultRecorder.java:1406)
          	at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:78)
          	at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:65)
          	at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1$1.call(SynchronousNonBlockingStepExecution.java:49)
          	at hudson.security.ACL.impersonate(ACL.java:260)
          	at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1.run(SynchronousNonBlockingStepExecution.java:46)
          	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
          	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
          	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
          	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
          	at java.lang.Thread.run(Thread.java:748)
          

          Chris Rock added a comment - I've updated to 5.5 and I'm still running into the WorkflowJob to Project conversion error. The first part of this bug is fixed and I can now generate the pipeline step for the run result recorder but that step still doesn't work. I tested both putting the runResultRecorder step immediately after the runFromAlmBuilder step and putting the recorder step into a declarative post action.  None of the other information has changed. One thing I may not have mentioned but I'm not sure it makes a difference is that we are using Declarative Pipelines. The error again for reference: java.lang.ClassCastException: org.jenkinsci.plugins.workflow.job.WorkflowJob cannot be cast to hudson.model.Project at com.microfocus.application.automation.tools.results.RunResultRecorder.perform(RunResultRecorder.java:1406) at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:78) at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:65) at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1$1.call(SynchronousNonBlockingStepExecution.java:49) at hudson.security.ACL.impersonate(ACL.java:260) at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1.run(SynchronousNonBlockingStepExecution.java:46) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang. Thread .run( Thread .java:748)

            rolandomihaivlad Rolando-Mihai Vlad
            crock Chris Rock
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: