Add no-strict option to harness

Reviewers: mferencevic

Reviewed By: mferencevic

Differential Revision: https://phabricator.memgraph.io/D716
This commit is contained in:
Mislav Bradac 2017-08-25 15:05:40 +02:00
parent 148348defa
commit 7628084ccf
2 changed files with 13 additions and 4 deletions

View File

@ -473,6 +473,9 @@ def parse_known_args():
help="Logging level") help="Logging level")
argp.add_argument("--additional-run-fields", default={}, type=json.loads, argp.add_argument("--additional-run-fields", default={}, type=json.loads,
help="Additional fields to add to the 'run', in JSON") help="Additional fields to add to the 'run', in JSON")
argp.add_argument("--no-strict", default=False, action="store_true",
help="Ignores nonexisting groups instead of raising an "
"exception")
return argp.parse_known_args() return argp.parse_known_args()
@ -510,12 +513,18 @@ def main():
runner = runners[args.runner](remaining_args) runner = runners[args.runner](remaining_args)
# Validate groups (if provided) # Validate groups (if provided)
groups = []
if args.groups: if args.groups:
for group in args.groups: for group in args.groups:
if group not in suite.groups(): if group not in suite.groups():
raise Exception("Group '{}' isn't registered for suite '{}'". msg = "Group '{}' isn't registered for suite '{}'".format(
format(group, suite)) group, suite)
groups = args.groups if args.no_strict:
log.warn(msg)
else:
raise Exception(msg)
else:
groups.append(group)
else: else:
# No groups provided, use all suite group # No groups provided, use all suite group
groups = suite.groups() groups = suite.groups()

View File

@ -190,7 +190,7 @@ binary_release_path = os.path.join(BUILD_RELEASE_DIR, binary_release_name)
binary_release_link_path = os.path.join(BUILD_RELEASE_DIR, "memgraph") binary_release_link_path = os.path.join(BUILD_RELEASE_DIR, "memgraph")
# macro benchmark tests # macro benchmark tests
MACRO_BENCHMARK_ARGS = "QuerySuite MemgraphRunner --groups aggregation" MACRO_BENCHMARK_ARGS = "QuerySuite MemgraphRunner --groups aggregation --no-strict"
macro_bench_path = os.path.join(BASE_DIR, "tests", "macro_benchmark") macro_bench_path = os.path.join(BASE_DIR, "tests", "macro_benchmark")
harness_client_binary = os.path.join(BUILD_RELEASE_DIR, "tests", harness_client_binary = os.path.join(BUILD_RELEASE_DIR, "tests",
"macro_benchmark", "harness_client") "macro_benchmark", "harness_client")