Merge "Build and run functest-benchmarking"
authorFatih Degirmenci <fdegir@gmail.com>
Mon, 3 Sep 2018 16:36:23 +0000 (16:36 +0000)
committerGerrit Code Review <gerrit@opnfv.org>
Mon, 3 Sep 2018 16:36:23 +0000 (16:36 +0000)
jjb/xci/xci-daily-jobs.yaml
jjb/xci/xci-run-functest.sh
jjb/xci/xci-set-scenario.sh

index bfc68e2..a67ff05 100644 (file)
@@ -99,6 +99,7 @@
     phase:
       - 'deploy'
       - 'functest'
+      - 'yardstick'
 
     # -------------------------------
     # jobs
               build-step-failure-threshold: 'never'
               failure-threshold: 'never'
               unstable-threshold: 'FAILURE'
+      - trigger-builds:
+          - project: 'xci-yardstick-{pod}-{distro}-daily-{stream}'
+            current-parameters: false
+            predefined-parameters: |
+              DEPLOY_SCENARIO=$DEPLOY_SCENARIO
+              INSTALLER_TYPE=$INSTALLER_TYPE
+              XCI_FLAVOR=$XCI_FLAVOR
+              CI_LOOP=$CI_LOOP
+              XCI_DISTRO=$XCI_DISTRO
+            same-node: true
+            block: true
+            block-thresholds:
+              build-step-failure-threshold: 'never'
+              failure-threshold: 'never'
+              unstable-threshold: 'FAILURE'
 
     publishers:
       # yamllint disable rule:line-length
 # --------------------------
 # builder macros
 # --------------------------
-# These need to be properly fixed once the basic deployment and functest
-# jobs are working outside of clean vm.
-# One of the ugly fixes is moving functest preparation step into the
-# deployment job itself since functest preparation requires some of the
+# These need to be properly fixed once the basic deployment, functest, and
+# yardstick jobs are working outside of clean vm.
+# One of the ugly fixes is moving test  preparation step into the
+# deployment job itself since test preparation requires some of the
 # things from deployment job. With clean VM, this wasn't an issue
 # since everything was on clean VM. When we move things out of clean
 # VM, things are done in workspaces of the jobs that are different.
 
           cd $WORKSPACE/xci && ./xci-deploy.sh
 
-          echo "Prepare OPNFV VM for Functest"
+          echo "Prepare OPNFV VM for Tests"
           echo "---------------------------------------------------------------------------------"
           export XCI_PATH=$WORKSPACE
           export XCI_VENV=${XCI_PATH}/venv
               echo $var
           done < ${XCI_PATH}/.cache/xci.env && cd ${XCI_PATH}/xci && \
           ansible-playbook -i playbooks/dynamic_inventory.py playbooks/prepare-tests.yml
-
-          echo "Run Functest"
+          ssh root@192.168.122.2 "/root/prepare-tests.sh"
           echo "---------------------------------------------------------------------------------"
 
 - builder:
           set -o pipefail
 
           ssh root@192.168.122.2 "/root/run-functest.sh"
+- builder:
+    name: 'xci-daily-yardstick-macro'
+    builders:
+      - shell: |
+          #!/bin/bash
+          set -o errexit
+          set -o pipefail
+
+          ssh root@192.168.122.2 "/root/run-yardstick.sh"
index 1e22c99..992194c 100755 (executable)
@@ -47,18 +47,22 @@ fi
 export XCI_PATH=/home/devuser/releng-xci
 export XCI_VENV=${XCI_PATH}/venv
 
-ssh -F $HOME/.ssh/${DISTRO}-xci-vm-config ${DISTRO}_xci_vm "source $XCI_VENV/bin/activate; while read var; do declare -x \"\${var}\" 2>/dev/null; done < ${XCI_PATH}/.cache/xci.env && cd releng-xci/xci && ansible-playbook -i playbooks/dynamic_inventory.py playbooks/prepare-tests.yml"
-echo "Running functest"
+ssh -F $HOME/.ssh/${DISTRO}-xci-vm-config ${DISTRO}_xci_vm "source $XCI_VENV/bin/activate; \
+    while read var; do declare -x \"\${var}\" 2>/dev/null; done < ${XCI_PATH}/.cache/xci.env && \
+    cd releng-xci/xci && ansible-playbook -i playbooks/dynamic_inventory.py playbooks/prepare-tests.yml"
+echo "Prepare OPNFV VM for Tests"
+ssh -F $HOME/.ssh/${DISTRO}-xci-vm-config ${DISTRO}_xci_vm_opnfv "/root/prepare-tests.sh"
+echo "Running Functest"
 ssh -F $HOME/.ssh/${DISTRO}-xci-vm-config ${DISTRO}_xci_vm_opnfv "/root/run-functest.sh"
 # Record exit code
 functest_exit=$?
 
 case ${DEPLOY_SCENARIO[0]} in
     os-*)
-        FUNCTEST_LOG=/root/results/functest.log
+        FUNCTEST_LOG=/root/functest-results/functest.log
         ;;
     k8-*)
-        FUNCTEST_LOG=/root/results/functest-kubernetes.log
+        FUNCTEST_LOG=/root/functest-results/functest-kubernetes.log
         ;;
     *)
         echo "Unable to determine the installer. Exiting!"
index 7bc45f1..59c1ebf 100755 (executable)
@@ -8,6 +8,7 @@
 # http://www.apache.org/licenses/LICENSE-2.0
 ##############################################################################
 set -o pipefail
+set -x
 
 #----------------------------------------------------------------------
 # This script is used by CI and executed by Jenkins jobs.
@@ -166,9 +167,10 @@ WORK_DIRECTORY=/tmp/$GERRIT_CHANGE_NUMBER/$DISTRO
 
 if [[ $GERRIT_PROJECT == "releng-xci" ]]; then
     determine_default_scenario
+else
+    determine_scenario
 fi
 override_scenario
-determine_scenario
 
 # ensure single scenario is impacted
     if [[ $(IFS=$'\n' echo ${DEPLOY_SCENARIO[@]} | wc -w) != 1 ]]; then