Skip to content

Commit 32fd3ce

Browse files
committed
more debugging
1 parent cfdd652 commit 32fd3ce

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

ci/jobs/scripts/functional_tests_results.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,19 +81,18 @@ def get_broken_tests_rules() -> dict:
8181
def test_is_known_fail(test_name, test_logs, known_broken_tests, test_options_string):
8282
matching_rules = []
8383

84+
print(f"Checking known broken tests for failed test: {test_name}")
85+
print("Potential matching rules:")
8486
exact_rule = known_broken_tests["exact"].get(test_name)
8587
if exact_rule:
88+
print(f"{test_name} - {exact_rule}")
8689
matching_rules.append(exact_rule)
8790

8891
for name_re, data in known_broken_tests["pattern"].items():
8992
if name_re.fullmatch(test_name):
93+
print(f"{name_re} - {data}")
9094
matching_rules.append(data)
9195

92-
print(f"Checking known broken tests for failed test: {test_name}")
93-
print(
94-
"Potential matching rules: \n" + "\n - ".join(map(str, matching_rules)) + "\n"
95-
)
96-
9796
if not matching_rules:
9897
return False
9998

@@ -110,12 +109,15 @@ def matches_field(field, log, is_regex):
110109
if rule_data.get("check_types") and not any(
111110
ct in test_options_string for ct in rule_data["check_types"]
112111
):
112+
print(f"Check types didn't match: {rule_data['check_types']} not in {test_options_string}")
113113
continue # check_types didn't match → skip rule
114114

115115
is_regex = rule_data.get("regex", False)
116116
if matches_field(rule_data.get("not_message"), test_logs, is_regex):
117+
print(f"Not message matched: {rule_data['not_message']}")
117118
continue # not_message matched → skip rule
118119
if not matches_field(rule_data.get("message"), test_logs, is_regex):
120+
print(f"Message didn't match: {rule_data['message']}")
119121
continue # message didn't match → skip rule
120122

121123
return rule_data["reason"]

ci/jobs/scripts/integration_tests_runner.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -510,20 +510,17 @@ def test_is_known_fail(test_name, test_logs, debug_log_file):
510510

511511
matching_rules = []
512512

513+
debug_log_file.write("Potential matching rules:\n")
513514
exact_rule = known_broken_tests["exact"].get(test_name)
514515
if exact_rule:
516+
debug_log_file.write(f"{test_name} - {exact_rule}\n")
515517
matching_rules.append(exact_rule)
516518

517519
for name_re, data in known_broken_tests["pattern"].items():
518520
if name_re.fullmatch(test_name):
521+
debug_log_file.write(f"{name_re} - {data}\n")
519522
matching_rules.append(data)
520523

521-
debug_log_file.write(
522-
"Potential matching rules: \n"
523-
+ "\n - ".join(map(str, matching_rules))
524-
+ "\n"
525-
)
526-
527524
if not matching_rules:
528525
return False
529526

0 commit comments

Comments
 (0)