@@ -81,19 +81,18 @@ def get_broken_tests_rules() -> dict:
8181def 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" ]
0 commit comments