Commit 5a94c4fd authored by Sebastien Robin's avatar Sebastien Robin

erp5_test_result: make cloud performance test working again, add more tests

Some come was introduced to check status of test suite before creating a test result. This
introduced a regression in the case of cloud performance test. The code was covered by
unit test, but not in that particular case.
parent b39f49ae
master DateTime.equalTo_fix TMP-2to3 UpdateValidationStateFromConsistency UserPropertySheet_backward_compatibility addToDate_implicit_localtime add_boolean_type arnau arnau-RD-Components-CacheTool arnau-RD-Components-ERP5Form-ERP5Report arnau-RD-Components-ERP5Form-SelectionTool-MemcachedTool arnau-RD-Components-ERP5OOo arnau-RD-Components-PreferenceTool-Preference arnau-RD-Components-Products-import-compat arnau-RD-Components-astroid_cache_per_component_reset arnau-RD-Components-erp5_crm arnau-RD-Components-erp5_trade-TODO-Interactor arnau-RD-ERP5ify-portal_workflow-1-seb-merged-with-recent-master arnau-RD-ERP5ify-portal_workflow-2-do-not-rename-erp5_workflow-portal_types arnau-RD-ERP5ify-portal_workflow-BAK arnau-RD-ERP5ify-portal_workflow-WIP arnau-RD-ERP5ify-portal_workflow-WITHOUT-MIGRATION arnau-RD-ERP5ify-portal_workflow-WORKFLOWS-NOT-MIGRATED arnau-RD-py3-master-TM arnau-RD-py3-master-TM-BAK arnau-RD-py3-master-WIP arnau-RD-py3-master-WIP-BAK arnau-RD-py3-master-WIP-bt5-and-tests arnau-RD-zope4py3 arnau-TM-Components-Migrate-PortalTransforms arnau-TM-Components-ModuleSecurityInfo arnau-TM-FEC-output arnau-TM-WIP arnau-TM-isBuildable-with-multiple-BusinessLinks arnau-TM-newContent-temp_object arnau-TM-runUnitTest-clear-previous-execution-catalog arnau-TM-wkhtmltopdf arnau-WIP arnau-my2to3 arnau-zope4py2 aurel-zope4py2 cache-control-304-response cribjs-bootloader drop-ZServer e2e-erp5 enhance_scalability_testing erp5-component erp5-component-bak erp5-imt erp5-messenger erp5-vifib erp5-vifib-no-Products.DCWorkflowGraph erp5-vifib-py3 erp5_corporate_identity erp5_drone_simulator erp5_hal_json_style_fix_restricted_access_with_traverse erp5_payslip_migration feat/coding_style_test feat/dedup_roles_in_pickles feat/dms_implicit_predecessor_successor_fields feat/erp5_ide feat/erp5pt feat/fsum feat/improve_rounding_tool feat/inventory_api_group_by_time_interval_list feat/lxml-html-snapshot feat/mariadb-10.11 feat/mariadb-10.11bis feat/mariadb-10.11ter feat/mariadb-10.5 feat/mariadb-10.6 feat/mariadb-11.4bis feat/mariadb-11.4bis-old feat/mariadb-11.4ter feat/notification-message-ignore-missing feat/python_language_support feat/reindexlastobjects_log feat/round_half_up feat/selenium-unexpected-success feat/slapos_agent_distributor feat/subject_set_query fix/GHSA-g5vw-3h65-2q3v fix/TALES_hide_error fix/ZMI_editor_preference fix/accounting-fec-no-line fix/advance_ecommerce_coding_crimes fix/erp5_site_global_id fix/invoice-line-currency-price fix/mariadb-1927 fix/measure-optional-variation fix/monaco-altClick fix/officejs_support_request_rss_secu fix/state_var fix/support-request-app-empty fix/testnode_proctitle fix/workflow_info fix/workflow_method_security fix_web_illustration for_testrunner_1 for_testrunner_2 for_testrunner_3 graphic_gadget_js inventory limit_accelerated_http_cache_manager lle-bout/metadata-modules master_w mr1362 my2to3 notebook_roque oauth-login-minor-improvement override_cache_control_header_by_caching_policy_manager poc/json-forms-study publish_recursiveReindexObject restore-from-trashbin revert-192c2000 rfc/activate_default rjs_listbox_sort_icon roque_quick scalability_crash_mariadb shop-box-rebase streaming_fix streaming_fix-0 support_legacy_sftp_server support_relative_url_in_hyperlink_field support_request test-renderjs-float-field-step test_cmfactivity_isolation_level test_dynamic_methods tomo_testnode_slap_request translatable_path_master trustable-x-forwarded-for ttrm unify_predicate_edit without_legacy_workflow workaround_mroonga_14 wsgi wsgi-gevent wsgi_backport_setbody_lock wsgi_medusa_stream_fix zope2 zope2zope4py2 zope4py3 zope4py3-BEFORE-CLEANUP zope4py3-master-rebase 0.4.59.1 0.4.59 nexedi-erp5-vifib-20201105 erp5.util-0.4.76 erp5.util-0.4.75 erp5.util-0.4.74 erp5.util-0.4.73 erp5.util-0.4.72 erp5.util-0.4.71 erp5.util-0.4.69 erp5.util-0.4.68 erp5.util-0.4.67 erp5.util-0.4.66 erp5.util-0.4.65 erp5.util-0.4.64 erp5.util-0.4.63 erp5.util-0.4.62 erp5.util-0.4.61 erp5.util-0.4.60 erp5.util-0.4.59.1 erp5.util-0.4.59 erp5.util-0.4.58 erp5.util-0.4.57 erp5.util-0.4.56 erp5.util-0.4.55 erp5.util-0.4.54 erp5.util-0.4.53 erp5.util-0.4.52 erp5-vifib-20240326 erp5-vifib-20230331 erp5-vifib-20230201 erp5-vifib-20220526 erp5-vifib-20220302 erp5-vifib-20210707 erp5-vifib-20201229 erp5-vifib-20200129
...@@ -328,10 +328,12 @@ class TestTaskDistribution(ERP5TypeTestCase): ...@@ -328,10 +328,12 @@ class TestTaskDistribution(ERP5TypeTestCase):
def _createTestResult(self, revision="r0=a,r1=a", node_title='Node0', def _createTestResult(self, revision="r0=a,r1=a", node_title='Node0',
test_list=None, tic=1, allow_restart=False, test_list=None, tic=1, allow_restart=False,
test_title=None): test_title=None, distributor=None):
if test_title is None: if test_title is None:
test_title = self.default_test_title test_title = self.default_test_title
result = self.distributor.createTestResult( if distributor is None:
distributor = self.distributor
result = distributor.createTestResult(
"", revision, test_list or [], allow_restart, "", revision, test_list or [], allow_restart,
test_title=test_title, node_title=node_title) test_title=test_title, node_title=node_title)
# we commit, since usually we have a remote call only doing this # we commit, since usually we have a remote call only doing this
...@@ -837,20 +839,31 @@ class TestTaskDistribution(ERP5TypeTestCase): ...@@ -837,20 +839,31 @@ class TestTaskDistribution(ERP5TypeTestCase):
[test_node_two, ["one", "two", "three"]]) [test_node_two, ["one", "two", "three"]])
# now we are going to # now we are going to
def test_13_startTestSuiteWithOneTestNodeAndPerformanceDistributor(self): def test_13_startTestSuiteAndCreateTestResultWithOneTestNodeAndPerformanceDistributor(self):
config_list = json.loads(self.performance_distributor.startTestSuite( config_list = json.loads(self.performance_distributor.startTestSuite(
title="COMP32-Node1")) title="COMP32-Node1"))
self.assertEqual([], config_list) self.assertEqual([], config_list)
self._createTestSuite(quantity=2, self._createTestSuite(quantity=2,
specialise_value=self.performance_distributor) specialise_value=self.performance_distributor)
self.tic() self.tic()
self._callOptimizeAlarm() self._callOptimizeAlarm()
config_list = json.loads(self.performance_distributor.startTestSuite( config_list = json.loads(self.performance_distributor.startTestSuite(
title="COMP32-Node1")) title="COMP32-Node1"))
self.assertEqual(2, len(config_list)) self.assertEqual(2, len(config_list))
self.assertEqual(set(['test suite 1-COMP32-Node1', self.assertEqual(set(['test suite 1|COMP32-Node1',
'test suite 2-COMP32-Node1']), 'test suite 2|COMP32-Node1']),
set([x['test_suite_title'] for x in config_list])) set([x['test_suite_title'] for x in config_list]))
revision = 'a=a,b=b,c=c'
result = self._createTestResult(test_title='test suite 1|COMP32-Node1',
distributor=self.performance_distributor)
self.tic()
self.assertNotEqual(None, result)
first_path = result[0]
next_result = self._createTestResult(test_title='test suite 1|COMP42-Node1',
distributor=self.performance_distributor)
self.assertNotEqual(None, result)
next_path = next_result[0]
self.assertTrue(first_path != next_path)
def test_14_subscribeNodeCheckERP5ScalabilityDistributor(self): def test_14_subscribeNodeCheckERP5ScalabilityDistributor(self):
""" """
......
...@@ -80,7 +80,7 @@ class CloudPerformanceUnitTestDistributor(ERP5ProjectUnitTestDistributor): ...@@ -80,7 +80,7 @@ class CloudPerformanceUnitTestDistributor(ERP5ProjectUnitTestDistributor):
config_list = super(CloudPerformanceUnitTestDistributor, config_list = super(CloudPerformanceUnitTestDistributor,
self).startTestSuite(title, batch_mode=1) self).startTestSuite(title, batch_mode=1)
for config in config_list: for config in config_list:
config["test_suite_title"] = config["test_suite_title"] + "-%s" % title config["test_suite_title"] = config["test_suite_title"] + "|%s" % title
return json.dumps(config_list) return json.dumps(config_list)
security.declarePublic("generateConfiguration") security.declarePublic("generateConfiguration")
...@@ -95,3 +95,7 @@ class CloudPerformanceUnitTestDistributor(ERP5ProjectUnitTestDistributor): ...@@ -95,3 +95,7 @@ class CloudPerformanceUnitTestDistributor(ERP5ProjectUnitTestDistributor):
# effort to run tests. # effort to run tests.
return super(CloudPerformanceUnitTestDistributor, self) \ return super(CloudPerformanceUnitTestDistributor, self) \
.generateConfiguration("ERP5-Cloud-Reliability", batch_mode) .generateConfiguration("ERP5-Cloud-Reliability", batch_mode)
def _getTestSuiteFromTitle(self, suite_title):
return super(CloudPerformanceUnitTestDistributor,
self)._getTestSuiteFromTitle(suite_title.split("|")[0])
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment