diff --git a/compareTriggerResults.py b/compareTriggerResults.py index 8d142c624622..fb3926d9b91c 100755 --- a/compareTriggerResults.py +++ b/compareTriggerResults.py @@ -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 @@ -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) @@ -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 diff --git a/compareTriggerResultsSummary.py b/compareTriggerResultsSummary.py index 248206744cbd..11d8063e655b 100755 --- a/compareTriggerResultsSummary.py +++ b/compareTriggerResultsSummary.py @@ -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) @@ -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 diff --git a/pr_testing/run-pr-comparisons b/pr_testing/run-pr-comparisons index 6430532d140b..b038b7f975ee 100755 --- a/pr_testing/run-pr-comparisons +++ b/pr_testing/run-pr-comparisons @@ -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 @@ -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