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

HP ALM Plugin - when job is branched only branch appear in HP ALM

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      when running "uploadResultToALM" in branched pipeline JOB_NAME is
      JOB_NAME=JOB_NAME/BRANCH
       

      HP ALM will present field "Jenkins Job Name" with only the branch name without the actual job name

        Attachments

          Activity

          Hide
          roy_lu Roy Lu added a comment -

          Can you show me how you configure the uploadResultToALM pipeline job?

          Show
          roy_lu Roy Lu added a comment - Can you show me how you configure the uploadResultToALM pipeline job?
          Hide
          noama Noam Angel added a comment -

          uploadResultToALM(almDomain: 'SDN',
          almProject: 'alm_project_testing',
          almServerName: 'alm-server',
          almTestFolder: 'tempest
          ',
          almTestSetFolder: env.BRANCH_NAME + '
          ' + (env.JOB_NAME - env.BRANCH_NAME - '/'),
          almTimeout: '',
          clientType: '',
          credentialsId: 'e28dfgdg1fb-fb6d-4e48-a480-4532gfdh',
          jenkinsServerUrl: JENKINS_URL,
          testingFramework: 'JUnit',
          testingResultFile: '**/junitResult.xml',
          testingTool: 'tempest')

          Show
          noama Noam Angel added a comment - uploadResultToALM(almDomain: 'SDN', almProject: 'alm_project_testing', almServerName: 'alm-server', almTestFolder: 'tempest ', almTestSetFolder: env.BRANCH_NAME + ' ' + (env.JOB_NAME - env.BRANCH_NAME - '/'), almTimeout: '', clientType: '', credentialsId: 'e28dfgdg1fb-fb6d-4e48-a480-4532gfdh', jenkinsServerUrl: JENKINS_URL, testingFramework: 'JUnit', testingResultFile: '**/junitResult.xml', testingTool: 'tempest')
          Hide
          roy_lu Roy Lu added a comment -

          Job name is uploaded to a field called 'jenkins-job-name'.

          Show
          roy_lu Roy Lu added a comment - Job name is uploaded to a field called 'jenkins-job-name'.
          Hide
          noama Noam Angel added a comment -

          please see full picture (scroll to right side), my branch is osp13 

           

          the issue is that JOB_NAME=JOB_NAME/BRANCH we get only the branch name in ALM without the actual job

          Show
          noama Noam Angel added a comment - please see full picture (scroll to right side), my branch is osp13    the issue is that JOB_NAME=JOB_NAME/BRANCH we get only the branch name in ALM without the actual job
          Hide
          roy_lu Roy Lu added a comment -

          Hi Noam,

          In the plugin, job name is fixed as the job's name. Can't be customized to other value. We set the job's name to the 'jenkins-job-name' field. So the value updated to this field is actually a fixed value.
          You said 'JOB_NAME=JOB_NAME/BRANCH'. Do you mean you changed job name during the pipeline script building?

          Show
          roy_lu Roy Lu added a comment - Hi Noam, In the plugin, job name is fixed as the job's name. Can't be customized to other value. We set the job's name to the 'jenkins-job-name' field. So the value updated to this field is actually a fixed value. You said 'JOB_NAME=JOB_NAME/BRANCH'. Do you mean you changed job name during the pipeline script building?
          Hide
          noama Noam Angel added a comment -

          in jenkins pipeline using a branched pipeline the name the value of JOB_NAME is equal "JOB_NAME/BRANCH_NAME" by default 

          i did not set it during pipeline run, I just mention it because i validated during the run the this is the actual value.

          the issue the 'jenkins-job-name' get trimmed JOB_NAME equal to only the BRANCH_NAME

          Show
          noama Noam Angel added a comment - in jenkins pipeline using a branched pipeline the name the value of JOB_NAME is equal "JOB_NAME/BRANCH_NAME" by default  i did not set it during pipeline run, I just mention it because i validated during the run the this is the actual value. the issue the 'jenkins-job-name' get trimmed JOB_NAME equal to only the BRANCH_NAME
          Hide
          roy_lu Roy Lu added a comment -

          Hi Noam Angel,

          As I tested, no matter you're using a pipeline job or a freestyle job, the 'jenkins-job-name' always takes job's name as the value. Unless you customized the name somehow in your pipeline script.
          There's no problem during the result uploading. As long as you set the job name as you wish, plugin will upload it. So, please check the script you set the job name. 

          Or could you please attach the whole script. 

          BTW, is your job name dynamic?

          Show
          roy_lu Roy Lu added a comment - Hi Noam Angel , As I tested, no matter you're using a pipeline job or a freestyle job, the 'jenkins-job-name' always takes job's name as the value. Unless you customized the name somehow in your pipeline script. There's no problem during the result uploading. As long as you set the job name as you wish, plugin will upload it. So, please check the script you set the job name.  Or could you please attach the whole script.  BTW, is your job name dynamic?
          Hide
          noama Noam Angel added a comment -

          i dont set JOB_NAME at all. for ex JOB_NAME="deploy_overcloud/master" what I will get in HP ALM is only "master"

          im using multibranch pipeline

          Show
          noama Noam Angel added a comment - i dont set JOB_NAME at all. for ex JOB_NAME="deploy_overcloud/master" what I will get in HP ALM is only "master" im using multibranch pipeline
          Hide
          roy_lu Roy Lu added a comment -

          Well. Do you mean you use the string "deploy_overcloud/master" as the job name but only get "master" in ALM?

          Show
          roy_lu Roy Lu added a comment - Well. Do you mean you use the string "deploy_overcloud/master" as the job name but only get "master" in ALM?
          Hide
          noama Noam Angel added a comment - - edited

          if you use the multibranch pipeline job type,  any job the you will create  will have a JOB_NAME combined from JOB_NAME and BRANCH, its set by the JOB itself not by me or by code in pipeline. somewhere in the way to uploadResultToALM -> HP ALM it gets trimmed. so yes i only get "master" which is not helpful

           

          Show
          noama Noam Angel added a comment - - edited if you use the multibranch pipeline job type,  any job the you will create  will have a JOB_NAME combined from JOB_NAME and BRANCH, its set by the JOB itself not by me or by code in pipeline. somewhere in the way to uploadResultToALM -> HP ALM it gets trimmed. so yes i only get "master" which is not helpful  
          Hide
          roy_lu Roy Lu added a comment -

          Could you please provide the console output of this job?

          Show
          roy_lu Roy Lu added a comment - Could you please provide the console output of this job?
          Hide
          noama Noam Angel added a comment -

           

           here is the console output 

          http://paste.openstack.org/show/753336/

           

          Show
          noama Noam Angel added a comment -    here is the console output  http://paste.openstack.org/show/753336/  
          Hide
          roy_lu Roy Lu added a comment -

          Were you using a multibranch pipeline job?

          Show
          roy_lu Roy Lu added a comment - Were you using a multibranch pipeline job?
          Hide
          noama Noam Angel added a comment -

          yes

          Show
          noama Noam Angel added a comment - yes
          Hide
          roy_lu Roy Lu added a comment -

          Well. It seems the multibranch pipeline job would make the job path one level more. 

          Usually it should be like:

          /var/lib/jenkins/jobs/featureset022/builds/14/junitResult.xml

          But your case is:

          /var/lib/jenkins/jobs/featureset022/branches/osp14/builds/14/junitResult.xml

          Build got it's parent's name as job name. But it got actually branch name in your case. I'm trying to find how to get actually name in a build.

          Show
          roy_lu Roy Lu added a comment - Well. It seems the multibranch pipeline job would make the job path one level more.  Usually it should be like: /var/lib/jenkins/jobs/featureset022/builds/14/junitResult.xml But your case is: /var/lib/jenkins/jobs/featureset022/branches/osp14/builds/14/junitResult.xml Build got it's parent's name as job name. But it got actually branch name in your case. I'm trying to find how to get actually name in a build.
          Show
          roy_lu Roy Lu added a comment - Looks like it's a common issue. https://issues.jenkins-ci.org/browse/JENKINS-44278 https://stackoverflow.com/questions/43639031/how-to-get-the-displayname-of-a-jenkins-multibranch-pipeline-job
          Hide
          rollin_lu Rollin added a comment -

          It's not an issue of the plugin. It will or already be fixed in Jenkins.

          Show
          rollin_lu Rollin added a comment - It's not an issue of the plugin. It will or already be fixed in Jenkins.

            People

            Assignee:
            roy_lu Roy Lu
            Reporter:
            noama Noam Angel
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: