Merge "Report the result to TestAPI"
authorSerena Feng <feng.xiaowei@zte.com.cn>
Mon, 5 Mar 2018 07:12:35 +0000 (07:12 +0000)
committerGerrit Code Review <gerrit@opnfv.org>
Mon, 5 Mar 2018 07:12:35 +0000 (07:12 +0000)
13 files changed:
jjb/armband/armband-ci-jobs.yml
jjb/fuel/fuel-daily-jobs.yml
jjb/functest/functest-k8.sh
jjb/functest/functest-kubernetes-project-jobs.yml [new file with mode: 0644]
jjb/releng/opnfv-docker.sh
jjb/releng/opnfv-docker.yml
jjb/releng/testresults-automate.yml [moved from jjb/releng/automate.yml with 73% similarity]
jjb/releng/testresults-verify.yml [new file with mode: 0644]
jjb/xci/osa-periodic-jobs.yml
jjb/xci/xci-cleanup.sh
jjb/xci/xci-run-functest.sh
jjb/xci/xci-set-scenario.sh
jjb/xci/xci-start-new-vm.sh

index 767187d..339c3cc 100644 (file)
           condition-kind: and
           condition-operands:
             - condition-kind: regex-match
-              regex: '*-ha'
+              regex: '-ha$'
               label: '{scenario}'
             - condition-kind: day-of-week
               day-selector: select-days
           condition-kind: and
           condition-operands:
             - condition-kind: regex-match
-              regex: '*-ha'
+              regex: '-ha$'
               label: '{scenario}'
             - condition-kind: day-of-week
               day-selector: select-days
index 26f892d..a214a56 100644 (file)
           condition-kind: and
           condition-operands:
             - condition-kind: regex-match
-              regex: '*-ha'
+              regex: '-ha$'
               label: '{scenario}'
             - condition-kind: day-of-week
               day-selector: select-days
           condition-kind: and
           condition-operands:
             - condition-kind: regex-match
-              regex: '*-ha'
+              regex: '-ha$'
               label: '{scenario}'
             - condition-kind: day-of-week
               day-selector: select-days
index 7c5308d..3f08e4a 100755 (executable)
@@ -47,9 +47,10 @@ envs="-e INSTALLER_TYPE=${INSTALLER_TYPE} \
 DOCKER_TAG=`[[ ${BRANCH##*/} == "master" ]] && echo "latest" || echo ${BRANCH##*/}`
 
 FUNCTEST_IMAGE=opnfv/functest-kubernetes:${DOCKER_TAG}
+echo "Pulling Docker image ${FUNCTEST_IMAGE} ..."
 docker pull ${FUNCTEST_IMAGE}>/dev/null
 cmd_opt="run_tests -r -t all"
-cmd="docker run --rm --privileged=true ${volumes} ${FUNCTEST_IMAGE} /bin/bash -c '${cmd_opt}'"
+cmd="docker run --rm --privileged=true ${envs} ${volumes} ${FUNCTEST_IMAGE} /bin/bash -c '${cmd_opt}'"
 echo "Running Functest k8s test cases, CMD: ${cmd}"
 eval ${cmd}
 ret_value=$?
diff --git a/jjb/functest/functest-kubernetes-project-jobs.yml b/jjb/functest/functest-kubernetes-project-jobs.yml
new file mode 100644 (file)
index 0000000..3eba5d1
--- /dev/null
@@ -0,0 +1,257 @@
+---
+###################################################
+# All the jobs except verify have been removed!
+# They will only be enabled on request by projects!
+###################################################
+- project:
+    name: functest-kubernetes-project-jobs
+
+    project: 'functest-kubernetes'
+
+    jobs:
+      - 'functest-kubernetes-verify-{stream}'
+      - 'functest-kubernetes-verify-{phase}-{stream}'
+      - 'functest-kubernetes-docs-upload-{stream}'
+
+    stream:
+      - master:
+          branch: '{stream}'
+          gs-pathname: ''
+          disabled: false
+      - euphrates:
+          branch: 'stable/{stream}'
+          gs-pathname: '/{stream}'
+          disabled: false
+
+    phase:
+      - 'unit-tests-and-docs':
+          slave-label: 'opnfv-build-ubuntu'
+      - 'build-x86_64':
+          slave-label: 'opnfv-build-ubuntu'
+      - 'build-aarch64':
+          slave-label: 'opnfv-build-ubuntu-arm'
+
+- job-template:
+    name: 'functest-kubernetes-verify-{stream}'
+
+    disabled: '{obj:disabled}'
+
+    project-type: 'multijob'
+
+    parameters:
+      - project-parameter:
+          project: '{project}'
+          branch: '{branch}'
+      - 'opnfv-build-ubuntu-defaults'
+
+    scm:
+      - git-scm-gerrit
+
+    triggers:
+      - 'functest-kubernetes-verify-triggers-macro':
+          project: '{project}'
+          branch: '{branch}'
+
+    builders:
+      - shell: |
+          #!/bin/bash
+          # we do nothing here as the main stuff will be done
+          # in phase jobs
+          echo "Triggering phase jobs!"
+      - multijob:
+          name: 'functest-kubernetes-build-and-unittest'
+          execution-type: PARALLEL
+          projects:
+            - name: 'functest-kubernetes-verify-unit-tests-and-docs-{stream}'
+              current-parameters: false
+              predefined-parameters: |
+                GERRIT_BRANCH=$GERRIT_BRANCH
+                GERRIT_REFSPEC=$GERRIT_REFSPEC
+                GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
+                GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
+              git-revision: true
+              node-parameters: false
+              kill-phase-on: FAILURE
+              abort-all-job: false
+            - name: 'functest-kubernetes-verify-build-x86_64-{stream}'
+              current-parameters: false
+              predefined-parameters: |
+                GERRIT_BRANCH=$GERRIT_BRANCH
+                GERRIT_REFSPEC=$GERRIT_REFSPEC
+                GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
+                GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
+                ARCH=x86_64
+              git-revision: true
+              node-parameters: false
+              kill-phase-on: FAILURE
+              abort-all-job: false
+            - name: 'functest-kubernetes-verify-build-aarch64-{stream}'
+              current-parameters: false
+              predefined-parameters: |
+                GERRIT_BRANCH=$GERRIT_BRANCH
+                GERRIT_REFSPEC=$GERRIT_REFSPEC
+                GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
+                GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
+                ARCH=aarch64
+              git-revision: true
+              node-parameters: false
+              kill-phase-on: FAILURE
+              abort-all-job: false
+
+- job-template:
+    name: 'functest-kubernetes-verify-{phase}-{stream}'
+
+    disabled: '{obj:disabled}'
+
+    wrappers:
+      - ssh-agent-wrapper
+      - build-timeout:
+          timeout: 30
+
+    parameters:
+      - project-parameter:
+          project: '{project}'
+          branch: '{branch}'
+      - '{slave-label}-defaults'
+
+    scm:
+      - git-scm-gerrit
+
+    builders:
+      - 'functest-kubernetes-verify-{phase}-builders-macro'
+
+    publishers:
+      - 'functest-kubernetes-verify-{phase}-publishers-macro'
+
+- job-template:
+    name: 'functest-kubernetes-docs-upload-{stream}'
+
+    disabled: '{obj:disabled}'
+
+    parameters:
+      - project-parameter:
+          project: '{project}'
+          branch: '{branch}'
+      - 'opnfv-build-ubuntu-defaults'
+
+    scm:
+      - git-scm
+
+    triggers:
+      - 'functest-kubernetes-docs-upload-triggers-macro':
+          project: '{project}'
+          branch: '{branch}'
+
+    builders:
+      - functest-kubernetes-upload-doc-artifact
+
+################################
+# job triggers
+################################
+- trigger:
+    name: 'functest-kubernetes-verify-triggers-macro'
+    triggers:
+      - gerrit:
+          server-name: 'gerrit.opnfv.org'
+          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}'
+              disable-strict-forbidden-file-verification: 'true'
+              forbidden-file-paths:
+                - compare-type: ANT
+                  pattern: 'docs/**|.gitignore'
+
+- trigger:
+    name: 'functest-kubernetes-docs-upload-triggers-macro'
+    triggers:
+      - gerrit:
+          server-name: 'gerrit.opnfv.org'
+          trigger-on:
+            - change-merged-event
+            - comment-added-contains-event:
+                comment-contains-value: 'remerge'
+          projects:
+            - project-compare-type: 'ANT'
+              project-pattern: '{project}'
+              branches:
+                - branch-compare-type: 'ANT'
+                  branch-pattern: '**/{branch}'
+              disable-strict-forbidden-file-verification: 'true'
+              forbidden-file-paths:
+                - compare-type: ANT
+                  pattern: 'docs/**|.gitignore'
+################################
+# job builders
+################################
+
+- builder:
+    name: 'functest-kubernetes-verify-unit-tests-and-docs-builders-macro'
+    builders:
+      - shell: |
+          cd $WORKSPACE && tox
+
+- builder:
+    name: 'functest-kubernetes-verify-build-x86_64-builders-macro'
+    builders:
+      - shell: |
+          echo "Not activated!"
+
+- builder:
+    name: 'functest-kubernetes-verify-build-aarch64-builders-macro'
+    builders:
+      - shell: |
+          echo "Not activated!"
+
+- builder:
+    name: 'functest-kubernetes-upload-doc-artifact'
+    builders:
+      - shell: |
+          cd $WORKSPACE && tox -edocs
+            wget -O - https://git.opnfv.org/releng/plain/utils/upload-artifact.sh | bash -s "api/_build" "docs"
+################################
+# job publishers
+################################
+- publisher:
+    name: 'functest-kubernetes-verify-unit-tests-and-docs-publishers-macro'
+    publishers:
+      - junit:
+          results: nosetests.xml
+      - cobertura:
+          report-file: "coverage.xml"
+          only-stable: "true"
+          health-auto-update: "true"
+          stability-auto-update: "true"
+          zoom-coverage-chart: "true"
+          targets:
+            - files:
+                healthy: 10
+                unhealthy: 20
+                failing: 30
+            - method:
+                healthy: 50
+                unhealthy: 40
+                failing: 30
+      - email-jenkins-admins-on-failure
+
+- publisher:
+    name: 'functest-kubernetes-verify-build-x86_64-publishers-macro'
+    publishers:
+      - email-jenkins-admins-on-failure
+
+- publisher:
+    name: 'functest-kubernetes-verify-build-aarch64-publishers-macro'
+    publishers:
+      - email-jenkins-admins-on-failure
index 28e5b7c..5c8cafb 100644 (file)
@@ -111,7 +111,7 @@ fi
 echo "Building docker image: $DOCKER_REPO_NAME:$DOCKER_TAG"
 echo "--------------------------------------------------------"
 echo
-cmd="docker build --no-cache -t $DOCKER_REPO_NAME:$DOCKER_TAG --build-arg BRANCH=$BUILD_BRANCH
+cmd="docker build --pull=true --no-cache -t $DOCKER_REPO_NAME:$DOCKER_TAG --build-arg BRANCH=$BUILD_BRANCH
     $ARCH_BUILD_ARG
     -f $DOCKERFILE $DOCKER_PATH"
 
index 317efc8..93b9a9c 100644 (file)
           project: 'yardstick'
           <<: *euphrates
           <<: *other-receivers
+      - 'xtesting':
+          project: 'functest-xtesting'
+          <<: *master
+          <<: *other-receivers
       # projects with jobs for danube
       - 'dovetail':
           project: 'dovetail'
similarity index 73%
rename from jjb/releng/automate.yml
rename to jjb/releng/testresults-automate.yml
index 6bd952a..01fbe0c 100644 (file)
@@ -1,6 +1,6 @@
 ---
 - project:
-    name: utils-automate
+    name: testresults-automate
     stream:
       - master:
           branch: '{stream}'
@@ -17,7 +17,6 @@
     jobs:
       - '{module}-automate-{stream}'
       - '{module}-automate-{phase}-{stream}'
-      - '{module}-verify-{stream}'
 
     project: 'releng-testresults'
 
           notify-every-unstable-build: true
           send-to-individuals: true
 
