Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
914cf42
Detect and report invalid workflow list names
iarspider Jul 8, 2025
c618a0c
Fixes
iarspider Jul 9, 2025
ba0bfeb
Fixes
iarspider Jul 9, 2025
105af74
Check for invalid workflows when generating baseline and pretend we r…
iarspider Jul 14, 2025
e7c87e4
Check for bad workflows also when preparing baseline
iarspider Jul 15, 2025
731c5c4
Update _helper_functions.sh
iarspider Jul 21, 2025
09c4719
Update test_multiple_prs.sh
iarspider Jul 21, 2025
c2c63c0
Temporary commit: use correct bot branch to run baseline
iarspider Jul 21, 2025
9931446
Do not disable comparisons
iarspider Jul 22, 2025
1606455
Fix
iarspider Jul 22, 2025
4d93397
Protect from spaces in 1st arg of check_invalid_wf_lists
iarspider Jul 23, 2025
c9e6c0f
Do not overwrite WORKFLOWS env var
iarspider Jul 25, 2025
905a169
Try fix
iarspider Jul 25, 2025
e09dc37
Schedule comparison after merging all PRs
iarspider Jul 28, 2025
e3e3b68
Revert "Schedule comparison after merging all PRs"
iarspider Jul 28, 2025
66ed034
Changes from review
iarspider Jul 28, 2025
dea2214
Changes from review
iarspider Aug 1, 2025
385dc16
Changes from review
iarspider Aug 7, 2025
88d224d
Fix report filename
iarspider Aug 8, 2025
dd37cd0
Fix extraction of requested workflows
iarspider Aug 11, 2025
72c3c76
Update _helper_functions.sh
smuzaffar Aug 11, 2025
e4cc9ff
Update run-ib-pr-matrix.sh
smuzaffar Aug 11, 2025
e286fd3
Update run-ib-pr-matrix.sh
smuzaffar Aug 11, 2025
0b64bbe
pass all options to check_invalid_wf_lists otherwise it will not rec…
smuzaffar Aug 11, 2025
825ff8e
run check_invalid_wf_lists without --command options
smuzaffar Aug 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions pr_testing/_helper_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -196,3 +196,45 @@ function get_gpu_matrix_args() {
OPTS=$(PYTHONPATH=${PR_TESTING_DIR}/.. ${CMSBOT_PYTHON_CMD} -c 'from RelValArgs import GPU_RELVALS_FLAGS;print(GPU_RELVALS_FLAGS)')
echo ${OPTS}
}

function check_invalid_wf_lists () {
local CMD_OPTS="$1"
local WKFS=$(sed -n 's/.*-l \([^ ]*\).*/\1/p' <<< "$1")
local DUMP_BADLIST=${2:-true}
local WFLISTS_CNT WFS_CNT BADLIST_CNT

rm -f "$WORKSPACE/bad-workflow-lists.txt"

# Count workflow lists vs numeric workflows
WFLISTS_CNT=$(echo "$WKFS" | tr ',' '\n' | grep -Ev "^[1-9][0-9]*(\.[0-9]+)?$" | wc -l)
WFS_CNT=$(echo "$WKFS" | tr ',' '\n' | wc -l)

# Capture both output and exit code of runTheMatrix.py
local RUN_OUTPUT
if ! RUN_OUTPUT=$(runTheMatrix.py ${CMD_OPTS} -n 2>&1); then
echo "ERROR : runTheMatrix returned non-zero exit code"
return 1
fi

# Extract bad workflow lists directly from the output
if (( WFLISTS_CNT > 0 )); then
local BADLIST=$(grep "is not a possible selected entry" <<< "$RUN_OUTPUT" | awk '{print $1}')
BADLIST_CNT=$(echo $BADLIST | wc -w)
if (( BADLIST_CNT > 0 )); then
if [[ "$DUMP_BADLIST" == "true" ]]; then
echo " - $(echo $BADLIST | tr ' ' ',')"
fi
if (( WFLISTS_CNT != WFS_CNT )); then
echo "WARNING : some workflow lists were not recognized"
else
if (( BADLIST_CNT == WFS_CNT )); then
echo "ERROR : all workflow lists were not recognized, and no additional workflows were requested"
return 1
else
echo "WARNING : none of the workflow lists were recognized, only running explicitly requested workflows"
fi
fi
fi
fi
return 0
}
6 changes: 6 additions & 0 deletions pr_testing/run-pr-relvals.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ else
echo "no errors in the RelVals!!"
echo "MATRIX${UC_TEST_FLAVOR}_TESTS;OK,Matrix ${UC_TEST_FLAVOR} Tests Outputs,See Logs,runTheMatrix${UC_TEST_FLAVOR}-results" >> ${RESULTS_DIR}/$(get_status_file_name relval "$TEST_FLAVOR")

