Skip to content

Commit

Permalink
chore(rpc): Adding a small in filter test (#81966)
Browse files Browse the repository at this point in the history
- Adding a quick in filter test to check that a bug we're seeing isn't
caused by the backend
  • Loading branch information
wmak authored and evanh committed Dec 17, 2024
1 parent 036ba53 commit 166c0dd
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions tests/snuba/api/endpoints/test_organization_events_span_indexed.py
Original file line number Diff line number Diff line change
Expand Up @@ -874,6 +874,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
Expand Down

0 comments on commit 166c0dd

Please sign in to comment.