diff options
| author | Christophe Monniez <moc@odoo.com> | 2021-02-17 15:36:24 +0000 |
|---|---|---|
| committer | Christophe Monniez <moc@odoo.com> | 2021-02-18 07:58:51 +0000 |
| commit | 781c91784a0a997967a0152dca2c59a0cb2bab74 (patch) | |
| tree | 5b38a57b7f20bed024109717934297b754bfe59a /odoo | |
| parent | eb9373522628fa01c3503fa802ded23adc1cbe1f (diff) | |
[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#66422
Signed-off-by: Adrian Torres (adt) <adt@odoo.com>
Diffstat (limited to 'odoo')
| -rwxr-xr-x | odoo/tests/test_module_operations.py | 5 |
1 files changed, 5 insertions, 0 deletions
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() |
