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
......@@ -328,10 +328,12 @@ class TestTaskDistribution(ERP5TypeTestCase):
def _createTestResult(self, revision="r0=a,r1=a", node_title='Node0',
test_list=None, tic=1, allow_restart=False,
test_title=None):
test_title=None, distributor=None):
if test_title is None:
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,
test_title=test_title, node_title=node_title)
# we commit, since usually we have a remote call only doing this
......@@ -837,7 +839,7 @@ class TestTaskDistribution(ERP5TypeTestCase):
[test_node_two, ["one", "two", "three"]])
# now we are going to
def test_13_startTestSuiteWithOneTestNodeAndPerformanceDistributor(self):
def test_13_startTestSuiteAndCreateTestResultWithOneTestNodeAndPerformanceDistributor(self):
config_list = json.loads(self.performance_distributor.startTestSuite(
title="COMP32-Node1"))
self.assertEqual([], config_list)
......@@ -848,9 +850,20 @@ class TestTaskDistribution(ERP5TypeTestCase):
config_list = json.loads(self.performance_distributor.startTestSuite(
title="COMP32-Node1"))
self.assertEqual(2, len(config_list))
self.assertEqual(set(['test suite 1-COMP32-Node1',
'test suite 2-COMP32-Node1']),
self.assertEqual(set(['test suite 1|COMP32-Node1',
'test suite 2|COMP32-Node1']),
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):
"""
......
......@@ -80,7 +80,7 @@ class CloudPerformanceUnitTestDistributor(ERP5ProjectUnitTestDistributor):
config_list = super(CloudPerformanceUnitTestDistributor,
self).startTestSuite(title, batch_mode=1)
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)
security.declarePublic("generateConfiguration")
......@@ -95,3 +95,7 @@ class CloudPerformanceUnitTestDistributor(ERP5ProjectUnitTestDistributor):
# effort to run tests.
return super(CloudPerformanceUnitTestDistributor, self) \
.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