From 458ef13e1dd87381030c6aac3ff7cf7b05e49931 Mon Sep 17 00:00:00 2001 From: William Mak Date: Wed, 11 Dec 2024 12:12:17 -0500 Subject: [PATCH] chore(rpc): Adding a small in filter test - Adding a quick in filter test to check that a bug we're seeing isn't caused by the backend --- .../test_organization_events_span_indexed.py | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/tests/snuba/api/endpoints/test_organization_events_span_indexed.py b/tests/snuba/api/endpoints/test_organization_events_span_indexed.py index d3d1a804e83377..72cef6e05d9152 100644 --- a/tests/snuba/api/endpoints/test_organization_events_span_indexed.py +++ b/tests/snuba/api/endpoints/test_organization_events_span_indexed.py @@ -873,6 +873,50 @@ def test_handle_nans_from_snuba(self): ) assert response.status_code == 200, response.content + def test_in_filter(self): + self.store_spans( + [ + self.create_span( + {"description": "foo", "sentry_tags": {"transaction": "bar"}}, + start_ts=self.ten_mins_ago, + ), + self.create_span( + {"description": "foo", "sentry_tags": {"transaction": "baz"}}, + start_ts=self.ten_mins_ago, + ), + self.create_span( + {"description": "foo", "sentry_tags": {"transaction": "bat"}}, + start_ts=self.ten_mins_ago, + ), + ], + is_eap=self.is_eap, + ) + response = self.do_request( + { + "field": ["transaction", "count()"], + "query": "transaction:[bar, baz]", + "orderby": "transaction", + "project": self.project.id, + "dataset": self.dataset, + } + ) + + assert response.status_code == 200, response.content + data = response.data["data"] + meta = response.data["meta"] + assert len(data) == 2 + assert data == [ + { + "transaction": "bar", + "count()": 1, + }, + { + "transaction": "baz", + "count()": 1, + }, + ] + assert meta["dataset"] == self.dataset + class OrganizationEventsEAPSpanEndpointTest(OrganizationEventsSpanIndexedEndpointTest): is_eap = True