Skip to content

Commit f01b4f2

Browse files
committed
Check expected failures based on new parameter
By adding new parameter Expected Failures List in the test operator, we will be able to decide which tests should not have an impact on the job's pass/fail. This patch introduces a way to check if the failing tests are expected to fail and in that case the failing result will be non-voting.
1 parent 641ee0e commit f01b4f2

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

container-images/tcib/base/os/tempest/run_tempest.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ fi
110110
[[ -z ${TEMPEST_WORKFLOW_STEP_DIR_NAME} ]] && TEMPEST_WORKFLOW_STEP_DIR_NAME="tempest"
111111
[[ ! -z ${USE_EXTERNAL_FILES} ]] && TEMPEST_PATH=$HOMEDIR/external_files/
112112

113+
TEMPEST_LOGS_DIR=${TEMPEST_PATH}${TEMPEST_WORKFLOW_STEP_DIR_NAME}/
114+
113115
[[ ${TEMPESTCONF_CREATE:=true} == true ]] && TEMPESTCONF_ARGS+="--create "
114116
[[ ${TEMPESTCONF_INSECURE} == true ]] && TEMPESTCONF_ARGS+="--insecure "
115117
[[ ${TEMPESTCONF_COLLECT_TIMING} == true ]] && TEMPESTCONF_ARGS+="--collect-timing "
@@ -420,9 +422,11 @@ function generate_test_results {
420422
cat ${TEMPEST_INCLUDE_LIST}
421423
fi
422424

423-
TEMPEST_LOGS_DIR=${TEMPEST_PATH}${TEMPEST_WORKFLOW_STEP_DIR_NAME}/
424425
mkdir -p ${TEMPEST_LOGS_DIR}
425426

427+
echo "Generate file containing failing tests"
428+
stestr failing --list | sed 's/\[.*\]//g' > ${TEMPEST_LOGS_DIR}stestr_failing.txt
429+
426430
echo "Generate subunit, then xml and html results"
427431
stestr last --subunit > ${TEMPEST_LOGS_DIR}testrepository.subunit \
428432
&& (subunit2junitxml ${TEMPEST_LOGS_DIR}testrepository.subunit > ${TEMPEST_LOGS_DIR}tempest_results.xml || true) \
@@ -479,4 +483,12 @@ if [ ${TEMPEST_DEBUG_MODE} == true ]; then
479483
sleep infinity
480484
fi
481485

486+
if [ ! -z ${TEMPEST_EXPECTED_FAILURES_LIST} ]; then
487+
echo "Failing tests marked as expected failures"
488+
grep -Fxf ${TEMPEST_EXPECTED_FAILURES_LIST} ${TEMPEST_LOGS_DIR}stestr_failing.txt
489+
if ! grep -Fxv -q -f ${TEMPEST_EXPECTED_FAILURES_LIST} ${TEMPEST_LOGS_DIR}stestr_failing.txt ; then
490+
RETURN_VALUE=0
491+
fi
492+
fi
493+
482494
exit ${RETURN_VALUE}

0 commit comments

Comments
 (0)