Skip to content

Commit 1642354

Browse files
authored
tests(eap): Move events trace light tests to eap (#97582)
These tests don't seem to be querying spans at all as they use the transactions dataset. They just happen to be inserting data into the spans dataset as part of the helper functions that are being used. Simply redirecting them to storing things in EAP should be enough.
1 parent dc6c46b commit 1642354

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

tests/snuba/api/endpoints/test_organization_events_trace.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def setUp(self):
4545
},
4646
)
4747

48-
def load_trace(self, is_eap=False):
48+
def load_trace(self, is_eap=True):
4949
self.root_event = self.create_event(
5050
trace_id=self.trace_id,
5151
transaction="root",
@@ -228,6 +228,7 @@ def test_no_roots(self) -> None:
228228
spans=[],
229229
parent_span_id=parent_span_id,
230230
project_id=self.project.id,
231+
is_eap=True,
231232
)
232233
url = reverse(
233234
"sentry-api-0-organization-events-trace-light",
@@ -262,6 +263,7 @@ def test_multiple_roots(self) -> None:
262263
spans=[],
263264
parent_span_id=None,
264265
project_id=self.project.id,
266+
is_eap=True,
265267
)
266268
with self.feature(self.FEATURES):
267269
data: dict[str, str | int] = {"event_id": second_root.event_id, "project": -1}
@@ -309,6 +311,7 @@ def test_root_with_multiple_roots(self) -> None:
309311
spans=[],
310312
parent_span_id=None,
311313
project_id=self.project.id,
314+
is_eap=True,
312315
)
313316
with self.feature(self.FEATURES):
314317
response = self.client.get(
@@ -380,6 +383,7 @@ def test_direct_parent_with_children_and_multiple_root(self) -> None:
380383
spans=[],
381384
parent_span_id=None,
382385
project_id=self.project.id,
386+
is_eap=True,
383387
)
384388

385389
with self.feature(self.FEATURES):
@@ -467,6 +471,7 @@ def test_sibling_transactions(self) -> None:
467471
project_id=self.create_project(organization=self.organization).id,
468472
parent_span_id=self.gen2_span_ids[1],
469473
milliseconds=500,
474+
is_eap=True,
470475
).event_id,
471476
self.create_event(
472477
trace_id=self.trace_id,
@@ -475,6 +480,7 @@ def test_sibling_transactions(self) -> None:
475480
project_id=self.create_project(organization=self.organization).id,
476481
parent_span_id=self.gen2_span_ids[1],
477482
milliseconds=1500,
483+
is_eap=True,
478484
).event_id,
479485
]
480486

@@ -795,6 +801,7 @@ def test_detailed_trace_with_bad_tags(self) -> None:
795801
tags=[["somethinglong" * 250, "somethinglong" * 250]],
796802
milliseconds=3000,
797803
store_event_kwargs={"assert_no_errors": False},
804+
is_eap=True,
798805
)
799806

800807
url = reverse(
@@ -839,6 +846,7 @@ def test_bad_span_loop(self) -> None:
839846
],
840847
parent_span_id=self.gen2_span_ids[1],
841848
project_id=self.project.id,
849+
is_eap=True,
842850
)
843851

844852
with self.feature(self.FEATURES):
@@ -878,6 +886,7 @@ def test_bad_orphan_span_loop(self) -> None:
878886
project_id=self.project.id,
879887
milliseconds=3000,
880888
start_timestamp=self.day_ago - timedelta(minutes=1),
889+
is_eap=True,
881890
)
882891
orphan_child = self.create_event(
883892
trace_id=self.trace_id,
@@ -894,6 +903,7 @@ def test_bad_orphan_span_loop(self) -> None:
894903
parent_span_id=root_span_id,
895904
project_id=self.project.id,
896905
milliseconds=300,
906+
is_eap=True,
897907
)
898908
with self.feature(self.FEATURES):
899909
response = self.client_get(
@@ -920,6 +930,7 @@ def test_multiple_roots(self) -> None:
920930
parent_span_id=None,
921931
project_id=self.project.id,
922932
milliseconds=500,
933+
is_eap=True,
923934
)
924935
second_root = self.create_event(
925936
trace_id=trace_id,
@@ -928,6 +939,7 @@ def test_multiple_roots(self) -> None:
928939
parent_span_id=None,
929940
project_id=self.project.id,
930941
milliseconds=1000,
942+
is_eap=True,
931943
)
932944
self.url = reverse(
933945
self.url_name,
@@ -957,6 +969,7 @@ def test_sibling_transactions(self) -> None:
957969
project_id=self.create_project(organization=self.organization).id,
958970
parent_span_id=self.gen2_span_ids[1],
959971
milliseconds=1000,
972+
is_eap=True,
960973
).event_id,
961974
self.create_event(
962975
trace_id=self.trace_id,
@@ -965,6 +978,7 @@ def test_sibling_transactions(self) -> None:
965978
project_id=self.create_project(organization=self.organization).id,
966979
parent_span_id=self.gen2_span_ids[1],
967980
milliseconds=2000,
981+
is_eap=True,
968982
).event_id,
969983
]
970984

@@ -992,6 +1006,7 @@ def test_with_orphan_siblings(self) -> None:
9921006
project_id=self.project.id,
9931007
# Shorter duration means that this event happened first, and should be ordered first
9941008
milliseconds=1000,
1009+
is_eap=True,
9951010
)
9961011
root_sibling_event = self.create_event(
9971012
trace_id=self.trace_id,
@@ -1000,6 +1015,7 @@ def test_with_orphan_siblings(self) -> None:
10001015
parent_span_id=parent_span_id,
10011016
project_id=self.project.id,
10021017
milliseconds=2000,
1018+
is_eap=True,
10031019
)
10041020

10051021
with self.feature(self.FEATURES):
@@ -1042,6 +1058,7 @@ def test_with_orphan_trace(self) -> None:
10421058
project_id=self.project.id,
10431059
milliseconds=3000,
10441060
start_timestamp=self.day_ago - timedelta(minutes=1),
1061+
is_eap=True,
10451062
)
10461063
child_event = self.create_event(
10471064
trace_id=self.trace_id,
@@ -1061,6 +1078,7 @@ def test_with_orphan_trace(self) -> None:
10611078
# Because the snuba query orders based is_root then timestamp, this causes grandchild1-0 to be added to
10621079
# results first before child1-0
10631080
milliseconds=2000,
1081+
is_eap=True,
10641082
)
10651083
grandchild_event = self.create_event(
10661084
trace_id=self.trace_id,
@@ -1078,6 +1096,7 @@ def test_with_orphan_trace(self) -> None:
10781096
span_id=orphan_span_ids["grandchild"],
10791097
project_id=self.gen1_project.id,
10801098
milliseconds=1000,
1099+
is_eap=True,
10811100
)
10821101

10831102
with self.feature(self.FEATURES):

0 commit comments

Comments
 (0)