diff --git a/pr_testing/run-pr-hlt-p2-timing.sh b/pr_testing/run-pr-hlt-p2-timing.sh index cfbc9d71947..17651321654 100755 --- a/pr_testing/run-pr-hlt-p2-timing.sh +++ b/pr_testing/run-pr-hlt-p2-timing.sh @@ -23,9 +23,35 @@ popd # Upload results source $WORKSPACE/cms-bot/jenkins-artifacts touch ${RESULTS_DIR}/11-hlt-p2-timing-report.res ${RESULTS_DIR}/11-hlt-p2-timing-failed.res -if [ -f $WORKSPACE/rundir/Phase2Timing_resources.json ] ; then + +required_files=( + "$WORKSPACE/rundir/Phase2Timing_resources.json" +) + +if [ "$CMSSW_VERSION_NUMBER" -ge 1501 ]; then + required_files+=( + "$WORKSPACE/rundir/Phase2Timing_resources_NGT.json" + ) +fi + +if [ "$CMSSW_VERSION_NUMBER" -ge 1600 ]; then + required_files+=( + "$WORKSPACE/rundir/Phase2Timing_resources_OnCPU.json" + ) +fi + +missing=0 +for f in "${required_files[@]}"; do + if [ ! -f "$f" ]; then + echo "ERROR: Missing required file: $f" >> ${WORKSPACE}/hlt-p2-timing.log + missing=1 + fi +done + +if [ $missing -eq 0 ]; then CHART_URL="https://cmssdt.cern.ch/circles/web/piechart.php?data_name=hlt-p2-timing&resource=time_thread&filter=${CMSSW_VERSION}&dataset=${UPLOAD_PATH}/Phase2Timing_resources" echo "HLT_P2_TIMING;SUCCESS,HLT Phase 2 timing Test,See Chart,${CHART_URL}" >> ${RESULTS_DIR}/hlt-p2-timing.txt + echo "HLT_P2_TIMING_LOG;OK,HLT Phase 2 timing Test Log,See Logs,hlt-p2-timing.log" >> ${RESULTS_DIR}/hlt-p2-timing.txt echo -e "**HLT P2 Timing**: [chart](${CHART_URL})" > ${RESULTS_DIR}/11-hlt-p2-timing-report.res mv $WORKSPACE/rundir/Phase2Timing*.json $WORKSPACE/json_upload diff --git a/pr_testing/setup-pr-test-env.sh b/pr_testing/setup-pr-test-env.sh index 4338a06f9a1..0285de0c7ce 100644 --- a/pr_testing/setup-pr-test-env.sh +++ b/pr_testing/setup-pr-test-env.sh @@ -2,6 +2,17 @@ SCRIPTPATH="$( cd "$(dirname "$0")" ; /bin/pwd -P )" # Absolute path to script CMS_BOT_DIR=$(dirname ${SCRIPTPATH}) # To get CMS_BOT dir path PR_TESTING_DIR=${CMS_BOT_DIR}/pr_testing COMMON=${CMS_BOT_DIR}/common + +CMSSW_VERSION_NUMBER=$CMSSW_VERSION +[ "${CMSSW_VERSION_NUMBER}" != "" ] || CMSSW_VERSION_NUMBER=${RELEASE_FORMAT} +CMSSW_MAJOR=0 +CMSSW_MINOR=0 +if [ "${CMSSW_VERSION_NUMBER}" != "" ] ; then + CMSSW_MAJOR=$(echo ${CMSSW_VERSION_NUMBER} | cut -d_ -f2) + CMSSW_MINOR=$(echo ${CMSSW_VERSION_NUMBER} | cut -d_ -f3) +fi +export CMSSW_VERSION_NUMBER=$(echo x0${CMSSW_MAJOR}x0${CMSSW_MINOR} | sed -r -e 's|x[0]*([0-9][0-9])|\1|g;s|^0||') + if [ "$WORKSPACE" = "" ] ; then export WORKSPACE=$(/bin/pwd -P) ; fi source ${CMS_BOT_DIR}/cmsrep.sh source ${PR_TESTING_DIR}/_helper_functions.sh