diff --git a/scripts/in_container/check_junitxml_result.py b/scripts/in_container/check_junitxml_result.py index eecb401e698..e35d840a2ac 100755 --- a/scripts/in_container/check_junitxml_result.py +++ b/scripts/in_container/check_junitxml_result.py @@ -30,7 +30,7 @@ if __name__ == "__main__": with open(fname) as fh: root = ET.parse(fh) testsuite = root.find(".//testsuite") - if testsuite: + if testsuite is not None: num_failures = testsuite.get("failures") num_errors = testsuite.get("errors") if num_failures == "0" and num_errors == "0": diff --git a/scripts/in_container/run_ci_tests.sh b/scripts/in_container/run_ci_tests.sh index 77f5e69abb7..d49f49aecc5 100755 --- a/scripts/in_container/run_ci_tests.sh +++ b/scripts/in_container/run_ci_tests.sh @@ -28,6 +28,18 @@ set +e export PYTHONFAULTHANDLER="1" export PYTHONUNBUFFERED="1" +# Breeze passes the JUnit XML path only as a pytest argument. +RESULT_LOG_FILE="" +for arg in "${@}"; do + if [[ ${arg} == --junitxml=* ]]; then + RESULT_LOG_FILE="${arg#--junitxml=}" + fi +done +# A report left by an earlier run would let a segfault pass the check below. +if [[ -n ${RESULT_LOG_FILE} ]]; then + rm -f "${RESULT_LOG_FILE}" +fi + pytest "${@}" RES=$?