@@ -61,9 +61,11 @@ def record(self, span_id: int):
61
61
self .layer .on_record (str (span_id ), """{"version": "memoized"}""" , state )
62
62
63
63
64
- def test_on_new_span_on_close (sentry_init , reset_integrations , capture_events ):
64
+ def test_on_new_span_on_close (sentry_init , capture_events ):
65
65
rust_tracing = FakeRustTracing ()
66
- integration = RustTracingIntegration ("test" , rust_tracing .set_layer_impl )
66
+ integration = RustTracingIntegration (
67
+ "test_on_new_span_on_close" , rust_tracing .set_layer_impl
68
+ )
67
69
sentry_init (integrations = [integration ], traces_sample_rate = 1.0 )
68
70
69
71
events = capture_events ()
@@ -84,7 +86,7 @@ def test_on_new_span_on_close(sentry_init, reset_integrations, capture_events):
84
86
# Ensure the span metadata is wired up
85
87
span = event ["spans" ][0 ]
86
88
assert span ["op" ] == "native_extension"
87
- assert span ["origin" ] == "auto.native_extension.test "
89
+ assert span ["origin" ] == "auto.native_extension.test_on_new_span_on_close "
88
90
assert span ["description" ] == "_bindings::fibonacci"
89
91
90
92
# Ensure the span was opened/closed appropriately
@@ -98,9 +100,11 @@ def test_on_new_span_on_close(sentry_init, reset_integrations, capture_events):
98
100
assert data ["version" ] is None
99
101
100
102
101
- def test_nested_on_new_span_on_close (sentry_init , reset_integrations , capture_events ):
103
+ def test_nested_on_new_span_on_close (sentry_init , capture_events ):
102
104
rust_tracing = FakeRustTracing ()
103
- integration = RustTracingIntegration ("test" , rust_tracing .set_layer_impl )
105
+ integration = RustTracingIntegration (
106
+ "test_nested_on_new_span_on_close" , rust_tracing .set_layer_impl
107
+ )
104
108
sentry_init (integrations = [integration ], traces_sample_rate = 1.0 )
105
109
106
110
events = capture_events ()
@@ -138,10 +142,15 @@ def test_nested_on_new_span_on_close(sentry_init, reset_integrations, capture_ev
138
142
# Ensure the span metadata is wired up for all spans
139
143
first_span , second_span = event ["spans" ]
140
144
assert first_span ["op" ] == "native_extension"
141
- assert first_span ["origin" ] == "auto.native_extension.test"
145
+ assert (
146
+ first_span ["origin" ] == "auto.native_extension.test_nested_on_new_span_on_close"
147
+ )
142
148
assert first_span ["description" ] == "_bindings::fibonacci"
143
149
assert second_span ["op" ] == "native_extension"
144
- assert second_span ["origin" ] == "auto.native_extension.test"
150
+ assert (
151
+ second_span ["origin" ]
152
+ == "auto.native_extension.test_nested_on_new_span_on_close"
153
+ )
145
154
assert second_span ["description" ] == "_bindings::fibonacci"
146
155
147
156
# Ensure the spans were opened/closed appropriately
@@ -164,7 +173,9 @@ def test_nested_on_new_span_on_close(sentry_init, reset_integrations, capture_ev
164
173
165
174
def test_on_new_span_without_transaction (sentry_init , reset_integrations ):
166
175
rust_tracing = FakeRustTracing ()
167
- integration = RustTracingIntegration ("test" , rust_tracing .set_layer_impl )
176
+ integration = RustTracingIntegration (
177
+ "test_on_new_span_without_transaction" , rust_tracing .set_layer_impl
178
+ )
168
179
sentry_init (integrations = [integration ], traces_sample_rate = 1.0 )
169
180
170
181
assert sentry_sdk .get_current_span () is None
@@ -176,10 +187,12 @@ def test_on_new_span_without_transaction(sentry_init, reset_integrations):
176
187
assert current_span .containing_transaction is None
177
188
178
189
179
- def test_on_event_exception (sentry_init , reset_integrations , capture_events ):
190
+ def test_on_event_exception (sentry_init , capture_events ):
180
191
rust_tracing = FakeRustTracing ()
181
192
integration = RustTracingIntegration (
182
- "test" , rust_tracing .set_layer_impl , event_type_mapping = _test_event_type_mapping
193
+ "test_on_event_exception" ,
194
+ rust_tracing .set_layer_impl ,
195
+ event_type_mapping = _test_event_type_mapping ,
183
196
)
184
197
sentry_init (integrations = [integration ], traces_sample_rate = 1.0 )
185
198
@@ -210,10 +223,12 @@ def test_on_event_exception(sentry_init, reset_integrations, capture_events):
210
223
assert field_context ["message" ] == "Getting the 10th fibonacci number"
211
224
212
225
213
- def test_on_event_breadcrumb (sentry_init , reset_integrations , capture_events ):
226
+ def test_on_event_breadcrumb (sentry_init , capture_events ):
214
227
rust_tracing = FakeRustTracing ()
215
228
integration = RustTracingIntegration (
216
- "test" , rust_tracing .set_layer_impl , event_type_mapping = _test_event_type_mapping
229
+ "test_on_event_breadcrumb" ,
230
+ rust_tracing .set_layer_impl ,
231
+ event_type_mapping = _test_event_type_mapping ,
217
232
)
218
233
sentry_init (integrations = [integration ], traces_sample_rate = 1.0 )
219
234
@@ -239,10 +254,12 @@ def test_on_event_breadcrumb(sentry_init, reset_integrations, capture_events):
239
254
assert breadcrumbs [0 ]["type" ] == "default"
240
255
241
256
242
- def test_on_event_event (sentry_init , reset_integrations , capture_events ):
257
+ def test_on_event_event (sentry_init , capture_events ):
243
258
rust_tracing = FakeRustTracing ()
244
259
integration = RustTracingIntegration (
245
- "test" , rust_tracing .set_layer_impl , event_type_mapping = _test_event_type_mapping
260
+ "test_on_event_event" ,
261
+ rust_tracing .set_layer_impl ,
262
+ event_type_mapping = _test_event_type_mapping ,
246
263
)
247
264
sentry_init (integrations = [integration ], traces_sample_rate = 1.0 )
248
265
@@ -274,10 +291,12 @@ def test_on_event_event(sentry_init, reset_integrations, capture_events):
274
291
assert field_context ["message" ] == "Getting the 10th fibonacci number"
275
292
276
293
277
- def test_on_event_ignored (sentry_init , reset_integrations , capture_events ):
294
+ def test_on_event_ignored (sentry_init , capture_events ):
278
295
rust_tracing = FakeRustTracing ()
279
296
integration = RustTracingIntegration (
280
- "test" , rust_tracing .set_layer_impl , event_type_mapping = _test_event_type_mapping
297
+ "test_on_event_ignored" ,
298
+ rust_tracing .set_layer_impl ,
299
+ event_type_mapping = _test_event_type_mapping ,
281
300
)
282
301
sentry_init (integrations = [integration ], traces_sample_rate = 1.0 )
283
302
@@ -298,7 +317,7 @@ def test_on_event_ignored(sentry_init, reset_integrations, capture_events):
298
317
assert "message" not in tx
299
318
300
319
301
- def test_span_filter (sentry_init , reset_integrations , capture_events ):
320
+ def test_span_filter (sentry_init , capture_events ):
302
321
def span_filter (metadata : Dict [str , object ]) -> bool :
303
322
return RustTracingLevel (metadata .get ("level" )) in (
304
323
RustTracingLevel .Error ,
@@ -309,7 +328,7 @@ def span_filter(metadata: Dict[str, object]) -> bool:
309
328
310
329
rust_tracing = FakeRustTracing ()
311
330
integration = RustTracingIntegration (
312
- "test " , rust_tracing .set_layer_impl , span_filter = span_filter
331
+ "test_span_filter " , rust_tracing .set_layer_impl , span_filter = span_filter
313
332
)
314
333
sentry_init (integrations = [integration ], traces_sample_rate = 1.0 )
315
334
@@ -340,7 +359,7 @@ def span_filter(metadata: Dict[str, object]) -> bool:
340
359
341
360
def test_record (sentry_init , reset_integrations ):
342
361
rust_tracing = FakeRustTracing ()
343
- integration = RustTracingIntegration ("test " , rust_tracing .set_layer_impl )
362
+ integration = RustTracingIntegration ("test_record " , rust_tracing .set_layer_impl )
344
363
sentry_init (integrations = [integration ], traces_sample_rate = 1.0 )
345
364
346
365
with start_transaction ():
@@ -362,7 +381,9 @@ def span_filter(metadata: Dict[str, object]) -> bool:
362
381
363
382
rust_tracing = FakeRustTracing ()
364
383
integration = RustTracingIntegration (
365
- "test" , rust_tracing .set_layer_impl , span_filter = span_filter
384
+ "test_record_in_ignored_span" ,
385
+ rust_tracing .set_layer_impl ,
386
+ span_filter = span_filter ,
366
387
)
367
388
sentry_init (integrations = [integration ], traces_sample_rate = 1.0 )
368
389
0 commit comments