Skip to content

Commit 8985b19

Browse files
committed
update tests
1 parent 7fcb6db commit 8985b19

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

src/sentry/incidents/subscription_processor.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
from __future__ import annotations
32

43
import logging
@@ -515,6 +514,9 @@ def process_update(self, subscription_update: QuerySubscriptionUpdate) -> None:
515514
results = self.process_results_workflow_engine(
516515
subscription_update, aggregation_value, organization
517516
)
517+
else:
518+
# XXX: after we fully migrate to single processing we can return early here like line 545
519+
metrics.incr("incidents.alert_rules.skipping_update_invalid_aggregation_value")
518520

519521
if has_metric_issue_single_processing:
520522
# don't go through the legacy system
@@ -539,7 +541,6 @@ def process_update(self, subscription_update: QuerySubscriptionUpdate) -> None:
539541
return
540542

541543
if aggregation_value is None:
542-
metrics.incr("incidents.alert_rules.skipping_update_invalid_aggregation_value")
543544
return
544545

545546
fired_incident_triggers: list[IncidentTrigger] = []

tests/sentry/incidents/subscription_processor/test_subscription_processor_base.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -210,12 +210,14 @@ def send_update(self, value, time_delta=None, subscription=None):
210210
processor.process_update(message)
211211
return processor
212212

213-
# assert active incident: assert that open period exists
214-
# which means occurrence created, open period for its group, date_ended is null
215-
# query for occurrence evidence_data["detector_id"] == self.detector.id?
216-
# wait but we can't even filter. sigh.
217-
# I guess I can check the detector status. ugh.
218-
# I can also check that there's no open periods for the *project*, but idk how helpful that is
213+
def assert_no_open_period(self, rule, subscription=None):
214+
# TODO: inverse of below
215+
pass
216+
217+
def assert_open_period(self, rule, subscription=None):
218+
# TODO: once we are writing to IncidentGroupOpenPeriod look up the GroupOpenPeriod
219+
pass
220+
219221
def get_detector_state(self, detector: Detector) -> DetectorPriorityLevel:
220222
detector_state = DetectorState.objects.get(detector=detector)
221223
return int(detector_state.state)

0 commit comments

Comments
 (0)