diff --git a/erp5/util/testnode/__init__.py b/erp5/util/testnode/__init__.py index 35744eafe2573ab6dd2b15afb5f014f6999a1712..80575f70c583a96b51bdc02dc6267f47ed2b9650 100644 --- a/erp5/util/testnode/__init__.py +++ b/erp5/util/testnode/__init__.py @@ -105,8 +105,14 @@ def main(*args): for section in config.sections(): if section.startswith('vcs_repository'): vcs_repository_list.append(dict(config.items(section))) - CONFIG['vcs_repository_list'] = vcs_repository_list + CONFIG['bt5_path'] = None + if 'bt5_path' in config.options("testnode"): + bt5_path = config.get("testnode", 'bt5_path') + if bt5_path.lower() != "none": + CONFIG['bt5_path'] = bt5_path + + CONFIG['vcs_repository_list'] = vcs_repository_list CONFIG['test_suite_title'] = geto('test_suite_title') CONFIG['test_node_title'] = geto('test_node_title') CONFIG['test_suite'] = geto('test_suite') @@ -127,5 +133,4 @@ def main(*args): if 'instance_dict' in config.sections(): instance_dict = dict(config.items('instance_dict')) CONFIG['instance_dict'] = instance_dict - testnode.run(CONFIG) diff --git a/erp5/util/testnode/testnode.py b/erp5/util/testnode/testnode.py index c8853ae344577b6ef5662c41be10d0ce72c5e3af..01514b67cc17bbe1ca88b087caf141c38ef231b7 100644 --- a/erp5/util/testnode/testnode.py +++ b/erp5/util/testnode/testnode.py @@ -138,6 +138,7 @@ def run(config): [buildout] extends = %(software_config_path)s """ % {'software_config_path': os.path.join(repository_path, profile_path)} + if not(buildout_section_id is None): profile_content += """ [%(buildout_section_id)s] @@ -267,6 +268,9 @@ branch = %(branch)s '--test_suite_title', test_suite_title, '--node_quantity', config['node_quantity'], '--master_url', config['test_suite_master_url']]) + bt5_path_list = config.get("bt5_path") + if bt5_path_list is not None: + invocation_list.extend(["--bt5_path", bt5_path_list]) # From this point, test runner becomes responsible for updating test # result. # XXX: is it good for all cases (eg: test runner fails too early for diff --git a/product/ERP5Type/tests/ERP5TypeTestSuite.py b/product/ERP5Type/tests/ERP5TypeTestSuite.py index 3439773350c27d43175659b81165bf7d460104a3..c18483bc19c767f0c17f85366b6fc3d5dcf15740 100644 --- a/product/ERP5Type/tests/ERP5TypeTestSuite.py +++ b/product/ERP5Type/tests/ERP5TypeTestSuite.py @@ -301,6 +301,8 @@ class SavedTestSuite(ERP5TypeTestSuite): super(SavedTestSuite, self).__init__(*args, **kw) def __runUnitTest(self, *args, **kw): + if self.__dict__.has_key("bt5_path"): + args = ("--bt5_path=%s" % self.bt5_path,) + args return super(SavedTestSuite, self).runUnitTest( '--portal_id=' + self._portal_id, *args, **kw) diff --git a/product/ERP5Type/tests/runTestSuite.py b/product/ERP5Type/tests/runTestSuite.py index 8363825f344b3aa6737a452c88f2717a28ecca41..94508823790d79fdcceaae7e345271c0d5f58fae 100644 --- a/product/ERP5Type/tests/runTestSuite.py +++ b/product/ERP5Type/tests/runTestSuite.py @@ -4,7 +4,7 @@ from DummyTaskDistributionTool import DummyTaskDistributionTool from ERP5TypeTestSuite import ERP5TypeTestSuite def makeSuite(node_quantity=None, test_suite=None, revision=None, - db_list=None): + db_list=None, **kwargs): # BBB tests (plural form) is only checked for backward compatibility for k in sys.modules.keys(): if k in ('tests', 'test',) or k.startswith('tests.') or k.startswith('test.'): @@ -25,7 +25,7 @@ def makeSuite(node_quantity=None, test_suite=None, revision=None, suite = suite_class(revision=revision, max_instance_count=node_quantity, mysql_db_list=db_list.split(','), - ) + **kwargs) return suite def safeRpcCall(function, *args): @@ -69,8 +69,11 @@ def main(): parser.add_argument('--volatile_memcached_server_port', default=None) parser.add_argument('--persistent_memcached_server_hostname', default=None) parser.add_argument('--persistent_memcached_server_port', default=None) + parser.add_argument('--bt5_path', default=None) args = parser.parse_args() + if args.bt5_path is not None: + sys.path[0:0] = args.bt5_path.split(",") if args.master_url is not None: master_url = args.master_url if master_url[-1] != '/': @@ -86,7 +89,8 @@ def main(): suite = makeSuite(test_suite=args.test_suite, node_quantity=args.node_quantity, revision=revision, - db_list=args.db_list) + db_list=args.db_list, + bt5_path=args.bt5_path) test_result = safeRpcCall(master.createTestResult, args.test_suite, revision, suite.getTestList(), suite.allow_restart, test_suite_title, args.test_node_title, diff --git a/product/ERP5Type/tests/runUnitTest.py b/product/ERP5Type/tests/runUnitTest.py index de3561de22a2f1c9ecb59179828aa460e5d233f2..b1bd9032155a7d19842c9477db1e0095ba14c057 100755 --- a/product/ERP5Type/tests/runUnitTest.py +++ b/product/ERP5Type/tests/runUnitTest.py @@ -686,7 +686,8 @@ def main(argument_list=None): os.environ["erp5_tests_data_fs_path"] = arg os.environ["erp5_tests_recreate_catalog"] = "1" elif opt == '--bt5_path': - os.environ["erp5_tests_bt5_path"] = arg + os.environ["erp5_tests_bt5_path"] = \ + os.environ.get("erp5_tests_bt5_path", "") + arg elif opt == '--recreate_catalog': os.environ["erp5_tests_recreate_catalog"] = arg elif opt == "--erp5_sql_connection_string":