Skip to content

Commit

Permalink
check return value directly for pass/fail (cms-sw#171)
Browse files Browse the repository at this point in the history
directly check return value of jobs instead of parsing log files for keywords
  • Loading branch information
bi-ran committed Jan 24, 2019
1 parent b279a91 commit 316c405
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions HeavyIonsAnalysis/JetAnalysis/test/tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,23 +84,25 @@ mkdir logs

echo -e "\n running configs...\n"

children=()
for c in ${configs[@]}; do
cmsRun test_$c &> logs/test_${c%.*}.log &
children+=("$!")
done

wait
sleep 1
for c in "${!children[@]}"; do
config=${configs[$c]}

# check logs for errors
for c in ${configs[@]}; do
error=$(grep -i "Fatal\|Segmentation" logs/test_${c%.*}.log)
if [ -z "$error" ]; then
echo -e "\E[32mOK: $c\E[0m"
wait ${children[$c]}
retc=$?

if [ $retc -eq 0 ]; then
echo -e "\E[32mPASS: $config\E[0m"
else
fail=1
mkdir -p fail
echo -e "\E[31mFAIL: $c\E[0m"
mv test_$c logs/test_${c%.*}.log fail/
echo -e "\E[31mFAIL: $config\E[0m"
mv test_$config logs/test_${config%.*}.log fail/
fi
done

Expand Down

0 comments on commit 316c405

Please sign in to comment.