Skip to content

Commit

Permalink
fix(alerts): Fix tests (#76978)
Browse files Browse the repository at this point in the history
Fix a couple tests - not sure how this got through CI

Fixes
https://sentry.sentry.io/issues/5798592420/?project=2423079&referrer=github-pr-bot
  • Loading branch information
ceorourke authored Sep 5, 2024
1 parent afb8425 commit 3634c69
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tests/sentry/incidents/test_subscription_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,7 @@ def test_seer_call(self, mock_seer_request: MagicMock):
assert deserialized_body["project_id"] == self.sub.project_id
assert deserialized_body["config"]["time_period"] == rule.snuba_query.time_window / 60
assert deserialized_body["config"]["sensitivity"] == rule.sensitivity.value
assert deserialized_body["config"]["expected_seasonality"] == rule.seasonality.value
assert deserialized_body["config"]["direction"] == translate_direction(rule.threshold_type)
assert deserialized_body["context"]["id"] == rule.id
assert deserialized_body["context"]["cur_window"][0]["value"] == 5
Expand Down Expand Up @@ -546,6 +547,7 @@ def test_seer_call(self, mock_seer_request: MagicMock):
assert deserialized_body["project_id"] == self.sub.project_id
assert deserialized_body["config"]["time_period"] == rule.snuba_query.time_window / 60
assert deserialized_body["config"]["sensitivity"] == rule.sensitivity.value
assert deserialized_body["config"]["expected_seasonality"] == rule.seasonality.value
assert deserialized_body["config"]["direction"] == translate_direction(rule.threshold_type)
assert deserialized_body["context"]["id"] == rule.id
assert deserialized_body["context"]["cur_window"][0]["value"] == 10
Expand Down Expand Up @@ -582,6 +584,7 @@ def test_seer_call(self, mock_seer_request: MagicMock):
assert deserialized_body["project_id"] == self.sub.project_id
assert deserialized_body["config"]["time_period"] == rule.snuba_query.time_window / 60
assert deserialized_body["config"]["sensitivity"] == rule.sensitivity.value
assert deserialized_body["config"]["expected_seasonality"] == rule.seasonality.value
assert deserialized_body["config"]["direction"] == translate_direction(rule.threshold_type)
assert deserialized_body["context"]["id"] == rule.id
assert deserialized_body["context"]["cur_window"][0]["value"] == 1
Expand Down Expand Up @@ -631,12 +634,12 @@ def test_seer_call_performance_rule(self, mock_seer_request: MagicMock):
== throughput_rule.snuba_query.time_window / 60
)
assert deserialized_body["config"]["sensitivity"] == throughput_rule.sensitivity
assert deserialized_body["config"]["seasonality"] == throughput_rule.seasonality
assert deserialized_body["config"]["expected_seasonality"] == throughput_rule.seasonality
assert deserialized_body["config"]["direction"] == translate_direction(
throughput_rule.threshold_type
)
assert deserialized_body["context"]["id"] == throughput_rule.id
assert deserialized_body["context"]["cur_window"]["value"] == 10
assert deserialized_body["context"]["cur_window"][0]["value"] == 10

self.assert_trigger_counts(processor, self.trigger, 0, 0)
incident = self.assert_active_incident(throughput_rule)
Expand Down Expand Up @@ -671,12 +674,12 @@ def test_seer_call_performance_rule(self, mock_seer_request: MagicMock):
== throughput_rule.snuba_query.time_window / 60
)
assert deserialized_body["config"]["sensitivity"] == throughput_rule.sensitivity
assert deserialized_body["config"]["seasonality"] == throughput_rule.seasonality
assert deserialized_body["config"]["expected_seasonality"] == throughput_rule.seasonality
assert deserialized_body["config"]["direction"] == translate_direction(
throughput_rule.threshold_type
)
assert deserialized_body["context"]["id"] == throughput_rule.id
assert deserialized_body["context"]["cur_window"]["value"] == 1
assert deserialized_body["context"]["cur_window"][0]["value"] == 1

self.assert_trigger_counts(processor, self.trigger, 0, 0)
self.assert_no_active_incident(throughput_rule)
Expand Down

0 comments on commit 3634c69

Please sign in to comment.