Commit 681b09fc authored by Benjamin Blanc's avatar Benjamin Blanc

scalability: runScalabilityTestSuite: Correct bugs

parent ba90f363
...@@ -20,7 +20,7 @@ from erp5.util.testnode import Utils ...@@ -20,7 +20,7 @@ from erp5.util.testnode import Utils
# XXX: This import is required, just to populate sys.modules['test_suite']. # XXX: This import is required, just to populate sys.modules['test_suite'].
# Even if it's not used in this file. Yuck. # Even if it's not used in this file. Yuck.
import ERP5TypeTestSuite import product.ERP5Type.tests.ERP5TypeTestSuite
from subprocess import call from subprocess import call
...@@ -37,7 +37,10 @@ class ScalabilityTest(object): ...@@ -37,7 +37,10 @@ class ScalabilityTest(object):
self.__dict__.update(data) self.__dict__.update(data)
self.test_result = test_result self.test_result = test_result
def makeSuite(test_suite=None, **kwargs): def doNothing(**kwargs):
pass
def makeSuite(test_suite=None, log=doNothing, **kwargs):
# BBB tests (plural form) is only checked for backward compatibility # BBB tests (plural form) is only checked for backward compatibility
for k in sys.modules.keys(): for k in sys.modules.keys():
if k in ('tests', 'test',) or k.startswith('tests.') or k.startswith('test.'): if k in ('tests', 'test',) or k.startswith('tests.') or k.startswith('test.'):
...@@ -55,7 +58,7 @@ def makeSuite(test_suite=None, **kwargs): ...@@ -55,7 +58,7 @@ def makeSuite(test_suite=None, **kwargs):
singular_succeed = False singular_succeed = False
else: else:
break break
suite = suite_class(**kwargs) suite = suite_class(max_instance_count=1, **kwargs)
return suite return suite
...@@ -231,7 +234,7 @@ class ScalabilityLauncher(object): ...@@ -231,7 +234,7 @@ class ScalabilityLauncher(object):
error_message_set, exit_status = set(), 0 error_message_set, exit_status = set(), 0
# Get suite informations # Get suite informations
suite = makeSuite(self.__argumentNamespace.test_suite) suite = makeSuite(self.__argumentNamespace.test_suite, self.log)
test_suites = suite.getTestList() test_suites = suite.getTestList()
test_path = suite.getTestPath() test_path = suite.getTestPath()
test_duration = suite.getTestDuration() test_duration = suite.getTestDuration()
...@@ -254,7 +257,7 @@ class ScalabilityLauncher(object): ...@@ -254,7 +257,7 @@ class ScalabilityLauncher(object):
tester_process = subprocess.Popen([tester_path, tester_process = subprocess.Popen([tester_path,
self.__argumentNamespace.erp5_url, self.__argumentNamespace.erp5_url,
'1', '1',
test_suites, ' '.join(test_suites),
'--benchmark-path-list', benchmark_path_list, '--benchmark-path-list', benchmark_path_list,
'--users-file-path', user_file_path, '--users-file-path', user_file_path,
'--filename-prefix', "%s_%s_" %(LOG_FILE_PREFIX, current_test.title), '--filename-prefix', "%s_%s_" %(LOG_FILE_PREFIX, current_test.title),
...@@ -273,7 +276,7 @@ class ScalabilityLauncher(object): ...@@ -273,7 +276,7 @@ class ScalabilityLauncher(object):
failed_document_number = self.getFailedDocumentNumber() failed_document_number = self.getFailedDocumentNumber()
created_document_number = self.getCreatedDocumentNumber() - failed_document_number created_document_number = self.getCreatedDocumentNumber() - failed_document_number
created_document_per_hour_number = ( (float(created_document_number)*60*60) / float(test_case_duration) ) created_document_per_hour_number = ( (float(created_document_number)*60*60) / float(test_duration) )
#log_contents = self.returnLogList() #log_contents = self.returnLogList()
#csv_contents = self.returnCsvList() #csv_contents = self.returnCsvList()
self.cleanUpCsv() self.cleanUpCsv()
...@@ -289,12 +292,12 @@ class ScalabilityLauncher(object): ...@@ -289,12 +292,12 @@ class ScalabilityLauncher(object):
current_test.title current_test.title
) )
output = "%s doc in %s secs = %s docs per hour" %(created_document_number, test_case_duration, created_document_per_hour_number) self.log("%s doc in %s secs = %s docs per hour" %(created_document_number, test_duration, created_document_per_hour_number))
test_result_line_test.stop(stdout=output, test_result_line_test.stop(stdout='soon',
test_count=created_document_number, test_count=created_document_number,
failure_count=failed_document_number, failure_count=failed_document_number,
error_count=error_count, error_count=error_count,
duration=test_case_duration) duration=test_duration)
self.log("Test Case Stopped") self.log("Test Case Stopped")
return error_message_set, exit_status return error_message_set, exit_status
......
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