aboutsummaryrefslogtreecommitdiffstats
path: root/checker/test.sh
diff options
context:
space:
mode:
authorLouis Burda <quent.burda@gmail.com>2021-06-21 23:03:28 +0200
committerLouis Burda <quent.burda@gmail.com>2021-06-21 23:05:31 +0200
commitbd9012bacf074663d5ac0e0566cddfc07f7cf053 (patch)
treeb6cda802e657de7ae6761b190f93eefc75f93203 /checker/test.sh
parentd0f796f1b8f6ef06bd41498638003d13b1c7072e (diff)
downloadenowars5-service-stldoctor-bd9012bacf074663d5ac0e0566cddfc07f7cf053.tar.gz
enowars5-service-stldoctor-bd9012bacf074663d5ac0e0566cddfc07f7cf053.zip
improve checker test logging from fails
Diffstat (limited to 'checker/test.sh')
-rw-r--r--checker/test.sh22
1 files changed, 15 insertions, 7 deletions
diff --git a/checker/test.sh b/checker/test.sh
index f3ac90f..9b2d08e 100644
--- a/checker/test.sh
+++ b/checker/test.sh
@@ -33,23 +33,31 @@ try() {
else
variant=$2
fi
+ taskid=$$
if [ ! -z "$REMOTE" ]; then
python3 enoreq.py -j True -A http://localhost:9091 -a $REMOTE \
- --flag ENOTESTFLAG123= --flag_regex 'ENO.*=' \
+ --flag ENOTESTFLAG123= --flag_regex 'ENO.*=' -i $taskid \
-v "$variant" -x 4000 ${@:3} "$cmd" > "$tmpfile"
+ res="$(cat $tmpfile | splitmsg | head -n1)"
else
python3 src/checker.py -j run -v "$variant" -x 4000 \
- --flag ENOTESTFLAG123= --flag_regex 'ENO.*=' \
+ --flag ENOTESTFLAG123= --flag_regex 'ENO.*=' -i $taskid \
${@:3} "$cmd" > "$tmpfile"
+ res="$(cat $tmpfile | grep -a Result: | tail -n1 | grep -a -o OK)"
fi
- res="$(cat $tmpfile | splitmsg | head -n1)"
if [ "$res" != "OK" ]; then
newfile="fails/err-$(ls fails | wc -l)"
- (echo "METHOD $@"; cat "$tmpfile") > "$newfile"
- echo "[ $(date '+%T %F') ] ERROR >>>> $newfile"
- cat "$tmpfile"
+ (
+ echo "METHOD $@"
+ cat "$tmpfile"
+ if [ ! -z "$REMOTE" -a -e "$ENOLOGMESSAGE_PARSER" ]; then
+ docker-compose logs --tail=400 | grep '"taskId": '$taskid | $ENOLOGMESSAGE_PARSER
+ fi
+ ) > "$newfile"
+ echo -ne "Executing $cmd with variant $variant.. $res ($newfile)\n"
+ else
+ echo -ne "Executing $cmd with variant $variant.. $res\n"
fi
- echo -ne "Executing $cmd with variant $variant.. $res\n"
}
try-all() {