if [[ -s "$WORKSPACE/bad-workflow-lists.txt" ]]; then
echo "### Invalid workflow lists" > ${RESULTS_DIR}/0a-bad-workflows-report.res
echo "The following workflow names were not recognized and not ran:" >> ${RESULTS_DIR}/0a-bad-workflows-report.res
cat "$WORKSPACE/bad-workflow-lists.txt" >> ${RESULTS_DIR}/0a-bad-workflows-report.res
fi

if $DO_COMPARISON ; then
echo "COMPARISON${UC_TEST_FLAVOR};QUEUED,Comparison ${UC_TEST_FLAVOR} with the baseline,See results,See results" >> ${RESULTS_DIR}/comparison${UC_TEST_FLAVOR}.txt
TRIGGER_COMPARISON_FILE=$WORKSPACE/'comparison.properties'
Expand Down
2 changes: 2 additions & 0 deletions pr_testing/test_multiple_prs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,8 @@ if $DO_COMPARISON ; then
echo "TEST_FLAVOR=" >> run-baseline-${BUILD_ID}-01.default
echo "REAL_ARCH=${RELVAL_REAL_ARCH}" >> run-baseline-${BUILD_ID}-01.default
echo "PRODUCTION_RELEASE=true" >> run-baseline-${BUILD_ID}-01.default
# -- REMOVE NEXT LINE BEFORE MERGING --
echo "CMS_BOT_BRANCH=run-ib-pr-matrix-list" >> run-baseline-${BUILD_ID}-01.default
WF_LIST=$(get_pr_baseline_worklflow)
[ "${WF_LIST}" = "" ] || WF_LIST="-l ${WF_LIST}"
echo "WORKFLOWS=-s ${WF_LIST}" >> run-baseline-${BUILD_ID}-01.default
Expand Down
19 changes: 16 additions & 3 deletions run-ib-pr-matrix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,18 @@ if [ "${CHECK_WORKFLOWS}" = "true" ] ; then
ALL_WFS=$(runTheMatrix.py -n ${OPTS} ${MATRIX_ARGS} | grep -v ' workflows ' | grep '^[1-9][0-9]*\(.[0-9][0-9]*\|\)\s' | sed 's| .*||' | tr '\n' ',' | sed 's|,$||')
WORKFLOWS=$(echo "${WORKFLOWS}" | sed "s|all|${ALL_WFS}|")
fi
runTheMatrix.py -n ${OPTS} ${MATRIX_ARGS} ${WORKFLOWS} | grep -v ' workflows ' | grep '^[1-9][0-9]*\(.[0-9][0-9]*\|\)\s' | sed 's| .*||' > $WORKSPACE/req.wfs
rm -f $WORKSPACE/req.wfs
if ! check_invalid_wf_lists "${OPTS} ${MATRIX_ARGS} ${WORKFLOWS}" false ; then
touch $WORKSPACE/req.wfs
else
runTheMatrix.py -n ${OPTS} ${MATRIX_ARGS} ${WORKFLOWS} | grep -v ' workflows ' | grep '^[1-9][0-9]*\(.[0-9][0-9]*\|\)\s' | sed 's| .*||' > $WORKSPACE/req.wfs
fi
for wf in $(cat $WORKSPACE/req.wfs) ; do
[ $(echo " $REL_WFS " | grep " $wf " | wc -l) -eq 0 ] || continue
WFS="${wf},${WFS}"
[ $(echo " $REL_WFS " | grep " $wf " | wc -l) -eq 0 ] || continue
WFS="${wf},${WFS}"
done
WFS=$(echo ${WFS} | sed 's|,$||')

if [ "${WFS}" = "" ] ; then
mv ${WORKSPACE}/workflows-${BUILD_ID}.log ${WORKSPACE}/workflows-${BUILD_ID}.done
send_jenkins_artifacts ${WORKSPACE}/workflows-${BUILD_ID}.done ${ARTIFACT_DIR}/workflows-${BUILD_ID}.done
Expand Down Expand Up @@ -74,10 +80,17 @@ pushd "$WORKSPACE/matrix-results"
else
CMD_OPTS="${CMD_OPTS} ${EXTRA_MATRIX_COMMAND_ARGS}"
fi

# Check what workflows will be ran (without any --command option)
if ! check_invalid_wf_lists "${MATRIX_ARGS}" ; then
exit 1
fi

[ "${CMD_OPTS}" != "" ] && MATRIX_ARGS="${MATRIX_ARGS} --command ' ${CMD_OPTS}'"
if [ "X$CMS_SITE_OVERRIDE" == "X" ]; then
CMS_SITE_OVERRIDE="local"
fi

eval CMS_PATH=/cvmfs/cms-ib.cern.ch SITECONFIG_PATH=/cvmfs/cms-ib.cern.ch/SITECONF/$CMS_SITE_OVERRIDE runTheMatrix.py -j ${NJOBS} ${MATRIX_ARGS} 2>&1 | tee -a matrixTests.${BUILD_ID}.log
mv runall-report-step123-.log runall-report-step123-.${BUILD_ID}.log
find . -name DQM*.root | sort | sed 's|^./||' > wf_mapping.${BUILD_ID}.txt
Expand Down