From 9fce3f83cb2f20243fae629bfd5f64f27975b9f0 Mon Sep 17 00:00:00 2001 From: Christophe Monniez Date: Wed, 17 Feb 2021 15:36:24 +0000 Subject: [PATCH] [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) --- odoo/tests/test_module_operations.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/odoo/tests/test_module_operations.py b/odoo/tests/test_module_operations.py index d4d9804d738..c982812f8ac 100755 --- a/odoo/tests/test_module_operations.py +++ b/odoo/tests/test_module_operations.py @@ -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()