Skip to content

Commit

Permalink
Add test_configuration_gets_failure_rules_with_two_matching_steps
Browse files Browse the repository at this point in the history
  • Loading branch information
oharan2 committed May 15, 2024
1 parent 4c5ccc7 commit 66f0ed1
Showing 1 changed file with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,35 @@ def test_failure_matches_rule_with_matches(self):
assert (matching_rules[0].step == match_rule.step) and (
matching_rules[0].failure_type == match_rule.failure_type
)

def test_configuration_gets_failure_rules_with_two_matching_steps(self):
match_rule = FailureRule(
rule_dict={
"step": "exact-failed-step",
"failure_type": "test_failure",
"classification": "NONE",
"jira_project": "NONE",
},
)
pattern_rule = FailureRule(
rule_dict={
"step": "exact-*",
"failure_type": "test_failure",
"classification": "NONE",
"jira_project": "NONE",
},
)
rules = [match_rule,pattern_rule]

self.failure.step = "exact-failed-step"
matching_rules = self.report.failure_matches_rule(
failure=self.failure,
rules=rules,
default_jira_project=self.config.default_jira_project,
)
print([s.step for s in matching_rules]) #TODO
import ipdb
ipdb.set_trace()
assert len(matching_rules) == 1
assert (matching_rules[0].step == match_rule.step)

0 comments on commit 66f0ed1

Please sign in to comment.