[IMP] standalone: log exception when standalone fails

Currently the exception is not logged using the logger meaning that the
only indication of the failure is the "module not loaded" error message.

Catching the exception to log it the proper way will help identifying
the cause of the issue, mainly for uninstall tests.

closes odoo/odoo#100431

X-original-commit: b16f850d9aa438aea91b8cbd7c33692e1e1b2f90
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
This commit is contained in:
Xavier-Do
2022-09-17 00:52:07 +02:00
parent bb65f518c3
commit c06b1ede4c
+9 -6
View File
@@ -163,9 +163,12 @@ if __name__ == '__main__':
logging.getLogger('odoo.modules.loading').setLevel(logging.CRITICAL)
logging.getLogger('odoo.sql_db').setLevel(logging.CRITICAL)
if args.uninstall:
test_uninstall(args)
elif args.standalone:
test_scripts(args)
else:
test_full(args)
try:
if args.uninstall:
test_uninstall(args)
elif args.standalone:
test_scripts(args)
else:
test_full(args)
except Exception as e:
_logger.exception("An error occured during standalone tests: %s", e)