Commit 7a1dd4ce authored by Benjamin Blanc's avatar Benjamin Blanc

util: benchmark: performance_tester add searchable paths option

Add command line options to performance_tester in order to enable
searching of userInfo and benchmark test files in specified paths.
parent 5c30a145
...@@ -77,6 +77,10 @@ class PerformanceTester(object): ...@@ -77,6 +77,10 @@ class PerformanceTester(object):
metavar='MODULE', metavar='MODULE',
help="Import users from ``user_tuple'' in MODULE") help="Import users from ``user_tuple'' in MODULE")
parser.add_argument('--users-file-path',
metavar='USER_FILE_PATH',
help='User file path')
parser.add_argument('--users-range-increment', parser.add_argument('--users-range-increment',
type=ArgumentType.checkIntValueWrapper(minimum=1), type=ArgumentType.checkIntValueWrapper(minimum=1),
default=1, default=1,
...@@ -132,6 +136,13 @@ class PerformanceTester(object): ...@@ -132,6 +136,13 @@ class PerformanceTester(object):
metavar='ERP5_PUBLISH_PROJECT', metavar='ERP5_PUBLISH_PROJECT',
help='ERP5 publish project') help='ERP5 publish project')
parser.add_argument('--benchmark-path-list',
default=[],
nargs='+',
metavar='BENCHMARK_PATH',
help='Benchmark paths')
# Mandatory arguments # Mandatory arguments
parser.add_argument('erp5_base_url', metavar='ERP5_URL') parser.add_argument('erp5_base_url', metavar='ERP5_URL')
...@@ -145,15 +156,22 @@ class PerformanceTester(object): ...@@ -145,15 +156,22 @@ class PerformanceTester(object):
metavar='BENCHMARK_SUITES', metavar='BENCHMARK_SUITES',
help='Benchmark suite modules') help='Benchmark suite modules')
@staticmethod @staticmethod
def _check_parsed_arguments(namespace): def _check_parsed_arguments(namespace):
if namespace.users_file_path:
users_file_path_list = [namespace.users_file_path]
else:
users_file_path_list = []
namespace.user_tuple = ArgumentType.objectFromModule(namespace.user_info_filename, namespace.user_tuple = ArgumentType.objectFromModule(namespace.user_info_filename,
object_name='user_tuple') object_name='user_tuple',
searchable_path_list=users_file_path_list)
object_benchmark_suite_list = [] object_benchmark_suite_list = []
for benchmark_suite in namespace.benchmark_suite_list: for benchmark_suite in namespace.benchmark_suite_list:
object_benchmark_suite_list.append(ArgumentType.objectFromModule(benchmark_suite, object_benchmark_suite_list.append(ArgumentType.objectFromModule(benchmark_suite,
callable_object=True)) callable_object=True,
searchable_path_list=namespace.benchmark_path_list))
if namespace.repeat > 0: if namespace.repeat > 0:
namespace.max_error_number = \ namespace.max_error_number = \
......
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