Add functest return status in Alpines 79/42479/4
authorMorgan Richomme <morgan.richomme@orange.com>
Wed, 20 Sep 2017 07:15:42 +0000 (09:15 +0200)
committerMorgan Richomme <morgan.richomme@orange.com>
Wed, 20 Sep 2017 07:33:20 +0000 (09:33 +0200)
So far we had 2 approaches:

 * return Functest CI status: can be OK even if tests are FAIL
 * return Functest Test status: can be FAIL even if all Functest tests are OK
 (Fail in onboaraded tests)

A 3rd way is possible thanks to [1].
We consider only Functest status and Functest tests for the return statement

the return will be FAIL only if

 * error in the framework
 * error in Functest Tests

So concretely, if promise, Doctor can be FAIL, if Functest tests are OK, the
return will be PASS

[1]: https://gerrit.opnfv.org/gerrit/#/c/42245/

Change-Id: I6c7fbe99d888e43700ddb2dfc9bfd6cc9bfbaed6
Signed-off-by: Morgan Richomme <morgan.richomme@orange.com>
jjb/functest/functest-alpine.sh
jjb/functest/functest-daily-jobs.yml

index 81aee0d..c948430 100755 (executable)
@@ -86,6 +86,8 @@ else
 fi
 
 cmd_opt='prepare_env start && run_tests -r -t all'
+ret_val_file="${HOME}/opnfv/functest/results/${BRANCH##*/}/return_value"
+echo 0 > ${ret_val_file}
 
 for tier in ${tiers[@]}; do
     FUNCTEST_IMAGE=opnfv/functest-${tier}
@@ -94,4 +96,8 @@ for tier in ${tiers[@]}; do
     cmd="docker run --privileged=true ${envs} ${volumes} ${FUNCTEST_IMAGE} /bin/bash -c '${cmd_opt}'"
     echo "Running Functest tier '${tier}'. CMD: ${cmd}"
     eval ${cmd}
+    ret_value=$?
+    if [ ${ret_value} != 0 ]; then
+      echo ${ret_value} > ${ret_val_file}
+    fi
 done
index 0d504f3..ea39de4 100644 (file)
         - 'functest-cleanup'
         - 'functest-daily'
         - 'functest-store-results'
+        - 'functest-exit'
 
 - builder:
     name: functest-arm-daily-builder