Skip to content

Commit

Permalink
Update unittest with adding rule with different type
Browse files Browse the repository at this point in the history
  • Loading branch information
oharan2 committed May 20, 2024
1 parent f94f4d6 commit dc56944
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,14 @@ def test_configuration_gets_failure_rules_with_two_matching_steps(self):
"jira_project": "NONE",
},
)
different_type_rule = FailureRule(
rule_dict={
"step": "exact-failed-step",
"failure_type": "pod_failure",
"classification": "NONE",
"jira_project": "NONE",
},
)
pattern_rule = FailureRule(
rule_dict={
"step": "exact-*",
Expand All @@ -88,12 +96,13 @@ def test_configuration_gets_failure_rules_with_two_matching_steps(self):
"jira_project": "NONE",
},
)
rules = [pattern_rule, match_rule]
rules = [pattern_rule, different_type_rule, match_rule]

matching_rules = self.report.failure_matches_rule(
failure=failure,
rules=rules,
default_jira_project=self.config.default_jira_project,
)

# Check if match_rule is sorted higher than pattern_rule
assert matching_rules[0].step.__eq__(failure.step)

0 comments on commit dc56944

Please sign in to comment.