Skip to content
Snippets Groups Projects
Commit 991e8df15029 authored by Vincent Hatakeyama's avatar Vincent Hatakeyama
Browse files

:pencil: highlight critical errors and also fail on them

parent 202d6f106952
No related branches found
No related tags found
No related merge requests found
......@@ -37,6 +37,6 @@
fi
logfile=$(tempfile --suffix=.log)
# Catch both stdout & stderr here as Odoo 10 uses stderr, unlike previous Odoo versions.
$here/start $update -d $dbname $db_user_param --test-enable $loglevel --max-cron=0 --stop-after-init $* 2>&1 | tee $logfile | sed -e 's/\(.*\) \(INFO\) \(.*\)/\o033[2m\1\o033[22m \o033[32m\o033[7m\2\o033[27m \3\o033[39m/' -e 's/\(.*\) \(DEBUG\) \(.*\)/\1 \o033[33m\o033[7m\2\o033[27m \2\o033[39m/' -e 's/\(.*\) \(WARNING\) \(.*\)/\o033[2m\1\o033[22m \o033[33m\o033[7m\2\o033[27m \3\o033[39m/' -e 's/\(.*\) \(ERROR\) \(.*\)/\1 \o033[31m\o033[7m\2\o033[27m \3\o033[0m/' -e 's/\(.*\) \(TEST\) \(.*\)/\1 \o033[34m\o033[7m\2\o033[27m \3 \o033[0m/' -e 's/ FAILED/ \o033[41m\o033[97m\o033[1mFAILED\o033[0m/' -e 's/ FAIL\(.*\)/ \o033[41m\o033[97m\o033[1mFAIL\o033[49m\o033[31m\1\o033[0m/'
$here/start $update -d $dbname $db_user_param --test-enable $loglevel --max-cron=0 --stop-after-init $* 2>&1 | tee $logfile | sed -e 's/\(.*\) \(INFO\) \(.*\)/\o033[2m\1\o033[22m \o033[32m\o033[7m\2\o033[27m \3\o033[39m/' -e 's/\(.*\) \(DEBUG\) \(.*\)/\1 \o033[33m\o033[7m\2\o033[27m \2\o033[39m/' -e 's/\(.*\) \(WARNING\) \(.*\)/\o033[2m\1\o033[22m \o033[33m\o033[7m\2\o033[27m \3\o033[39m/' -e 's/\(.*\) \(ERROR\) \(.*\)/\1 \o033[31m\o033[7m\2\o033[27m \3\o033[0m/' -e 's/\(.*\) \(TEST\) \(.*\)/\1 \o033[34m\o033[7m\2\o033[27m \3 \o033[0m/' -e 's/ FAILED/ \o033[41m\o033[97m\o033[1mFAILED\o033[0m/' -e 's/ FAIL\(.*\)/ \o033[41m\o033[97m\o033[1mFAIL\o033[49m\o033[31m\1\o033[0m/' -e 's/\(.*\) \(CRITICAL\) \(.*\)/\o033[2m\1\o033[22m \o033[33m\o033[7m\2\o033[27m \3\o033[39m/'
ok=$(grep ' OK' $logfile -c)
# TODO detect yaml tests failures
......@@ -41,6 +41,6 @@
ok=$(grep ' OK' $logfile -c)
# TODO detect yaml tests failures
failed=$(grep ' FAILED' $logfile -c)
failed=$(grep ' FAILED| CRITICAL' $logfile -c)
if [[ $failed -eq 0 ]];
then
# simple way to detect yaml failure
......@@ -64,7 +64,7 @@
echo -e '\033[31mFAILED\033[0m:'
# Highlight the failure matches in red (31).
GREP_COLOR='0;31' grep --color=always "FAILED\|FAIL:" $logfile
GREP_COLOR='0;31' grep --color=always "CRITICAL\|FAILED\|FAIL:" $logfile
GREP_COLOR='0;31' grep --color=always "ERROR [^ ]* openerp\.tools\.yaml_import:" $logfile
fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment