Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wedamija committed Feb 20, 2025
1 parent a9f97f1 commit 8811fc1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
10 changes: 9 additions & 1 deletion tests/sentry/uptime/consumers/test_results_consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
ProjectUptimeSubscriptionMode,
UptimeStatus,
UptimeSubscription,
UptimeSubscriptionRegion,
)
from sentry.utils import json
from tests.sentry.uptime.subscriptions.test_tasks import ConfigPusherTestMixin
Expand Down Expand Up @@ -1024,7 +1025,14 @@ def run_check_and_update_region_test(

with (
override_settings(UPTIME_REGIONS=region_configs),
override_options({"uptime.disabled-checker-regions": disabled_regions}),
override_options(
{
"uptime.checker-regions-mode-override": {
region: UptimeSubscriptionRegion.RegionMode.INACTIVE.value
for region in disabled_regions
}
}
),
self.tasks(),
freeze_time((datetime.now() - timedelta(hours=1)).replace(minute=current_minute)),
mock.patch("random.random", return_value=0),
Expand Down
9 changes: 8 additions & 1 deletion tests/sentry/uptime/subscriptions/test_subscriptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
ProjectUptimeSubscription,
ProjectUptimeSubscriptionMode,
UptimeSubscription,
UptimeSubscriptionRegion,
)
from sentry.uptime.subscriptions.subscriptions import (
UPTIME_SUBSCRIPTION_TYPE,
Expand Down Expand Up @@ -292,7 +293,13 @@ def test_auto_associates_active_regions(self):
]
with (
override_settings(UPTIME_REGIONS=regions),
override_options({"uptime.disabled-checker-regions": ["region3"]}),
override_options(
{
"uptime.checker-regions-mode-override": {
"region3": UptimeSubscriptionRegion.RegionMode.INACTIVE.value
}
}
),
):
subscription = get_or_create_uptime_subscription(
url="https://example.com",
Expand Down

0 comments on commit 8811fc1

Please sign in to comment.