Skip to content

Commit 5b55d7e

Browse files
sawenzelclaude
andcommitted
Run the AnalysisQC execution only for AnalysisQC changes
The announcement claimed MC/bin changes while the execution was gated on changed_analysis_qc, so the two disagreed. Making them agree the other way ran a full sim-reco-AOD-analysis chain, about 33 minutes and a GRID token, on every MC/bin pull request. Both now follow changed_analysis_qc, which is what the execution did before. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 73f585d commit 5b55d7e

1 file changed

Lines changed: 18 additions & 4 deletions

File tree

‎test/run_workflow_tests.sh‎

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,20 @@ get_git_repo_directory()
2626
}
2727

2828

29+
first_nonzero()
30+
{
31+
# Echo the first non-zero argument, or 0. Used instead of summing exit
32+
# codes: a sum can land on a multiple of 256 and exit 0 -- two phases
33+
# failing with 128 each would report success -- and it also loses which
34+
# phase failed.
35+
local code
36+
for code in "$@" ; do
37+
[[ "${code}" != "0" ]] && { echo "${code}" ; return ; }
38+
done
39+
echo 0
40+
}
41+
42+
2943
test_single_wf()
3044
{
3145
local wf_script=${1}
@@ -55,7 +69,7 @@ test_single_wf()
5569
# use -k|--keep-going feature to not stop after the first failure but see, if there are more
5670
[[ "${ret_this}" == "0" ]] && { ${O2DPG_ROOT}/MC/bin/o2_dpg_workflow_runner.py -f workflow.json --cpu-limit 8 --target-labels QC ${memlimit} -k >> ${LOG_FILE_WF} 2>&1 ; ret_this_qc=${?} ; }
5771
[[ "${ret_this}" == "0" ]] && { ${O2DPG_ROOT}/MC/bin/o2_dpg_workflow_runner.py -f workflow.json --cpu-limit 8 --target-labels Analysis ${memlimit} -k >> ${LOG_FILE_WF} 2>&1 ; ret_this_analysis=${?} ; }
58-
ret_this=$((ret_this + ret_this_qc + ret_this_analysis))
72+
ret_this=$(first_nonzero "${ret_this}" "${ret_this_qc}" "${ret_this_analysis}")
5973
[[ "${ret_this}" != "0" ]] && echo "[FATAL]: O2DPG_TEST Workflow execution failed" >> ${LOG_FILE_WF} || echo_green " -> PASSED"
6074
else
6175
echo_green " -> PASSED"
@@ -241,7 +255,7 @@ else
241255
[[ "${changed_workflows}" != "" ]] && echo " - The creation of simulation workflows from changed run scripts (sub-sect of MC/run/**/*.sh) will be tested."
242256
fi
243257

244-
if [[ "${changed_analysis_qc}" != "" || "${changed_sim_bin}" ]] ; then
258+
if [[ "${changed_analysis_qc}" != "" ]] ; then
245259
for p in $(find "MC/bin/tests" -name "*.sh") ; do
246260
execute_workflows+="$(realpath ${p}) "
247261
done
@@ -293,7 +307,7 @@ fi
293307
# prepare our local test directory for bin tests
294308
# global return code for PWGs
295309
ret_analysis_qc=0
296-
if [[ "${changed_analysis_qc}" != "" || "${changed_sim_bin}" != "" ]] ; then
310+
if [[ "${changed_analysis_qc}" != "" ]] ; then
297311
rm -rf ${TEST_PARENT_DIR_BIN} 2>/dev/null
298312
mkdir -p ${TEST_PARENT_DIR_BIN} 2>/dev/null
299313
pushd ${TEST_PARENT_DIR_BIN} > /dev/null
@@ -336,7 +350,7 @@ if [[ "${changed_anchored}" != "" ]] ; then
336350
popd > /dev/null
337351
fi
338352

339-
RET=$(( ret_global_pwg + ret_analysis_qc + ret_global_anchored ))
353+
RET=$(first_nonzero "${ret_global_pwg}" "${ret_analysis_qc}" "${ret_global_anchored}")
340354

341355
echo
342356
[[ "${RET}" != "0" ]] && echo_red "There were errors, please check!" || echo_green "All required workflow tests successful"

0 commit comments

Comments
 (0)