Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 6 additions & 3 deletions compareTriggerResults.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
"""
Script to compare the content of edm::TriggerResults collections in EDM files across multiple workflows
- CMSSW dependencies: edmDumpEventContent, hltDiff
Expand All @@ -20,14 +20,14 @@ def WARNING(message):


def get_output(cmds, permissive=False):
prc = subprocess.Popen(cmds, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
prc = subprocess.Popen(cmds, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True)
out, err = prc.communicate()
if (not permissive) and prc.returncode:
KILL(
"get_output -- shell command failed (execute command to reproduce the error):\n"
+ " " * 14
+ "> "
+ cmd
+ " ".join(cmds)
)
return (out, err)

Expand Down Expand Up @@ -153,6 +153,9 @@ def compareTriggerResults(**kwargs):
WARNING(
"compareTriggerResults -- found zero inputs to be compared (no outputs produced)"
)
print(
"SUMMARY TriggerResults: WARNING - found zero edm::TriggerResults collections to compare (no outputs produced)"
)
return -1

# hltDiff calls
Expand Down
5 changes: 4 additions & 1 deletion compareTriggerResultsSummary.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
"""
Script to summarise the outputs of compareTriggerResults
(i.e. the outputs of hltDiff in .json format)
Expand Down Expand Up @@ -76,6 +76,9 @@ def compareTriggerResultsSummary(**kwargs):
WARNING(
"compareTriggerResultsSummary -- found zero inputs to be compared (no outputs produced)"
)
print(
"SUMMARY TriggerResults: WARNING - found zero valid hltDiff JSON outputs to summarise (no outputs produced)"
)
return -1

# hltDiff calls
Expand Down
4 changes: 2 additions & 2 deletions pr_testing/run-pr-comparisons
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ if [ "X$RUN_TR_COMP" = Xtrue ]; then
wait_dqm_comp 0.5
WF_DIR=`echo ${WF} | cut -d "/" -f1`
echo "Running: edm::TriggerResults ${WF_DIR}"
(${CMS_BOT_DIR}/compareTriggerResults.py -r ${WORKSPACE}/data/${COMPARISON_RELEASE} -t ${WORKSPACE}/data/PR-${PR_NUM} \
(${CMSBOT_PYTHON_CMD} ${CMS_BOT_DIR}/compareTriggerResults.py -r ${WORKSPACE}/data/${COMPARISON_RELEASE} -t ${WORKSPACE}/data/PR-${PR_NUM} \
-f "*/${WF_DIR}/step*.root" -o ${WORKSPACE}/upload/triggerResults > ${WORKSPACE}/upload/triggerResults/${WF_DIR}.log 2>&1 || true) &
done
fi
Expand Down Expand Up @@ -562,7 +562,7 @@ wait || true

if [ "X$RUN_TR_COMP" = Xtrue ]; then
echo "[`date`] Done comparisons of edm::TriggerResults"
${CMS_BOT_DIR}/compareTriggerResultsSummary.py -i ${WORKSPACE}/upload/triggerResults -f "*/*.json" -o ${WORKSPACE}/upload/triggerResults/index.html -F html > ${WORKSPACE}/upload/triggerResults.log 2>&1 || true
${CMSBOT_PYTHON_CMD} ${CMS_BOT_DIR}/compareTriggerResultsSummary.py -i ${WORKSPACE}/upload/triggerResults -f "*/*.json" -o ${WORKSPACE}/upload/triggerResults/index.html -F html > ${WORKSPACE}/upload/triggerResults.log 2>&1 || true
echo "[`date`] Summary of TriggerResults comparisons saved in ${WORKSPACE}/upload/triggerResults.log"
echo "HLT_TRIGGER_COMPARISON${TEST_FLAVOR_STR};OK,HLT Trigger ${UC_TEST_FLAVOR} comparison,See results,/SDT/jenkins-artifacts/${COMP_UPLOAD_DIR}/triggerResults/" >> ${RESULTS_FILE}
if [ -f ${JR_COMP_DIR}/qaResultsSummary.log ]; then
Expand Down
Loading