Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:17:07

0001 #! /bin/bash
0002 
0003 function log() {
0004   echo -e "$@"
0005 }
0006 
0007 function err() {
0008   echo -e "$@" 1>&2
0009 }
0010 
0011 touch issues.txt
0012 
0013 # check if the menu as a whole was run
0014 if ! [ -f "hlt.done" ]; then
0015   err "ERROR: Execution of the full HLT menu failed.\nPlease check the contents of 'hlt.log' for details."
0016   cat >> issues.txt <<EOF
0017 hlt
0018 EOF
0019   exit 1
0020 fi
0021 
0022 # extract list of triggers
0023 if ! [ -f "paths.txt" ]; then
0024   err "ERROR: File \"paths.txt\" does not exist (must contain the list of paths used in the integration tests)."
0025   cat >> issues.txt <<EOF
0026 paths.txt
0027 EOF
0028   exit 1
0029 fi
0030 
0031 TRIGGERS=$(cat paths.txt)
0032 
0033 # compare the results of running each path by itself with those from the full menu
0034 STATUS=0
0035 for TRIGGER in $TRIGGERS; do
0036   if ! [ -f ${TRIGGER}.done ]; then
0037     err "ERROR: Execution of the trigger $TRIGGER failed.\nPlease check the contents of '$TRIGGER.log' for details."
0038     STATUS=1
0039     cat >> issues.txt <<EOF
0040 hlt
0041 $TRIGGER
0042 EOF
0043     continue
0044   fi
0045   RESULT=$(cat "hlt.log"      | awk "/TrigReport ---------- Modules in Path: $TRIGGER ------------/"'{ while ($1 == "TrigReport") { print; getline; } }' | sed -e's|TrigReport     1 ....|TrigReport     1 xxxx|')
0046   SINGLE=$(cat "$TRIGGER.log" | awk "/TrigReport ---------- Modules in Path: $TRIGGER ------------/"'{ while ($1 == "TrigReport") { print; getline; } }' | sed -e's|TrigReport     1 ....|TrigReport     1 xxxx|')
0047   if [ "$RESULT" != "$SINGLE" ]; then
0048     err "ERROR: Inconsistencies found comparing the result of the trigger $TRIGGER run as part of the whole menu, or standalone.\nPlease compare the contents of 'hlt.log' and '$TRIGGER.log' for details."
0049     STATUS=1
0050     cat >> issues.txt <<EOF
0051 hlt
0052 $TRIGGER
0053 EOF
0054   fi
0055   read VISIT PASS LAST <<< $(echo "$RESULT" | tail -n1 | awk '{ print $4, $5, $8; }')
0056   if (( PASS == 0 )); then
0057     if [ "$LAST" != "hltBoolFalse" ]; then
0058       log "WARNING: path $TRIGGER did not accept any events"
0059     elif (( VISIT == 0 )); then
0060       log "WARNING: path $TRIGGER was not fully exercised"
0061     fi
0062   fi
0063 done
0064 
0065 exit $STATUS