From 0494de3f5c2b1c096ddfbebbdd6af640dce61a85 Mon Sep 17 00:00:00 2001 From: Laurent Indermuehle Date: Mon, 9 Jan 2023 19:06:41 +0100 Subject: [PATCH] Fix exclusion function --- run_all_tests.py | 37 ++++++++++++++++--------------------- 1 file changed, 16 insertions(+), 21 deletions(-) diff --git a/run_all_tests.py b/run_all_tests.py index abc5fef..b8b7867 100755 --- a/run_all_tests.py +++ b/run_all_tests.py @@ -30,30 +30,25 @@ def extract_matrix(workflow_yaml): def is_exclude(exclude_list, test_suite): test_is_excluded = False for excl in exclude_list: - db_engine_match = False - ansible_match = False - python_match = False - connector_match = False + match = 0 - if 'db_engine_version' not in excl: - continue - if 'ansible' not in excl: - continue - if 'python' not in excl: - continue - if 'connector' not in excl: - continue + if 'db_engine_version' in excl: + if excl.get('db_engine_version') == test_suite[0]: + match += 1 - if excl.get('db_engine_version') == test_suite[0]: - db_engine_match = True - if excl.get('ansible') == test_suite[1]: - ansible_match = True - if excl.get('python') == test_suite[2]: - python_match = True - if excl.get('connector') == test_suite[3]: - connector_match = True + if 'ansible' in excl: + if excl.get('ansible') == test_suite[1]: + match += 1 - if any(db_engine_match, ansible_match, python_match, connector_match): + if 'python' in excl: + if excl.get('python') == test_suite[2]: + match += 1 + + if 'connector' in excl: + if excl.get('connector') == test_suite[3]: + match += 1 + + if match > 1: test_is_excluded = True return test_is_excluded