Skip to content

Commit 46aef6a

Browse files
authored
Add test recordings to previously-skipped Agent tracing tests (#44295)
1 parent c26483f commit 46aef6a

File tree

3 files changed

+17
-33
lines changed

3 files changed

+17
-33
lines changed

sdk/ai/azure-ai-projects/assets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"AssetsRepo": "Azure/azure-sdk-assets",
33
"AssetsRepoPrefixPath": "python",
44
"TagPrefix": "python/ai/azure-ai-projects",
5-
"Tag": "python/ai/azure-ai-projects_6bcfd85170"
5+
"Tag": "python/ai/azure-ai-projects_2204ef492a"
66
}

sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor.py

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -741,10 +741,9 @@ def test_sync_non_streaming_without_conversation(self, **kwargs):
741741
events_match = GenAiTraceVerifier().check_span_events(span, expected_events)
742742
assert events_match == True
743743

744-
@pytest.mark.skip(reason="recordings not working for responses API")
745744
@pytest.mark.usefixtures("instrument_with_content")
746745
@servicePreparer()
747-
@recorded_by_proxy
746+
@recorded_by_proxy(RecordedTransport.AZURE_CORE, RecordedTransport.HTTPX)
748747
def test_sync_function_tool_with_content_recording_non_streaming(self, **kwargs):
749748
"""Test synchronous function tool usage with content recording enabled (non-streaming)."""
750749
from openai.types.responses.response_input_param import FunctionCallOutput
@@ -915,10 +914,9 @@ def test_sync_function_tool_with_content_recording_non_streaming(self, **kwargs)
915914
events_match = GenAiTraceVerifier().check_span_events(span2, expected_events_2)
916915
assert events_match == True
917916

918-
@pytest.mark.skip(reason="recordings not working for responses API")
919917
@pytest.mark.usefixtures("instrument_with_content")
920918
@servicePreparer()
921-
@recorded_by_proxy
919+
@recorded_by_proxy(RecordedTransport.AZURE_CORE, RecordedTransport.HTTPX)
922920
def test_sync_function_tool_with_content_recording_streaming(self, **kwargs):
923921
"""Test synchronous function tool usage with content recording enabled (streaming)."""
924922
from openai.types.responses.response_input_param import FunctionCallOutput
@@ -1112,10 +1110,9 @@ def test_sync_function_tool_with_content_recording_streaming(self, **kwargs):
11121110
events_match = GenAiTraceVerifier().check_span_events(span2, expected_events_2)
11131111
assert events_match == True
11141112

