|
@@ -674,7 +674,9 @@ class PerformanceIssueTestCase(BaseTestCase):
|
|
|
side_effect=detect_performance_problems_interceptor,
|
|
|
),
|
|
|
mock.patch.object(
|
|
|
- issue_type, "noise_config", new=NoiseConfig(noise_limit, timedelta(minutes=1))
|
|
|
+ issue_type,
|
|
|
+ "noise_config",
|
|
|
+ new=NoiseConfig(noise_limit, timedelta(minutes=1)),
|
|
|
),
|
|
|
override_options(
|
|
|
{"performance.issues.all.problem-detection": 1.0, detector_option: 1.0}
|
|
@@ -846,7 +848,8 @@ class APITestCaseMixin:
|
|
|
return response
|
|
|
|
|
|
with mock.patch(
|
|
|
- "sentry.hybridcloud.apigateway.proxy.external_request", new=proxy_raw_request
|
|
|
+ "sentry.hybridcloud.apigateway.proxy.external_request",
|
|
|
+ new=proxy_raw_request,
|
|
|
):
|
|
|
yield
|
|
|
|
|
@@ -1007,7 +1010,8 @@ class PermissionTestCase(TestCase):
|
|
|
super().setUp()
|
|
|
self.owner = self.create_user(is_superuser=False)
|
|
|
self.organization = self.create_organization(
|
|
|
- owner=self.owner, flags=0
|
|
|
+ owner=self.owner,
|
|
|
+ flags=0,
|
|
|
)
|
|
|
self.team = self.create_team(organization=self.organization)
|
|
|
|
|
@@ -1210,7 +1214,9 @@ class IntegrationTestCase(TestCase):
|
|
|
self.request = self.make_request(self.user)
|
|
|
|
|
|
self.pipeline = IntegrationPipeline(
|
|
|
- request=self.request, organization=rpc_organization, provider_key=self.provider.key
|
|
|
+ request=self.request,
|
|
|
+ organization=rpc_organization,
|
|
|
+ provider_key=self.provider.key,
|
|
|
)
|
|
|
|
|
|
self.init_path = reverse(
|
|
@@ -1365,12 +1371,14 @@ class SnubaTestCase(BaseTestCase):
|
|
|
data = [self.__wrap_group(group)]
|
|
|
assert (
|
|
|
requests.post(
|
|
|
- settings.SENTRY_SNUBA + "/tests/entities/outcomes/insert", data=json.dumps(data)
|
|
|
+ settings.SENTRY_SNUBA + "/tests/entities/outcomes/insert",
|
|
|
+ data=json.dumps(data),
|
|
|
).status_code
|
|
|
== 200
|
|
|
)
|
|
|
|
|
|
def store_span(self, span, is_eap=False):
|
|
|
+ span["ingest_in_eap"] = is_eap
|
|
|
assert (
|
|
|
requests.post(
|
|
|
settings.SENTRY_SNUBA + f"/tests/entities/{'eap_' if is_eap else ''}spans/insert",
|
|
@@ -1380,6 +1388,8 @@ class SnubaTestCase(BaseTestCase):
|
|
|
)
|
|
|
|
|
|
def store_spans(self, spans, is_eap=False):
|
|
|
+ for span in spans:
|
|
|
+ span["ingest_in_eap"] = is_eap
|
|
|
assert (
|
|
|
requests.post(
|
|
|
settings.SENTRY_SNUBA + f"/tests/entities/{'eap_' if is_eap else ''}spans/insert",
|
|
@@ -1495,7 +1505,8 @@ class SnubaTestCase(BaseTestCase):
|
|
|
|
|
|
assert (
|
|
|
requests.post(
|
|
|
- settings.SENTRY_SNUBA + "/tests/entities/events/insert", data=json.dumps(events)
|
|
|
+ settings.SENTRY_SNUBA + "/tests/entities/events/insert",
|
|
|
+ data=json.dumps(events),
|
|
|
).status_code
|
|
|
== 200
|
|
|
)
|
|
@@ -1736,7 +1747,6 @@ class BaseMetricsTestCase(SnubaTestCase):
|
|
|
aggregation_option: AggregationOption | None = None,
|
|
|
sampling_weight: int | None = None,
|
|
|
) -> None:
|
|
|
-
|
|
|
parsed = parse_mri(mri)
|
|
|
metric_type = parsed.entity
|
|
|
use_case_id = UseCaseID(parsed.namespace)
|
|
@@ -1853,7 +1863,6 @@ class BaseMetricsTestCase(SnubaTestCase):
|
|
|
|
|
|
|
|
|
class BaseMetricsLayerTestCase(BaseMetricsTestCase):
|
|
|
-
|
|
|
|
|
|
|
|
|
|
|
@@ -2385,7 +2394,8 @@ class OutcomesSnubaTest(TestCase):
|
|
|
|
|
|
assert (
|
|
|
requests.post(
|
|
|
- settings.SENTRY_SNUBA + "/tests/entities/outcomes/insert", data=json.dumps(outcomes)
|
|
|
+ settings.SENTRY_SNUBA + "/tests/entities/outcomes/insert",
|
|
|
+ data=json.dumps(outcomes),
|
|
|
).status_code
|
|
|
== 200
|
|
|
)
|
|
@@ -2442,7 +2452,8 @@ class ProfilesSnubaTestCase(
|
|
|
functions_payload.update(extras)
|
|
|
|
|
|
response = requests.post(
|
|
|
- settings.SENTRY_SNUBA + "/tests/entities/functions/insert", json=[functions_payload]
|
|
|
+ settings.SENTRY_SNUBA + "/tests/entities/functions/insert",
|
|
|
+ json=[functions_payload],
|
|
|
)
|
|
|
assert response.status_code == 200
|
|
|
|
|
@@ -2545,12 +2556,19 @@ class IntegrationRepositoryTestCase(APITestCase):
|
|
|
|
|
|
@assume_test_silo_mode(SiloMode.REGION)
|
|
|
def create_repository(
|
|
|
- self, repository_config, integration_id, organization_slug=None, add_responses=True
|
|
|
+ self,
|
|
|
+ repository_config,
|
|
|
+ integration_id,
|
|
|
+ organization_slug=None,
|
|
|
+ add_responses=True,
|
|
|
):
|
|
|
if add_responses:
|
|
|
self.add_create_repository_responses(repository_config)
|
|
|
if not integration_id:
|
|
|
- data = {"provider": self.provider_name, "identifier": repository_config["id"]}
|
|
|
+ data = {
|
|
|
+ "provider": self.provider_name,
|
|
|
+ "identifier": repository_config["id"],
|
|
|
+ }
|
|
|
else:
|
|
|
data = {
|
|
|
"provider": self.provider_name,
|
|
@@ -2654,7 +2672,9 @@ class OrganizationDashboardWidgetTestCase(APITestCase):
|
|
|
super().setUp()
|
|
|
self.login_as(self.user)
|
|
|
self.dashboard = Dashboard.objects.create(
|
|
|
- title="Dashboard 1", created_by_id=self.user.id, organization=self.organization
|
|
|
+ title="Dashboard 1",
|
|
|
+ created_by_id=self.user.id,
|
|
|
+ organization=self.organization,
|
|
|
)
|
|
|
self.anon_users_query: _QueryDict = {
|
|
|
"name": "Anonymous Users",
|
|
@@ -2755,7 +2775,10 @@ class OrganizationDashboardWidgetTestCase(APITestCase):
|
|
|
def create_user_member_role(self):
|
|
|
self.user = self.create_user(is_superuser=False)
|
|
|
self.create_member(
|
|
|
- user=self.user, organization=self.organization, role="member", teams=[self.team]
|
|
|
+ user=self.user,
|
|
|
+ organization=self.organization,
|
|
|
+ role="member",
|
|
|
+ teams=[self.team],
|
|
|
)
|
|
|
self.login_as(self.user)
|
|
|
|
|
@@ -2905,7 +2928,9 @@ class ActivityTestCase(TestCase):
|
|
|
release.add_project(self.project)
|
|
|
release.add_project(self.project2)
|
|
|
deploy = Deploy.objects.create(
|
|
|
- release=release, organization_id=self.org.id, environment_id=self.environment.id
|
|
|
+ release=release,
|
|
|
+ organization_id=self.org.id,
|
|
|
+ environment_id=self.environment.id,
|
|
|
)
|
|
|
|
|
|
return release, deploy
|
|
@@ -3237,7 +3262,9 @@ class MonitorTestCase(APITestCase):
|
|
|
}
|
|
|
|
|
|
return MonitorEnvironment.objects.create(
|
|
|
- monitor=monitor, environment_id=environment.id, **monitorenvironment_defaults
|
|
|
+ monitor=monitor,
|
|
|
+ environment_id=environment.id,
|
|
|
+ **monitorenvironment_defaults,
|
|
|
)
|
|
|
|
|
|
def _create_issue_alert_rule(self, monitor, exclude_slug_filter=False):
|
|
@@ -3319,7 +3346,8 @@ class UptimeTestCaseMixin:
|
|
|
"sentry.uptime.rdap.query.resolve_hostname", return_value="192.168.0.1"
|
|
|
)
|
|
|
self.mock_resolve_rdap_provider_ctx = mock.patch(
|
|
|
- "sentry.uptime.rdap.query.resolve_rdap_provider", return_value="https://fake.com/"
|
|
|
+ "sentry.uptime.rdap.query.resolve_rdap_provider",
|
|
|
+ return_value="https://fake.com/",
|
|
|
)
|
|
|
self.mock_requests_get_ctx = mock.patch("sentry.uptime.rdap.query.requests.get")
|
|
|
self.mock_resolve_hostname = self.mock_resolve_hostname_ctx.__enter__()
|
|
@@ -3349,7 +3377,10 @@ class UptimeTestCase(UptimeTestCaseMixin, TestCase):
|
|
|
"guid": uuid.uuid4().hex,
|
|
|
"subscription_id": subscription_id,
|
|
|
"status": status,
|
|
|
- "status_reason": {"type": CHECKSTATUSREASONTYPE_TIMEOUT, "description": "it timed out"},
|
|
|
+ "status_reason": {
|
|
|
+ "type": CHECKSTATUSREASONTYPE_TIMEOUT,
|
|
|
+ "description": "it timed out",
|
|
|
+ },
|
|
|
"span_id": uuid.uuid4().hex,
|
|
|
"trace_id": uuid.uuid4().hex,
|
|
|
"scheduled_check_time_ms": int(scheduled_check_time.timestamp() * 1000),
|