[IMP] tests: add data_dir support in test_module_operations

In some situations, like during tests on runbot, the data-dir location
may vary.

With this commit, the `data-dir` CLI argument is added to the
test_module_operations script.

closes odoo/odoo#66492

X-original-commit: 781c91784a0a997967a0152dca2c59a0cb2bab74
Signed-off-by: Adrian Torres (adt) <adt@odoo.com>
This commit is contained in:
Christophe Monniez
2021-02-18 16:09:03 +00:00
parent 3f1a31c498
commit 9fce3f83cb
+5
View File
@@ -52,6 +52,9 @@ def parse_args():
description="Script for testing the install / uninstall / reinstall cycle of Odoo modules")
parser.add_argument("--database", "-d", type=str, required=True,
help="The database to test (note: must have only 'base' installed)")
parser.add_argument("--data-dir", "-D", dest="data_dir", type=str,
help="Directory where to store Odoo data"
)
parser.add_argument("--skip", "-s", type=str,
help="Comma-separated list of modules to skip (they will only be installed)")
parser.add_argument("--resume-at", "-r", type=str,
@@ -151,6 +154,8 @@ if __name__ == '__main__':
# handle paths option
if args.addons_path:
odoo.tools.config['addons_path'] = ','.join([args.addons_path, odoo.tools.config['addons_path']])
if args.data_dir:
odoo.tools.config['data_dir'] = args.data_dir
odoo.modules.module.initialize_sys_path()
init_logger()