Merge "Apex: fix log uploading"
authorTim Rozet <trozet@redhat.com>
Fri, 6 Apr 2018 15:05:37 +0000 (15:05 +0000)
committerGerrit Code Review <gerrit@opnfv.org>
Fri, 6 Apr 2018 15:05:37 +0000 (15:05 +0000)
jjb/xci/xci-run-functest.sh
jjb/xci/xci-set-scenario.sh

index aa98e07..78b7d44 100755 (executable)
@@ -55,12 +55,10 @@ export XCI_VENV=/home/devuser/releng-xci/venv
 ssh -F $HOME/.ssh/${DISTRO}-xci-vm-config ${DISTRO}_xci_vm "source $XCI_VENV/bin/activate; cd releng-xci/xci && 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"
+# Record exit code
+functest_exit=$?
 echo "Functest log"
 echo "---------------------------------------------------------------------------------"
 ssh -F $HOME/.ssh/${DISTRO}-xci-vm-config ${DISTRO}_xci_vm_opnfv "cat /root/results/functest.log"
 echo "---------------------------------------------------------------------------------"
-# check the log to see if we have any error
-if ssh -F $HOME/.ssh/${DISTRO}-xci-vm-config ${DISTRO}_xci_vm_opnfv "grep -q 'FAIL' /root/results/functest.log"; then
-    echo "Error: Functest failed!"
-    exit 1
-fi
+exit ${functest_exit}
index c3012cd..3e64ab1 100755 (executable)
@@ -96,22 +96,22 @@ function determine_generic_scenario() {
 
     # get the changeset
     cd $WORKSPACE
-    CHANGESET=$(git diff HEAD^..HEAD --name-only)
-    for CHANGED_FILE in $CHANGESET; do
+    SCENARIOS=$(git diff HEAD^..HEAD --name-only -- 'xci/scenarios' | cut -d "/" -f 3 | uniq)
+    # We need to set default scenario for changes that do not mess with scenarios
+    NO_SCENARIOS=$(git diff HEAD^..HEAD --name-only | grep -v 'xci/scenarios' | cut -d "/" -f 3 | uniq)
+    for CHANGED_SCENARIO in $SCENARIOS; do
+        [[ ${DEPLOY_SCENARIO[@]} =~ $CHANGED_SCENARIO ]] || DEPLOY_SCENARIO[${#DEPLOY_SCENARIO[@]}]=$CHANGED_SCENARIO
+    done
+    for CHANGED_FILE in $NO_SCENARIOS; do
         case $CHANGED_FILE in
-            *k8-nosdn*|*kubespray*)
+            kubespray)
                 [[ ${DEPLOY_SCENARIO[@]} =~ "k8-nosdn-nofeature" ]] || DEPLOY_SCENARIO[${#DEPLOY_SCENARIO[@]}]='k8-nosdn-nofeature'
                 ;;
-            *os-odl*)
-                [[ ${DEPLOY_SCENARIO[@]} =~ "os-odl-nofeature" ]] || DEPLOY_SCENARIO[${#DEPLOY_SCENARIO[@]}]='os-odl-nofeature'
-                ;;
-            *os-nosdn*|*osa*)
-                [[ ${DEPLOY_SCENARIO[@]} =~ "os-nosdn-nofeature" ]] || DEPLOY_SCENARIO[${#DEPLOY_SCENARIO[@]}]='os-nosdn-nofeature'
-                ;;
+            # Default case (including OSA changes)
             *)
                 [[ ${DEPLOY_SCENARIO[@]} =~ "os-nosdn-nofeature" ]] || DEPLOY_SCENARIO[${#DEPLOY_SCENARIO[@]}]='os-nosdn-nofeature'
                 ;;
-            esac
+        esac
     done
 
     # extract releng-xci sha