Fix exclusion function

This commit is contained in:
Laurent Indermuehle 2023-01-09 19:06:41 +01:00
parent 671011352c
commit 0494de3f5c
No known key found for this signature in database
GPG key ID: 93FA944C9F34DD09

View file

@ -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