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

dsl job doesn't create a build step for Performance Center using Jenkins API

      I set up a new Jenkins server  2.138.1( previous server had Jenkins version 1.7, micro focus plugin 4.0.1)  and installed this plugin version 5.5 to integrate our Load Runner scripts with jenkins. We are using dsl scripts to build all Jenkins jobs. Somehow my dsl job doesn't create a build step for Performance Center anymore and I see no specific error messages anywhere. Maybe url for API changed, or this new version of plugin requires me to update code. On my old server this script works just fine. Here is part of groovy script which isn't working anymore. Other steps related to Bitbucket/scm and post build work okay. I'm attaching groovy  script also

       

      configure { project ->
      project / builders << {'com.hp.application.automation.tools.run.PcBuilder'(plugin: 'hp-application-automation-tools-plugin@5.5') {
      //{'com.microfocus.application.automation.tools.settings.OctaneServerSettingsBuilder_-OctaneDescriptorImpl'(plugin: 'hp-application-automation-tools-plugin@5.5') {

      'pcModel' {
      'pcServerName' 'server'
      'almUserName' 'jenkinsACA'
      //'almPassword' 'adpaca'
      //'almPassword'(class:"com.hp.application.automation.tools.model.SecretContainerImpl")

      { // '__secret' 'SVgLEvbkajdZLrVegImgVQ==' //}

      'almPassword'(class:"com.hp.application.automation.tools.model.SecretContainerImpl")

      { '__secret' 'Dsr90dh/+d6p3F8Mi5p4897Scnz/rUOsGF8TEsxzRxI=' }

      'almDomain' 'NAS'
      'almProject' 'ACA'
      'testId' test.testId
      'testInstanceId' test.testInstanceId
      'timeslotDuration'

      { 'Hours' test.hours 'Minutes' test.minutes }

      'postRunAction' 'COLLATE_AND_ANALYZE'
      'vudsMode' 'false'
      delegate.description test.description
      }
      'statusBySLA' 'false'
      'runId' 0
      }
      }
      }

          [JENKINS-54632] dsl job doesn't create a build step for Performance Center using Jenkins API

          Eduard Karlin added a comment -

          gront 

            Micro Focus Application Automation Tools
          This plugin enables integration with ALM, ALM Octane, Unified Functional Testing, LoadRunner, and Performance Center.
          5.5

          Eduard Karlin added a comment - gront     Micro Focus Application Automation Tools This plugin enables integration with ALM, ALM Octane, Unified Functional Testing, LoadRunner, and Performance Center. 5.5

          Eduard Karlin added a comment -

          and on my old server I had the older version:

            Micro Focus Application Automation Tools
          This plugin allows integration with HP ALM, HP Unified Functional Testing, HP LoadRunner and HP Performance cente
          4.0.1

          Eduard Karlin added a comment - and on my old server I had the older version:   Micro Focus Application Automation Tools This plugin allows integration with HP ALM, HP Unified Functional Testing, HP LoadRunner and HP Performance cente 4.0.1

          Daniel Gront added a comment -

          edkarlin, is the dsl file contains newly generated configuration from the pipeline syntax generator?

          danieldanan, for some reason he has this line which doesn't make sense 

          project / builders << {'com.hp.application.automation.tools.run.PcBuilder'(plugin: 'hp-application-automation-tools-plugin@5.5'), would replacing all the com.hp to com.microfocus solve this?

          Daniel Gront added a comment - edkarlin , is the dsl file contains newly generated configuration from the pipeline syntax generator? danieldanan , for some reason he has this line which doesn't make sense  project / builders << {'com.hp.application.automation.tools.run.PcBuilder'(plugin: 'hp-application-automation-tools-plugin@5.5'), would replacing all the com.hp to com.microfocus solve this?

          Eduard Karlin added a comment -

          gront Dsl/Groovy scripts contains new parameters, but they aren't being passed to the build steps.

          Eduard Karlin added a comment - gront Dsl/Groovy scripts contains new parameters, but they aren't being passed to the build steps. . 

          Eduard Karlin added a comment -

          It happens on old server with older version of plugin. On a new server I can't even create a build step with the latest version of plugin. I can obviously create manually those Jenkins jobs, but it will be difficult to manage any changes without dsl scripts. 

          Eduard Karlin added a comment - It happens on old server with older version of plugin. On a new server I can't even create a build step with the latest version of plugin. I can obviously create manually those Jenkins jobs, but it will be difficult to manage any changes without dsl scripts. 

          Daniel Danan added a comment - - edited

          Hi Eduard,
          Please change:
          com.hp.application.automation.tools.run.PcBuilder to com.microfocus.application.automation.tools.run.PcBuilder

          and then use (do not use the ID value from the example below, you can get the correct ID for the credentials of your user from jenkins home -> Credentials -> ID of a credential record already defined and that you will need to define):
          'credentialsId' 'b0f2c3bd-9fdb-4858-8f25-d23ddfa8f5f8'
          instead of two fields:
          'almUserName' 'jenkinsACA'
          'almPassword'(class:"com.hp.application.automation.tools.model.SecretContainerImpl"){
          'secret' 'Dsr90dh/+d6p3F8Mi5p4897Scnz/rUOsGF8TEsxzRxI='
          }

          Also add the parameter:
          'retry' 'NO_RETRY'

          regards,
          Daniel

          Daniel Danan added a comment - - edited Hi Eduard, Please change: com.hp.application.automation.tools.run.PcBuilder to com.microfocus.application.automation.tools.run.PcBuilder and then use (do not use the ID value from the example below, you can get the correct ID for the credentials of your user from jenkins home -> Credentials -> ID of a credential record already defined and that you will need to define): 'credentialsId' 'b0f2c3bd-9fdb-4858-8f25-d23ddfa8f5f8' instead of two fields: 'almUserName' 'jenkinsACA' 'almPassword'(class:"com.hp.application.automation.tools.model.SecretContainerImpl"){ ' secret' 'Dsr90dh/+d6p3F8Mi5p4897Scnz/rUOsGF8TEsxzRxI=' } Also add the parameter: 'retry' 'NO_RETRY' regards, Daniel

          Eduard Karlin added a comment -

           

          Hi Daniel, unfortunately it's not working. On my old server I'm getting the build without any parameters. It's the same issue that I had before. But on a new server I'm getting a new error while running an updated dsl script, which actually prevents me from from building a job. Do I need to change something in config.xml?

          http://cdlpfacavap0001:8080/view/dsl-jobs/job/interactive-dsl/73/console

          > C:\Program Files\Git\bin\git.exe checkout -f 387cb94c710651f62189f51e8f3152802bb6b51fCommit message: "changing parameters for microfocus plugin" > C:\Program Files\Git\bin\git.exe rev-list --no-walk 77a41bd25937859d8f2d7c15197e993d4296226b # timeout=10Processing DSL script seed_interactive.groovyERROR: java.io.IOException: Failed to persist config.xmlFinished: FAILURE

          Eduard Karlin added a comment -   Hi Daniel, unfortunately it's not working. On my old server I'm getting the build without any parameters. It's the same issue that I had before. But on a new server I'm getting a new error while running an updated dsl script, which actually prevents me from from building a job. Do I need to change something in config.xml? http://cdlpfacavap0001:8080/view/dsl-jobs/job/interactive-dsl/73/console > C:\Program Files\Git\bin\git.exe checkout -f 387cb94c710651f62189f51e8f3152802bb6b51fCommit message: "changing parameters for microfocus plugin" > C:\Program Files\Git\bin\git.exe rev-list --no-walk 77a41bd25937859d8f2d7c15197e993d4296226b # timeout=10Processing DSL script seed_interactive.groovyERROR: java.io.IOException: Failed to persist config.xmlFinished: FAILURE

          Eduard Karlin added a comment -

          Here is  source code( an extract from my code)

           
          configure { project ->
          project / builders << {'com.microfocus.application.automation.tools.run.PcBuilder'(plugin: 'hp-application-automation-tools-plugin@5.5') {

          'pcBuild'

          { 'pcServerName' 'cdlpfpcsvr04.es.ad.adp.com' 'credentialsId' '54661f0e-0a57-406e-abf4-80d8e3cd776b' '*retry' 'NO_RETRY' 'retryDelay' '5' 'retryOccurrences' '3' 'almDomain' 'NAS' 'almProject' 'ACA' 'testId' test.testId 'testInstanceId' test.testInstanceId 'timeslotDurationHours' test.hours 'timeslotDurationMinutes' test.minutes 'postRunAction' 'COLLATE_AND_ANALYZE' 'vudsMode' 'false' delegate.description test.description }

          'statusBySLA' 'false'
          'runId' 0
          }
          }
          }
           

          Eduard Karlin added a comment - Here is  source code( an extract from my code)   configure { project -> project / builders << {'com.microfocus.application.automation.tools.run.PcBuilder'(plugin: 'hp-application-automation-tools-plugin@5.5') { 'pcBuild' { 'pcServerName' 'cdlpfpcsvr04.es.ad.adp.com' 'credentialsId' '54661f0e-0a57-406e-abf4-80d8e3cd776b' '*retry' 'NO_RETRY' 'retryDelay' '5' 'retryOccurrences' '3' 'almDomain' 'NAS' 'almProject' 'ACA' 'testId' test.testId 'testInstanceId' test.testInstanceId 'timeslotDurationHours' test.hours 'timeslotDurationMinutes' test.minutes 'postRunAction' 'COLLATE_AND_ANALYZE' 'vudsMode' 'false' delegate.description test.description } 'statusBySLA' 'false' 'runId' 0 } } }  

          Daniel Danan added a comment -

          Hi Eduard,

          Please look at the attached file 'used_dsl_script.txt'. I used it in a job having a "Process Job DSLs" build step configured to run a provided DSL Script  (see attached configuring dsl script.png file).

          I then run the job and it passes (see attached "running job.png").

          When i look at the list of jobs in my jenkins environment, I do see 6 additional jobs created by running this build (see attached file "additional jobs created.png").

          When i review one of the jobs supposed to contain the configuration of one of the test executions, it looks OK (see attached file "Configuration of scenario 1 job created by DSL script.png").

          I didn't try to run it (and in any case it would have failed as i provided wrong input data in the tests array defined in the dsl script) but i believe those scenario jobs would have been OK.

          I used the web site https://job-dsl.herokuapp.com/ to verify that DSL was indeed creating the config.xml according to what was expected. I am not sure how much reliable it is but it helped me overcome some errors while trying to find the correct syntax.

          Basically, the script should contain the following section for correctly creating the build step (in your case, please modify the bold section in the following script):

           

          configure { project ->
          project / builders << 'com.microfocus.application.automation.tools.run.PcBuilder' (plugin: 'hp-application-automation-tools-plugin@5.5.3-beta-SNAPSHOT')

          { 'HTTPSProtocol' 'false' 'addRunToTrendReport' 'ASSOCIATED' 'almDomain' 'MYDOMAIN' 'almProject' 'MYPROJECT' 'autoTestInstanceID' 'MANUAL' 'credentialsId' '98dce5e1-91e9-4299-85a0-c306059f6034' 'credentialsProxyId' '' 'description' test.description 'pcServerName' 'MYPCSERVER' 'postRunAction' 'COLLATE_AND_ANALYZE' 'proxyOutURL' '' 'retry' 'NO_RETRY' 'retryDelay' '5' 'retryOccurrences' '3' 'serverAndPort' 'http://MyJenkinsServer:8080' 'statusBySLA' 'false' 'testId' test.testId 'testInstanceId' test.testInstanceId 'timeslotDurationHours' test.hours 'timeslotDurationMinutes' test.minutes 'trendReportId' '' 'vudsMode' 'false' } }

          Give it a try. If you need to figure out which values to use for fields such as 'credentialsId', 'serverAndPort' or anything else, help yourself with pipeline syntax in your Jenkins server: <jenkinsURL>/job/pc_pipeline/pipeline-syntax/, "select pcBuild: Execute performance test using Performance Center", provide the values you would usually provide to have correct input, then press the "Generate Pipeline Script" button and base on the generated script to provide values to your DSL script.

          regards,
          Daniel

          Daniel Danan added a comment - Hi Eduard, Please look at the attached file 'used_dsl_script.txt'. I used it in a job having a "Process Job DSLs" build step configured to run a provided DSL Script  (see attached configuring dsl script.png file). I then run the job and it passes (see attached "running job.png"). When i look at the list of jobs in my jenkins environment, I do see 6 additional jobs created by running this build (see attached file "additional jobs created.png"). When i review one of the jobs supposed to contain the configuration of one of the test executions, it looks OK (see attached file "Configuration of scenario 1 job created by DSL script.png"). I didn't try to run it (and in any case it would have failed as i provided wrong input data in the tests array defined in the dsl script) but i believe those scenario jobs would have been OK. I used the web site https://job-dsl.herokuapp.com/  to verify that DSL was indeed creating the config.xml according to what was expected. I am not sure how much reliable it is but it helped me overcome some errors while trying to find the correct syntax. Basically, the script should contain the following section for correctly creating the build step (in your case, please modify the bold section in the following script):   configure { project -> project / builders << 'com.microfocus.application.automation.tools.run.PcBuilder' (plugin: 'hp-application-automation-tools-plugin@ 5.5.3-beta-SNAPSHOT ') { 'HTTPSProtocol' 'false' 'addRunToTrendReport' 'ASSOCIATED' 'almDomain' 'MYDOMAIN' 'almProject' 'MYPROJECT' 'autoTestInstanceID' 'MANUAL' 'credentialsId' '98dce5e1-91e9-4299-85a0-c306059f6034' 'credentialsProxyId' '' 'description' test.description 'pcServerName' 'MYPCSERVER' 'postRunAction' 'COLLATE_AND_ANALYZE' 'proxyOutURL' '' 'retry' 'NO_RETRY' 'retryDelay' '5' 'retryOccurrences' '3' 'serverAndPort' 'http://MyJenkinsServer:8080' 'statusBySLA' 'false' 'testId' test.testId 'testInstanceId' test.testInstanceId 'timeslotDurationHours' test.hours 'timeslotDurationMinutes' test.minutes 'trendReportId' '' 'vudsMode' 'false' } } Give it a try. If you need to figure out which values to use for fields such as 'credentialsId', 'serverAndPort' or anything else, help yourself with pipeline syntax in your Jenkins server: <jenkinsURL>/job/pc_pipeline/pipeline-syntax/, "select pcBuild: Execute performance test using Performance Center", provide the values you would usually provide to have correct input, then press the "Generate Pipeline Script" button and base on the generated script to provide values to your DSL script. regards, Daniel

          Eduard Karlin added a comment -

          Hey Daniel,

          Thanks for all your information! I just came from vacation and trying to debug again this issue. So far not working, but I'll try a few different things. We are running so many different scripts( ant, ruby, maven and etc) using different plugins, and somehow only integration with Performance center isn't working.

          I tried to get a pipeline syntax, but that url finds nothing. Should I add some specific plugin for that also?

          http://cdlvdiw703202:8080/job/pc_pipeline/pipeline-syntax/
          Problem accessing /job/pc_pipeline/pipeline-syntax/. Reason:

          Not Found
          Thanks,
          Eduard.

          Eduard Karlin added a comment - Hey Daniel, Thanks for all your information! I just came from vacation and trying to debug again this issue. So far not working, but I'll try a few different things. We are running so many different scripts( ant, ruby, maven and etc) using different plugins, and somehow only integration with Performance center isn't working. I tried to get a pipeline syntax, but that url finds nothing. Should I add some specific plugin for that also? http://cdlvdiw703202:8080/job/pc_pipeline/pipeline-syntax/ Problem accessing /job/pc_pipeline/pipeline-syntax/. Reason: Not Found Thanks, Eduard.

            danieldanan Daniel Danan
            edkarlin Eduard Karlin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: