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

:ambulance: fix module sed

parent 3d05f856951c
No related branches found
No related tags found
1 merge request!87🚑 fix module sed
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
export PRE_ODOO_BIN="python3-coverage run --omit=__manifest__.py --source=$project_home " export PRE_ODOO_BIN="python3-coverage run --omit=__manifest__.py --source=$project_home "
fi fi
# colorize also remove database name and thread number # colorize also remove database name and thread number
alias colorize="sed -e 's/^\(\w*-..-.. ..:..:..,\w*\) \w*/\o033[2m\1\o033[22m/' -e 's/ INFO \w* \(odoo\.\(tests\.runner\|modules\.module\): \)\(.*\)/ \o033[32m\o033[7mINFO\o033[0m \1\o033[34m\3\o033[0m/' -e 's/ ERROR \w* \(odoo\.\(tests\.runner\|modules.module\): \)\(.*\)/ \o033[31m\o033[7mERROR\o033[0m \1\o033[34m\3\o033[0m/' -e 's/ \(INFO\) \(\w*\|?\) \([a-zA-Z._-0-9]*\):\(.*\)/ \o033[32m\o033[7m\1\o033[0m \3:\o033[32m\4\o033[39m/' -e 's/ \(DEBUG\) \w* \([a-zA-Z\._-0-9]*\):\(.*\)/ \o033[33m\o033[7m\1\o033[0m \2:\o033[33m\3\o033[39m/' -e 's/ \(WARNING\) \w* \([a-zA-Z._-0-9]*\):\(.*\)/ \o033[33m\o033[7m\1\o033[0m \2:\o033[33m\3\o033[0m/' -e 's/ \(ERROR\) \w* \([a-zA-Z\._-0-9]*\):\(.*\)/ \o033[31m\o033[7m\1\o033[0m \2:\o033[31m\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\) \w* \([a-zA-Z\._-0-9]*\):\(.*\)/ \o033[33m\o033[7m\1\o033[0m \2:\o033[33m\3\o033[39m/' -e 's/ \(TEST\) \w* \(.*\) \(ERROR\)\(.*\)/ \o033[34m\o033[7m\1\o033[27m \2\o033[0m \o033[41m\o033[97m\o033[1m\3\o033[49m\o033[0m/' -e 's/ \(TEST\) \w* \(.*\) \(OK\)/ \o033[34m\o033[7m\1\o033[27m \2\o033[0m \o033[32m\o033[7m\3\o033[27m\o033[39m/' -e 's/ \(TEST\) \w* \([a-zA-Z\._-0-9]*\):\(.*\)/ \o033[34m\o033[7m\1\o033[0m \2:\o033[34m\3\o033[0m/'" alias colorize="sed -e 's/^\(\w*-..-.. ..:..:..,\w*\) \w*/\o033[2m\1\o033[22m/' -e 's/ INFO \w* \(odoo\.\(tests\.runner\|modules\.module\): \)\(.*\)/ \o033[32m\o033[7mINFO\o033[0m \1\o033[34m\3\o033[0m/' -e 's/ ERROR \w* \(odoo\.\(tests\.runner\|modules.module\): \)\(.*\)/ \o033[31m\o033[7mERROR\o033[0m \1\o033[34m\3\o033[0m/' -e 's/ \(INFO\) \(\w*\|?\) \([a-zA-Z0-9._-]*\):\(.*\)/ \o033[32m\o033[7m\1\o033[0m \3:\o033[32m\4\o033[39m/' -e 's/ \(DEBUG\) \w* \([a-zA-Z0-9._-]*\):\(.*\)/ \o033[33m\o033[7m\1\o033[0m \2:\o033[33m\3\o033[39m/' -e 's/ \(WARNING\) \w* \([a-zA-Z0-9._-]*\):\(.*\)/ \o033[33m\o033[7m\1\o033[0m \2:\o033[33m\3\o033[0m/' -e 's/ \(ERROR\) \w* \([a-zA-Z0-9._-]*\):\(.*\)/ \o033[31m\o033[7m\1\o033[0m \2:\o033[31m\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\) \w* \([a-zA-Z0-9._-]*\):\(.*\)/ \o033[33m\o033[7m\1\o033[0m \2:\o033[33m\3\o033[39m/' -e 's/ \(TEST\) \w* \(.*\) \(ERROR\)\(.*\)/ \o033[34m\o033[7m\1\o033[27m \2\o033[0m \o033[41m\o033[97m\o033[1m\3\o033[49m\o033[0m/' -e 's/ \(TEST\) \w* \(.*\) \(OK\)/ \o033[34m\o033[7m\1\o033[27m \2\o033[0m \o033[32m\o033[7m\3\o033[27m\o033[39m/' -e 's/ \(TEST\) \w* \([a-zA-Z0-9._-]*\):\(.*\)/ \o033[34m\o033[7m\1\o033[0m \2:\o033[34m\3\o033[0m/'"
# Catch both stdout & stderr here as Odoo 10 uses stderr, unlike previous Odoo versions. # 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 | colorize $here/start $update -d $dbname $db_user_param --test-enable $loglevel --max-cron=0 --stop-after-init $* 2>&1 | tee $logfile | colorize
start_status=$pipestatus[1] start_status=$pipestatus[1]
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
else else
# Valid with odoo 7, 11, 13 # Valid with odoo 7, 11, 13
tests_ran=$(grep -P 'o(penerp|doo).(modules.module|[^ ]+): Ran \K([[:digit:]]+)' $logfile -o | perl -ne '$sum += $_ } { print $sum') tests_ran=$(grep -P 'o(penerp|doo).(modules.module|[^ ]+): Ran \K([[:digit:]]+)' $logfile -o | perl -ne '$sum += $_ } { print $sum')
tests_failures=$(grep -P 'o(penerp|doo).(modules.module|[^ ]+): Module [a-z0-9_]+: \K([[:digit:]]+)' $logfile -o | perl -ne '$sum += $_ } { print $sum') tests_failures=$(grep -P 'o(penerp|doo).(modules.module|[^ ]+): Module [a-zA-Z0-9._-]+: \K([[:digit:]]+)' $logfile -o | perl -ne '$sum += $_ } { print $sum')
# that might be doable in the perl above # that might be doable in the perl above
if [ -z "$tests_failures" ]; if [ -z "$tests_failures" ];
then then
......
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