From c2d3fba0aac08558aeabaa0a9b3df48c4aa60360 Mon Sep 17 00:00:00 2001 From: Andrew Mogan Date: Fri, 9 Oct 2026 11:35:12 -0500 Subject: [PATCH 1/4] Add option to exit non-zero on failure --- scripts/dunedaq_integtest_bundle.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/scripts/dunedaq_integtest_bundle.sh b/scripts/dunedaq_integtest_bundle.sh index 19a65d2..d31af82 100755 --- a/scripts/dunedaq_integtest_bundle.sh +++ b/scripts/dunedaq_integtest_bundle.sh @@ -29,6 +29,7 @@ Options: --list-only : list the tests that match the requested patterns without running them --verbosity : requested level of console messages, in range 1-6, where 1 is least, 6 is DRUNC debug --stop-on-failure : causes the script to stop when one of the integtests reports a failure + --raise-failure : causes the script to exit non-zero when one or more of the integtests reports a failure --tmpdir : specifies a root directory to use for test output, e.g. a directory instead of '/tmp' --concise-output : suppresses run control and DAQApp messages in order to focus on test results - this is equivalent to \"--verbosity 1\", and this option may be removed at some point in time @@ -150,7 +151,7 @@ CaptureOutput() { tee -a $1 } -GETOPT_TEMP=$(getopt -o hr:R:k:x:s:n:N: --long help,stop-on-failure,concise-output,include:,exclude:,test-suite:,tmpdir:,verbosity:,random-subset:,list-only,pytest-options:,log-retention-count:,log-retention-policy:,junit-xml -n "$0" -- "$@") +GETOPT_TEMP=$(getopt -o hr:R:k:x:s:n:N: --long help,stop-on-failure,raise-failure,concise-output,include:,exclude:,test-suite:,tmpdir:,verbosity:,random-subset:,list-only,pytest-options:,log-retention-count:,log-retention-policy:,junit-xml -n "$0" -- "$@") if [ $? -ne 0 ]; then usage exit 1 @@ -163,6 +164,7 @@ SUITE_DIR="${HERE}/test_suites" let individual_test_requested_iterations=1 let full_set_requested_interations=1 let stop_on_failure=0 +let raise_failure=0 requested_repo_list=() excluded_repo_names="" requested_test_names="" @@ -276,6 +278,10 @@ while true; do PYTEST_BASE_COMMAND+=(-x) # add the -x option to our pytest command to have it exit on first error shift ;; + --raise-failure) + let raise_failure=1 + shift + ;; --concise-output) PYTEST_OPTIONS+=(--integtest-verbosity 1) shift @@ -677,4 +683,10 @@ if [[ "${numad_grep_output}" != "" ]]; then echo "*** context switch can disrupt the stable running of the DAQ processes." | CaptureOutput ${ITGRUNNER_LOG_FILE} echo "********************************************************************************" | CaptureOutput ${ITGRUNNER_LOG_FILE} fi + +if [[ ${raise_failure} -gt 0 ]]; then + exit ${pytest_return_code} +fi + echo "" + From 82a9ce10debdf2b0ce244a94d5f546016c41a65f Mon Sep 17 00:00:00 2001 From: Andrew Mogan Date: Fri, 9 Oct 2026 11:44:52 -0500 Subject: [PATCH 2/4] Exit 1 for pytest failures --- scripts/dunedaq_integtest_bundle.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/dunedaq_integtest_bundle.sh b/scripts/dunedaq_integtest_bundle.sh index d31af82..85952e1 100755 --- a/scripts/dunedaq_integtest_bundle.sh +++ b/scripts/dunedaq_integtest_bundle.sh @@ -685,7 +685,7 @@ if [[ "${numad_grep_output}" != "" ]]; then fi if [[ ${raise_failure} -gt 0 ]]; then - exit ${pytest_return_code} + exit 1 fi echo "" From 2f75d523ba552290207768121e4b65ad54301c91 Mon Sep 17 00:00:00 2001 From: Andrew Mogan Date: Mon, 12 Oct 2026 15:29:25 -0500 Subject: [PATCH 3/4] Set exit_nonzero if pytest_return_code indicates failure --- scripts/dunedaq_integtest_bundle.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/dunedaq_integtest_bundle.sh b/scripts/dunedaq_integtest_bundle.sh index 85952e1..5278984 100755 --- a/scripts/dunedaq_integtest_bundle.sh +++ b/scripts/dunedaq_integtest_bundle.sh @@ -165,6 +165,7 @@ let individual_test_requested_iterations=1 let full_set_requested_interations=1 let stop_on_failure=0 let raise_failure=0 +exit_nonzero="" requested_repo_list=() excluded_repo_names="" requested_test_names="" @@ -576,6 +577,9 @@ while [[ ${full_set_loop_count} -lt ${full_set_requested_interations} ]]; do # This code makes use of a bread-crumb file that is created by the # integrationtest infrastructure. if [[ ${pytest_return_code} -ne 4 ]]; then + if [[ ${raise_failure} -eq 1 && -z "$exit_nonzero" ]]; then + exit_nonzero="true" + fi if [[ "`which jq 2>/dev/null`" != "" ]]; then current_pytest_rundir="" mapfile -t bundle_info_files < <(find "${pytest_user_dir}" -type f -name "bundle_script_info.json" -printf '%T@ %p\n' | grep -v 'failed-' | sort -nr | awk '{print $2}') @@ -684,7 +688,7 @@ if [[ "${numad_grep_output}" != "" ]]; then echo "********************************************************************************" | CaptureOutput ${ITGRUNNER_LOG_FILE} fi -if [[ ${raise_failure} -gt 0 ]]; then +if [[ ${raise_failure} -gt 0 && "${exit_nonzero}" == "true" ]]; then exit 1 fi From f40e5c2d54eb4f0df1d3c949ae3291546306d6d3 Mon Sep 17 00:00:00 2001 From: Andrew Mogan Date: Tue, 13 Oct 2026 13:30:25 -0500 Subject: [PATCH 4/4] Remove raise-failure argument --- scripts/dunedaq_integtest_bundle.sh | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/scripts/dunedaq_integtest_bundle.sh b/scripts/dunedaq_integtest_bundle.sh index 5278984..3681736 100755 --- a/scripts/dunedaq_integtest_bundle.sh +++ b/scripts/dunedaq_integtest_bundle.sh @@ -29,7 +29,6 @@ Options: --list-only : list the tests that match the requested patterns without running them --verbosity : requested level of console messages, in range 1-6, where 1 is least, 6 is DRUNC debug --stop-on-failure : causes the script to stop when one of the integtests reports a failure - --raise-failure : causes the script to exit non-zero when one or more of the integtests reports a failure --tmpdir : specifies a root directory to use for test output, e.g. a directory instead of '/tmp' --concise-output : suppresses run control and DAQApp messages in order to focus on test results - this is equivalent to \"--verbosity 1\", and this option may be removed at some point in time @@ -151,7 +150,7 @@ CaptureOutput() { tee -a $1 } -GETOPT_TEMP=$(getopt -o hr:R:k:x:s:n:N: --long help,stop-on-failure,raise-failure,concise-output,include:,exclude:,test-suite:,tmpdir:,verbosity:,random-subset:,list-only,pytest-options:,log-retention-count:,log-retention-policy:,junit-xml -n "$0" -- "$@") +GETOPT_TEMP=$(getopt -o hr:R:k:x:s:n:N: --long help,stop-on-failure,concise-output,include:,exclude:,test-suite:,tmpdir:,verbosity:,random-subset:,list-only,pytest-options:,log-retention-count:,log-retention-policy:,junit-xml -n "$0" -- "$@") if [ $? -ne 0 ]; then usage exit 1 @@ -164,7 +163,6 @@ SUITE_DIR="${HERE}/test_suites" let individual_test_requested_iterations=1 let full_set_requested_interations=1 let stop_on_failure=0 -let raise_failure=0 exit_nonzero="" requested_repo_list=() excluded_repo_names="" @@ -279,10 +277,6 @@ while true; do PYTEST_BASE_COMMAND+=(-x) # add the -x option to our pytest command to have it exit on first error shift ;; - --raise-failure) - let raise_failure=1 - shift - ;; --concise-output) PYTEST_OPTIONS+=(--integtest-verbosity 1) shift @@ -577,7 +571,7 @@ while [[ ${full_set_loop_count} -lt ${full_set_requested_interations} ]]; do # This code makes use of a bread-crumb file that is created by the # integrationtest infrastructure. if [[ ${pytest_return_code} -ne 4 ]]; then - if [[ ${raise_failure} -eq 1 && -z "$exit_nonzero" ]]; then + if [[ -z "$exit_nonzero" ]]; then exit_nonzero="true" fi if [[ "`which jq 2>/dev/null`" != "" ]]; then @@ -688,7 +682,7 @@ if [[ "${numad_grep_output}" != "" ]]; then echo "********************************************************************************" | CaptureOutput ${ITGRUNNER_LOG_FILE} fi -if [[ ${raise_failure} -gt 0 && "${exit_nonzero}" == "true" ]]; then +if [[ "${exit_nonzero}" == "true" ]]; then exit 1 fi