add doctor-functest verify job 09/19709/18
authorRyota MIBU <r-mibu@cq.jp.nec.com>
Mon, 29 Aug 2016 04:50:11 +0000 (13:50 +0900)
committerRyota MIBU <r-mibu@cq.jp.nec.com>
Fri, 9 Sep 2016 03:22:49 +0000 (12:22 +0900)
This patch adds a new jenkins job which will be executed every time
doctor patch is uploaded. The code will be verified by executing
doctor scenario on the specific pod using functest.

JIRA: DOCTOR-70
Change-Id: I480cd905991ccb1ef7426187fe83cbf1ae798ce9
Signed-off-by: Ryota MIBU <r-mibu@cq.jp.nec.com>
jjb/doctor/doctor.yml
jjb/functest/functest-ci-jobs.yml
jjb/functest/set-functest-env.sh
jjb/opnfv/slave-params.yml

index 3b407ef..ead6c00 100644 (file)
@@ -3,19 +3,30 @@
 
     project: '{name}'
 
-    jobs:
-        - 'doctor-verify-{stream}'
-
     stream:
         - master:
             branch: '{stream}'
             gs-pathname: ''
+            docker_tag: 'master'
             disabled: false
         - colorado:
             branch: 'stable/{stream}'
             gs-pathname: '/{stream}'
+            docker_tag: 'stable'
             disabled: false
 
+    installer:
+        - apex:
+            slave-label: 'ool-virtual1'
+
+    inspector:
+        - sample
+        - congress
+
+    jobs:
+        - 'doctor-verify-{stream}'
+        - 'doctor-verify-{installer}-{inspector}-{stream}'
+
 - job-template:
     name: 'doctor-verify-{stream}'
 
 
     builders:
         - shell: "[ -e tests/run.sh ] && bash -n ./tests/run.sh"
+
+- job-template:
+    name: 'doctor-verify-{installer}-{inspector}-{stream}'
+
+    parameters:
+        - project-parameter:
+            project: '{project}'
+        - gerrit-parameter:
+            branch: '{branch}'
+        - string:
+            name: INSPECTOR_TYPE
+            default: '{inspector}'
+            description: 'Doctor inspector type to be used'
+        - string:
+            name: INSTALLER_TYPE
+            default: apex
+            description: 'OPNFV Installer type'
+        - string:
+            name: OS_CREDS
+            default: /home/jenkins/openstack.creds
+            description: 'OpenStack credentials'
+        - '{installer}-defaults'
+        - '{slave-label}-defaults'
+        - 'functest-suite-parameter'
+        - string:
+            name: DEPLOY_SCENARIO
+            default: 'os-odl_l2-nofeature-ha'
+        - string:
+            name: DOCKER_TAG
+            default: '{docker_tag}'
+            description: 'Tag to pull docker image'
+        - functest-parameter:
+            gs-pathname: '{gs-pathname}'
+
+    scm:
+        - gerrit-trigger-scm:
+            credentials-id: '{ssh-credentials}'
+            refspec: '$GERRIT_REFSPEC'
+            choosing-strategy: 'gerrit'
+
+    triggers:
+        - gerrit:
+            trigger-on:
+                - patchset-created-event:
+                    exclude-drafts: 'false'
+                    exclude-trivial-rebase: 'false'
+                    exclude-no-code-change: 'false'
+                - draft-published-event
+                - comment-added-contains-event:
+                    comment-contains-value: 'recheck'
+                - comment-added-contains-event:
+                    comment-contains-value: 'reverify'
+            projects:
+              - project-compare-type: 'ANT'
+                project-pattern: '{project}'
+                branches:
+                  - branch-compare-type: 'ANT'
+                    branch-pattern: '**/{branch}'
+                file-paths:
+                  - compare-type: ANT
+                    pattern: 'tests/**'
+
+    builders:
+        - 'functest-suite-builder':
+            TESTCASE_OPTIONS: '-e INSPECTOR_TYPE=$INSPECTOR_TYPE -v $WORKSPACE:$HOME/opnfv/repos/doctor'
index 0f0caba..7120790 100644 (file)
                 - 'vims'
                 - 'multisite'
                 - 'parser'
+        - string:
+            name: TESTCASE_OPTIONS
+            default: ''
+            description: 'Addtional parameters specific to test case(s)'
 - parameter:
     name: functest-parameter
     parameters:
index b7d745a..1c77702 100755 (executable)
@@ -59,7 +59,9 @@ test -f ${HOME}/opnfv/functest/custom/params_${DOCKER_TAG} && custom_params=$(ca
 echo "Functest: Pulling image opnfv/functest:${DOCKER_TAG}"
 docker pull opnfv/functest:$DOCKER_TAG >/dev/null
 
-cmd="sudo docker run --privileged=true -id ${envs} ${labconfig} ${sshkey} ${res_volume} ${custom_params} ${stackrc} opnfv/functest:${DOCKER_TAG} /bin/bash"
+cmd="sudo docker run --privileged=true -id ${envs} ${labconfig} ${sshkey} \
+     ${res_volume} ${custom_params} ${stackrc} ${TESTCASE_OPTIONS} \
+     opnfv/functest:${DOCKER_TAG} /bin/bash"
 echo "Functest: Running docker run command: ${cmd}"
 ${cmd} >${redirect}
 sleep 5
index c7ec6aa..442c4f7 100644 (file)
             name: GIT_BASE
             default: https://gerrit.opnfv.org/gerrit/$PROJECT
             description: 'Git URL to use on this Jenkins Slave'
+- parameter:
+    name: 'ool-virtual1-defaults'
+    parameters:
+        - node:
+            name: SLAVE_NAME
+            description: 'Slave name on Jenkins'
+            allowed-slaves:
+                - ool-virtual1
+            default-slaves:
+                - ool-virtual1
+        - string:
+            name: GIT_BASE
+            default: https://gerrit.opnfv.org/gerrit/$PROJECT
+            description: 'Git URL to use on this Jenkins Slave'
+        - string:
+            name: SSH_KEY
+            default: /root/.ssh/id_rsa
+            description: 'SSH key to be used'
 #####################################################
 # These slaves are just dummy slaves for sandbox jobs
 #####################################################