Skip to content

Commit a00b61f

Browse files
committed
More fetch_normalized_spans
1 parent 153f703 commit a00b61f

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

Diff for: tests/test_tracing.py

+14-12
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ def test_disabled_tracing():
288288

289289

290290
def enabled_trace_disabled_span():
291-
with trace(workflow_name="test", trace_id="123"):
291+
with trace(workflow_name="test", trace_id="trace_123"):
292292
with agent_span(name="agent_1"):
293293
with function_span(name="function_1", disabled=True):
294294
with generation_span():
@@ -298,17 +298,19 @@ def enabled_trace_disabled_span():
298298
def test_enabled_trace_disabled_span():
299299
enabled_trace_disabled_span()
300300

301-
spans, traces = fetch_ordered_spans(), fetch_traces()
302-
assert len(spans) == 1 # Only the agent span is recorded
303-
assert len(traces) == 1 # The trace is recorded
304-
305-
trace = traces[0]
306-
standard_trace_checks(trace, name_check="test")
307-
trace_id = trace.trace_id
308-
309-
first_span = spans[0]
310-
standard_span_checks(first_span, trace_id=trace_id, parent_id=None, span_type="agent")
311-
assert first_span.span_data.name == "agent_1"
301+
assert fetch_normalized_spans() == snapshot(
302+
[
303+
{
304+
"workflow_name": "test",
305+
"children": [
306+
{
307+
"type": "agent",
308+
"data": {"name": "agent_1"},
309+
}
310+
],
311+
}
312+
]
313+
)
312314

313315

314316
def test_start_and_end_called_manual():

0 commit comments

Comments
 (0)