1115-
@pytest.mark.skip(reason="recordings not working for responses API")
11161113
@pytest.mark.usefixtures("instrument_without_content")
11171114
@servicePreparer()
1118-
@recorded_by_proxy
1115+
@recorded_by_proxy(RecordedTransport.AZURE_CORE, RecordedTransport.HTTPX)
11191116
def test_sync_function_tool_without_content_recording_non_streaming(self, **kwargs):
11201117
"""Test synchronous function tool usage without content recording (non-streaming)."""
11211118
from openai.types.responses.response_input_param import FunctionCallOutput
@@ -1285,10 +1282,9 @@ def test_sync_function_tool_without_content_recording_non_streaming(self, **kwar
12851282
events_match = GenAiTraceVerifier().check_span_events(span2, expected_events_2)
12861283
assert events_match == True
12871284

1288-
@pytest.mark.skip(reason="recordings not working for responses API")
12891285
@pytest.mark.usefixtures("instrument_without_content")
12901286
@servicePreparer()
1291-
@recorded_by_proxy
1287+
@recorded_by_proxy(RecordedTransport.AZURE_CORE, RecordedTransport.HTTPX)
12921288
def test_sync_function_tool_without_content_recording_streaming(self, **kwargs):
12931289
"""Test synchronous function tool usage without content recording (streaming)."""
12941290
from openai.types.responses.response_input_param import FunctionCallOutput
@@ -1476,10 +1472,9 @@ def test_sync_function_tool_without_content_recording_streaming(self, **kwargs):
14761472
events_match = GenAiTraceVerifier().check_span_events(span2, expected_events_2)
14771473
assert events_match == True
14781474

1479-
@pytest.mark.skip(reason="recordings not working for responses API")
14801475
@pytest.mark.usefixtures("instrument_with_content")
14811476
@servicePreparer()
1482-
@recorded_by_proxy
1477+
@recorded_by_proxy(RecordedTransport.AZURE_CORE, RecordedTransport.HTTPX)
14831478
def test_sync_function_tool_list_conversation_items_with_content_recording(self, **kwargs):
14841479
"""Test listing conversation items after function tool usage with content recording enabled."""
14851480
from openai.types.responses.response_input_param import FunctionCallOutput
@@ -1626,10 +1621,9 @@ def test_sync_function_tool_list_conversation_items_with_content_recording(self,
16261621
events_match = GenAiTraceVerifier().check_span_events(list_span, expected_events)
16271622
assert events_match == True
16281623

1629-
@pytest.mark.skip(reason="recordings not working for responses API")
16301624
@pytest.mark.usefixtures("instrument_without_content")
16311625
@servicePreparer()
1632-
@recorded_by_proxy
1626+
@recorded_by_proxy(RecordedTransport.AZURE_CORE, RecordedTransport.HTTPX)
16331627
def test_sync_function_tool_list_conversation_items_without_content_recording(self, **kwargs):
16341628
"""Test listing conversation items after function tool usage without content recording."""
16351629
from openai.types.responses.response_input_param import FunctionCallOutput
@@ -3825,10 +3819,9 @@ def test_responses_stream_method_with_tools_without_content_recording(self, **kw
38253819
# Workflow Agent Tracing Tests
38263820
# ========================================
38273821

3828-
@pytest.mark.skip(reason="recordings not working for responses API")
38293822
@pytest.mark.usefixtures("instrument_with_content")
38303823
@servicePreparer()
3831-
@recorded_by_proxy
3824+
@recorded_by_proxy(RecordedTransport.AZURE_CORE, RecordedTransport.HTTPX)
38323825
def test_workflow_agent_non_streaming_with_content_recording(self, **kwargs):
38333826
"""Test workflow agent with non-streaming and content recording enabled."""
38343827
from azure.ai.projects.models import (
@@ -4021,10 +4014,9 @@ def test_workflow_agent_non_streaming_with_content_recording(self, **kwargs):
40214014
# With content recording ON, action_id should be present
40224015
assert "action_id" in part["content"]
40234016

4024-
@pytest.mark.skip(reason="recordings not working for responses API")
40254017
@pytest.mark.usefixtures("instrument_without_content")
40264018
@servicePreparer()
4027-
@recorded_by_proxy
4019+
@recorded_by_proxy(RecordedTransport.AZURE_CORE, RecordedTransport.HTTPX)
40284020
def test_workflow_agent_non_streaming_without_content_recording(self, **kwargs):
40294021
"""Test workflow agent with non-streaming and content recording disabled."""
40304022
from azure.ai.projects.models import WorkflowAgentDefinition, AgentReference
@@ -4129,10 +4121,9 @@ def test_workflow_agent_non_streaming_without_content_recording(self, **kwargs):
41294121
assert "action_id" not in part["content"]
41304122
assert "previous_action_id" not in part["content"]
41314123

4132-
@pytest.mark.skip(reason="recordings not working for responses API")
41334124
@pytest.mark.usefixtures("instrument_with_content")
41344125
@servicePreparer()
4135-
@recorded_by_proxy
4126+
@recorded_by_proxy(RecordedTransport.AZURE_CORE, RecordedTransport.HTTPX)
41364127
def test_workflow_agent_streaming_with_content_recording(self, **kwargs):
41374128
"""Test workflow agent with streaming and content recording enabled."""
41384129
from azure.ai.projects.models import (
@@ -4332,10 +4323,9 @@ def test_workflow_agent_streaming_with_content_recording(self, **kwargs):
43324323
# With content recording ON, action_id should be present
43334324
assert "action_id" in part["content"]
43344325

4335-
@pytest.mark.skip(reason="recordings not working for responses API")
43364326
@pytest.mark.usefixtures("instrument_without_content")
43374327
@servicePreparer()
4338-
@recorded_by_proxy
4328+
@recorded_by_proxy(RecordedTransport.AZURE_CORE, RecordedTransport.HTTPX)
43394329
def test_workflow_agent_streaming_without_content_recording(self, **kwargs):
43404330
"""Test workflow agent with streaming and content recording disabled."""
43414331
from azure.ai.projects.models import WorkflowAgentDefinition, AgentReference

sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_async.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -330,10 +330,9 @@ async def test_async_list_conversation_items_with_content_recording(self, **kwar
330330
events_match = GenAiTraceVerifier().check_span_events(span, expected_events)
331331
assert events_match == True
332332

333-
@pytest.mark.skip(reason="recordings not working for responses API")
334333
@pytest.mark.usefixtures("instrument_with_content")
335334
@servicePreparer()
336-
@recorded_by_proxy_async
335+
@recorded_by_proxy_async(RecordedTransport.AZURE_CORE, RecordedTransport.HTTPX)
337336
async def test_async_function_tool_with_content_recording_streaming(self, **kwargs):
338337
"""Test asynchronous function tool usage with content recording enabled (streaming)."""
339338
from openai.types.responses.response_input_param import FunctionCallOutput
@@ -529,10 +528,9 @@ async def test_async_function_tool_with_content_recording_streaming(self, **kwar
529528
events_match = GenAiTraceVerifier().check_span_events(span2, expected_events_2)
530529
assert events_match == True
531530

532-
@pytest.mark.skip(reason="recordings not working for responses API")
533531
@pytest.mark.usefixtures("instrument_without_content")
534532
@servicePreparer()
535-
@recorded_by_proxy_async
533+
@recorded_by_proxy_async(RecordedTransport.AZURE_CORE, RecordedTransport.HTTPX)
536534
async def test_async_function_tool_without_content_recording_streaming(self, **kwargs):
537535
"""Test asynchronous function tool usage without content recording (streaming)."""
538536
from openai.types.responses.response_input_param import FunctionCallOutput
@@ -2817,10 +2815,9 @@ async def test_async_responses_stream_method_with_tools_without_content_recordin
28172815
# Workflow Agent Tracing Tests (Async)
28182816
# ========================================
28192817

2820-
@pytest.mark.skip(reason="recordings not working for responses API")
28212818
@pytest.mark.usefixtures("instrument_with_content")
28222819
@servicePreparer()
2823-
@recorded_by_proxy_async
2820+
@recorded_by_proxy_async(RecordedTransport.AZURE_CORE, RecordedTransport.HTTPX)
28242821
async def test_async_workflow_agent_non_streaming_with_content_recording(self, **kwargs):
28252822
"""Test async workflow agent with non-streaming and content recording enabled."""
28262823
from azure.ai.projects.models import WorkflowAgentDefinition, AgentReference
@@ -2927,10 +2924,9 @@ async def test_async_workflow_agent_non_streaming_with_content_recording(self, *
29272924
# With content recording ON, action_id should be present
29282925
assert "action_id" in part["content"]
29292926

2930-
@pytest.mark.skip(reason="recordings not working for responses API")
29312927
@pytest.mark.usefixtures("instrument_without_content")
29322928
@servicePreparer()
2933-
@recorded_by_proxy_async
2929+
@recorded_by_proxy_async(RecordedTransport.AZURE_CORE, RecordedTransport.HTTPX)
29342930
async def test_async_workflow_agent_non_streaming_without_content_recording(self, **kwargs):
29352931
"""Test async workflow agent with non-streaming and content recording disabled."""
29362932
from azure.ai.projects.models import WorkflowAgentDefinition, AgentReference
@@ -3040,10 +3036,9 @@ async def test_async_workflow_agent_non_streaming_without_content_recording(self
30403036
assert "action_id" not in part["content"]
30413037
assert "previous_action_id" not in part["content"]
30423038

3043-
@pytest.mark.skip(reason="recordings not working for responses API")
30443039
@pytest.mark.usefixtures("instrument_with_content")
30453040
@servicePreparer()
3046-
@recorded_by_proxy_async
3041+
@recorded_by_proxy_async(RecordedTransport.AZURE_CORE, RecordedTransport.HTTPX)
30473042
async def test_async_workflow_agent_streaming_with_content_recording(self, **kwargs):
30483043
"""Test async workflow agent with streaming and content recording enabled."""
30493044
from azure.ai.projects.models import WorkflowAgentDefinition, AgentReference
@@ -3154,10 +3149,9 @@ async def test_async_workflow_agent_streaming_with_content_recording(self, **kwa
31543149
# With content recording ON, action_id should be present
31553150
assert "action_id" in part["content"]
31563151

3157-
@pytest.mark.skip(reason="recordings not working for responses API")
31583152
@pytest.mark.usefixtures("instrument_without_content")
31593153
@servicePreparer()
3160-
@recorded_by_proxy_async
3154+
@recorded_by_proxy_async(RecordedTransport.AZURE_CORE, RecordedTransport.HTTPX)
31613155
async def test_async_workflow_agent_streaming_without_content_recording(self, **kwargs):
31623156
"""Test async workflow agent with streaming and content recording disabled."""
31633157
from azure.ai.projects.models import WorkflowAgentDefinition, AgentReference

0 commit comments

Comments
 (0)