Add triggers to verify Functest 45/65345/2
authorCédric Ollivier <cedric.ollivier@orange.com>
Thu, 22 Nov 2018 22:15:51 +0000 (23:15 +0100)
committerCédric Ollivier <cedric.ollivier@orange.com>
Thu, 22 Nov 2018 22:19:54 +0000 (23:19 +0100)
It runs testcases for all new patchset.

Change-Id: Ida99e2f40cf3a7a6bc002e81cee27eb67ea62ff0
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
jjb/functest/functest-virtual.yaml

index c383d7c..43eb2fb 100644 (file)
@@ -3,9 +3,12 @@
     name: 'functest-defaultparameters'
     repo: opnfv
     tag:
     name: 'functest-defaultparameters'
     repo: opnfv
     tag:
-      - gambia
-      - hunter
-      - latest
+      - gambia:
+          branch: stable/gambia
+      - hunter:
+          branch: stable/hunter
+      - master:
+          branch: master
 
 - job-template:
     name: '{repo}-functest-{container}-{tag}-pull'
 
 - job-template:
     name: '{repo}-functest-{container}-{tag}-pull'
       - name: '{repo}-functest-vnf-{tag}-pull'
       - name: '{repo}-functest-features-{tag}-pull'
 
       - name: '{repo}-functest-vnf-{tag}-pull'
       - name: '{repo}-functest-features-{tag}-pull'
 
-- functest-buildparameters: &functest-buildparameters
-    name: 'functest-buildparameters'
-    parameters:
-      - functest-virtual-defaults
-      - string:
-          name: branch
-          default: master
-
 - job-template:
     name: '{repo}-functest-{container}-{test}-{tag}-run'
     parameters:
 - job-template:
     name: '{repo}-functest-{container}-{test}-{tag}-run'
     parameters:
     test:
       - tempest_full
       - tempest_scenario
     test:
       - tempest_full
       - tempest_scenario
+      - rally_full
     jobs:
       - '{repo}-functest-{container}-{test}-{tag}-run'
 
     jobs:
       - '{repo}-functest-{container}-{test}-{tag}-run'
 
     projects:
       - name: '{repo}-functest-components-tempest_full-{tag}-run'
       - name: '{repo}-functest-components-tempest_scenario-{tag}-run'
     projects:
       - name: '{repo}-functest-components-tempest_full-{tag}-run'
       - name: '{repo}-functest-components-tempest_scenario-{tag}-run'
+      # - name: '{repo}-functest-components-rally_full-{tag}-run'
 
 - project:
     name: repo-functest-vnf-{test}-{tag}-run
 
 - project:
     name: repo-functest-vnf-{test}-{tag}-run
     jobs:
       - '{repo}-functest-{tag}-daily'
 
     jobs:
       - '{repo}-functest-{tag}-daily'
 
-- scm:
-    name: functest-gerrit
-    scm:
-      - git:
-          url: https://gerrit.opnfv.org/gerrit/functest
-          refspec: '+refs/changes/*:refs/changes/*'
-          branches:
-            - ${branch}
+- functest-buildparameters: &functest-buildparameters
+    name: 'functest-buildparameters'
+    parameters:
+      - functest-virtual-defaults
+      - string:
+          name: BRANCH
+          default: '{branch}'
 
 - job-template:
     name: '{repo}-functest-{container}-{tag}-build'
     <<: *functest-buildparameters
     scm:
 
 - job-template:
     name: '{repo}-functest-{container}-{tag}-build'
     <<: *functest-buildparameters
     scm:
-      - functest-gerrit
+      - git:
+          url: https://gerrit.opnfv.org/gerrit/functest
+          refspec: '+refs/changes/*:refs/changes/*'
+          branches:
+            - $GERRIT_REFSPEC
     builders:
       - shell: |
           case "{container}" in
           "components")
               args="" ;;
           *)
     builders:
       - shell: |
           case "{container}" in
           "components")
               args="" ;;
           *)
-              args="--build-arg BRANCH=${{branch}}" ;;
+              args="--build-arg BRANCH=$GERRIT_REFSPEC" ;;
           esac
           esac
-          cd docker/$(echo {container} |cut -d\- -f 2)
+          cd docker/{container}
           sudo docker build \
             ${{args}} --pull=false --no-cache --force-rm=true \
             -t {repo}/functest-{container}:{tag} .
           sudo docker build \
             ${{args}} --pull=false --no-cache --force-rm=true \
             -t {repo}/functest-{container}:{tag} .
     name: '{repo}-functest-{tag}-gate'
     project-type: multijob
     <<: *functest-buildparameters
     name: '{repo}-functest-{tag}-gate'
     project-type: multijob
     <<: *functest-buildparameters
+    triggers:
+      - gerrit-trigger-patchset-created:
+          project: 'functest'
+          branch: '{branch}'
+          files: '**'
     builders:
       - multijob:
           name: build functest-core
     builders:
       - multijob:
           name: build functest-core
       - multijob:
           name: components
           <<: *functest-componentsjobs
       - multijob:
           name: components
           <<: *functest-componentsjobs
-      - multijob:
-          name: vnf
-          <<: *functest-vnfjobs
+      - multijob:
+          name: vnf
+          <<: *functest-vnfjobs
       - multijob:
           name: features
           <<: *functest-featuresjobs
       - multijob:
           name: features
           <<: *functest-featuresjobs