From 7628084ccf0a3620363e7db08c612b835316b181 Mon Sep 17 00:00:00 2001 From: Mislav Bradac Date: Fri, 25 Aug 2017 15:05:40 +0200 Subject: [PATCH] Add no-strict option to harness Reviewers: mferencevic Reviewed By: mferencevic Differential Revision: https://phabricator.memgraph.io/D716 --- tests/macro_benchmark/harness/harness.py | 15 ++++++++++++--- tools/apollo/generate | 2 +- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/tests/macro_benchmark/harness/harness.py b/tests/macro_benchmark/harness/harness.py index c244c4104..72f7c137f 100755 --- a/tests/macro_benchmark/harness/harness.py +++ b/tests/macro_benchmark/harness/harness.py @@ -473,6 +473,9 @@ def parse_known_args(): help="Logging level") argp.add_argument("--additional-run-fields", default={}, type=json.loads, 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() @@ -510,12 +513,18 @@ def main(): runner = runners[args.runner](remaining_args) # Validate groups (if provided) + groups = [] if args.groups: for group in args.groups: if group not in suite.groups(): - raise Exception("Group '{}' isn't registered for suite '{}'". - format(group, suite)) - groups = args.groups + msg = "Group '{}' isn't registered for suite '{}'".format( + group, suite) + if args.no_strict: + log.warn(msg) + else: + raise Exception(msg) + else: + groups.append(group) else: # No groups provided, use all suite group groups = suite.groups() diff --git a/tools/apollo/generate b/tools/apollo/generate index 8ba6617ec..ba77982ea 100755 --- a/tools/apollo/generate +++ b/tools/apollo/generate @@ -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") # 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") harness_client_binary = os.path.join(BUILD_RELEASE_DIR, "tests", "macro_benchmark", "harness_client")