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

:sparkles: run coverage when running tests in odoo 11

parent 079d461b727f
No related branches found
No related tags found
No related merge requests found
......@@ -42,6 +42,10 @@
fi
logfile=$(tempfile --suffix=.log)
# Catch both stdout & stderr here as Odoo 10 uses stderr, unlike previous Odoo versions.
if [ "$ODOO_TYPE" = "odoo11" ];
then
export PRE_ODOO_BIN="python3-coverage run --source=$project_home "
fi
$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\) \(.*\)/\o033[2m\1\o033[22m \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\) \(.*\)/\o033[2m\1\o033[22m \o033[31m\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/' -e 's/\(.*\) \(TEST\) \(.*\) \(ERROR\)\(.*\)/\o033[2m\1\o033[22m \o033[34m\o033[7m\2\o033[27m \3\o033[0m \o033[41m\o033[97m\o033[1m\4\o033[49m\o033[31m\5\o033[0m/' -e 's/\(.*\) \(TEST\) \(.*\) \(OK\)/\o033[2m\1\o033[22m \o033[34m\o033[7m\2\o033[27m \3\o033[0m \o033[32m\o033[7m\4\o033[27m\o033[39m/' -e 's/\(.*\) \(TEST\) \(.*\)/\o033[2m\1\o033[22m \o033[34m\o033[7m\2\o033[27m \3 \o033[0m/'
start_status=$pipestatus[1]
ok=$(grep ' OK' $logfile -c)
......@@ -96,4 +100,4 @@
echo "[${RED}FATAL${RESET}] Tests failed ($warnings WARNING found)"
exit 1
fi
fi
\ No newline at end of file
fi
......@@ -159,5 +159,5 @@
#
echo "INFO - Version: $($odoo_bin --version)"
echo "DEBUG - command line is: $odoo_bin $config $db_host $addons_path $args $load_language"
$odoo_bin $config $db_host $addons_path $args $load_language
echo "DEBUG - command line is: ${PRE_ODOO_BIN}$(which $odoo_bin) $config $db_host $addons_path $args $load_language"
${PRE_ODOO_BIN}$(which $odoo_bin) $config $db_host $addons_path $args $load_language
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