-- job-template:
-    name: '{module}-verify-{stream}'
-
-    parameters:
-      - project-parameter:
-          project: '{project}'
-          branch: '{branch}'
-      - 'opnfv-build-ubuntu-defaults'
-
-    scm:
-      - git-scm-gerrit
-
-    triggers:
-      - gerrit:
-          server-name: 'gerrit.opnfv.org'
-          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: '{module}/**'
-
-    builders:
-      - shell: |
-          cd {module}/
-          tox
-          if [ -e *.xml ];then
-              cp *.xml $WORKSPACE
-          fi
-
-    publishers:
-      - publish-coverage
-      - email-jenkins-admins-on-failure
-
 - job-template:
     name: '{module}-automate-{stream}'
 
           fail: true
 
     triggers:
-      - gerrit:
-          server-name: 'gerrit.opnfv.org'
-          trigger-on:
-            - change-merged-event
-            - comment-added-contains-event:
-                comment-contains-value: 'remerge'
-          projects:
-            - project-compare-type: 'ANT'
-              project-pattern: '{project}'
-              branches:
-                - branch-compare-type: 'ANT'
-                  branch-pattern: '**/{branch}'
-              file-paths:
-                - compare-type: 'ANT'
-                  pattern: '{module}/**'
+      - gerrit-trigger-change-merged:
+          project: '**'
+          branch: '{branch}'
+          files: '{module}/**'
 
     builders:
       - description-setter:
diff --git a/jjb/releng/testresults-verify.yml b/jjb/releng/testresults-verify.yml
new file mode 100644 (file)
index 0000000..958833c
--- /dev/null
@@ -0,0 +1,78 @@
+---
+- project:
+    name: testresults-verify
+    stream:
+      - master:
+          branch: '{stream}'
+
+    module:
+      - 'testapi'
+      - 'reporting'
+
+    jobs:
+      - '{module}-verify-{stream}'
+      - '{module}-client-verify-{stream}'
+
+    project: 'releng-testresults'
+
+- job-template:
+    name: '{module}-verify-{stream}'
+
+    parameters:
+      - project-parameter:
+          project: '{project}'
+          branch: '{branch}'
+      - 'opnfv-build-ubuntu-defaults'
+
+    scm:
+      - git-scm-gerrit
+
+    triggers:
+      - gerrit-trigger-patchset-created:
+          server: 'gerrit.opnfv.org'
+          project: '**'
+          branch: '{branch}'
+          files: '{module}/**'
+
+    builders:
+      - shell: |
+          cd {module}/
+          tox
+          if [ -e *.xml ];then
+              cp *.xml $WORKSPACE
+          fi
+
+    publishers:
+      - publish-coverage
+      - email-jenkins-admins-on-failure
+
+- job-template:
+    name: '{module}-client-verify-{stream}'
+
+    parameters:
+      - project-parameter:
+          project: '{project}'
+          branch: '{branch}'
+      - 'opnfv-build-ubuntu-defaults'
+
+    scm:
+      - git-scm-gerrit
+
+    triggers:
+      - gerrit-trigger-patchset-created:
+          server: 'gerrit.opnfv.org'
+          project: '**'
+          branch: '{branch}'
+          files: '{module}/{module}-client/**'
+
+    builders:
+      - shell: |
+          cd {module}/{module}-client
+          tox
+          if [ -e *.xml ];then
+              cp *.xml $WORKSPACE
+          fi
+
+    publishers:
+      - publish-coverage
+      - email-jenkins-admins-on-failure
index cf4916b..6c2d165 100644 (file)
           export FUNCTEST_MODE=$FUNCTEST_MODE
           export FUNCTEST_SUITE_NAME=$FUNCTEST_SUITE_NAME
           export XCI_FLAVOR=$XCI_FLAVOR
+          export CORE_OPENSTACK_INSTALL=true
           export CLEAN_DIB_IMAGES=$CLEAN_DIB_IMAGES
           export OPNFV_RELENG_DEV_PATH=/home/devuser/releng-xci/
           export INSTALLER_TYPE=$INSTALLER_TYPE
       - shell: |
           #!/bin/bash
 
-          sudo virsh destroy ${DISTRO}_xci_vm
-          sudo virsh undefine ${DISTRO}_xci_vm
+          sudo virsh destroy ${DISTRO}_xci_vm || true
+          sudo virsh undefine ${DISTRO}_xci_vm || true
 
 # this will be enabled once the xci is prepared
 # - builder:
index 45b4ec2..ce84830 100755 (executable)
@@ -20,5 +20,5 @@ if [[ "$GERRIT_TOPIC" =~ 'skip-verify' ]]; then
     exit 0
 fi
 
-sudo virsh destroy ${DISTRO}_xci_vm
-sudo virsh undefine ${DISTRO}_xci_vm
+sudo virsh destroy ${DISTRO}_xci_vm || true
+sudo virsh undefine ${DISTRO}_xci_vm || true
index 238a833..9bcc469 100755 (executable)
@@ -42,3 +42,7 @@ fi
 ssh -F $HOME/.ssh/${DISTRO}-xci-vm-config ${DISTRO}_xci_vm "cd releng-xci/xci && PATH=/home/devuser/.local/bin:$PATH ansible-playbook -i installer/osa/files/$XCI_FLAVOR/inventory playbooks/prepare-functest.yml"
 echo "Running functest"
 ssh -F $HOME/.ssh/${DISTRO}-xci-vm-config ${DISTRO}_xci_vm_opnfv "/root/run-functest.sh"
+echo "Functest log"
+echo "---------------------------------------------------------------------------------"
+ssh -F $HOME/.ssh/${DISTRO}-xci-vm-config ${DISTRO}_xci_vm_opnfv "cat /root/results/functest.log"
+echo "---------------------------------------------------------------------------------"
index 59205e2..764857b 100755 (executable)
@@ -58,7 +58,7 @@ fi
 git clone https://gerrit.opnfv.org/gerrit/$GERRIT_PROJECT $WORK_DIRECTORY/$GERRIT_PROJECT
 cd $WORK_DIRECTORY/$GERRIT_PROJECT
 git fetch https://gerrit.opnfv.org/gerrit/$GERRIT_PROJECT $GERRIT_REFSPEC && git checkout FETCH_HEAD
-DEPLOY_SCENARIO=$(git diff HEAD^..HEAD --name-only | grep scenarios | sed -r 's/scenarios\/(.*?)\/.*/\1/' | uniq)
+DEPLOY_SCENARIO=$(git diff HEAD^..HEAD --name-only | grep scenarios | awk -F '[/|/]' '{print $2}' | uniq)
 
 # ensure single scenario is impacted
 if [[ $(echo $DEPLOY_SCENARIO | wc -w) != 1 ]]; then
index d676e26..d816a4f 100755 (executable)
@@ -53,6 +53,7 @@ export DEPLOY_SCENARIO=$DEPLOY_SCENARIO
 export FUNCTEST_MODE=$FUNCTEST_MODE
 export FUNCTEST_SUITE_NAME=$FUNCTEST_SUITE_NAME
 export XCI_FLAVOR=$XCI_FLAVOR
+export CORE_OPENSTACK_INSTALL=true
 export CLEAN_DIB_IMAGES=$CLEAN_DIB_IMAGES
 export OPNFV_RELENG_DEV_PATH=/home/devuser/releng-xci/
 export INSTALLER_TYPE=$INSTALLER_TYPE