Skip to content

Commit cdd449f

Browse files
committed
make all tests using .test.env
1 parent 0f5feb0 commit cdd449f

File tree

53 files changed

+287
-308
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+287
-308
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.test.env

sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_to_agent.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@
2424
the "Models + endpoints" tab in your Microsoft Foundry project.
2525
3) A2A_PROJECT_CONNECTION_ID - The A2A project connection ID,
2626
as found in the "Connections" tab in your Microsoft Foundry project.
27-
4) (Optional) A2A_ENDPOINT - If the connection is missing target i.e. if it is of "Custom keys" type, we need to set the A2A
27+
4) A2A_ENDPOINT - (Optional) If the connection is missing target i.e. if it is of "Custom keys" type, we need to set the A2A
2828
endpoint on the tool.
29+
5) A2A_USER_INPUT - (Optional) The question to ask. If not set, you will be prompted.
2930
"""
3031

3132
import os
@@ -66,7 +67,9 @@
6667
)
6768
print(f"Agent created (id: {agent.id}, name: {agent.name}, version: {agent.version})")
6869

69-
user_input = input("Enter your question (e.g., 'What can the secondary agent do?'): \n")
70+
user_input = os.environ.get("A2A_USER_INPUT")
71+
if not user_input:
72+
user_input = input("Enter your question (e.g., 'What can the secondary agent do?'): \n")
7073

7174
stream_response = openai_client.responses.create(
7275
stream=True,

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ def test_agent_creation_with_tracing_content_recording_enabled(self, **kwargs):
194194

195195
with self.create_client(operation_group="tracing", **kwargs) as project_client:
196196

197-
model = kwargs.get("azure_ai_projects_tests_model_deployment_name")
197+
model = kwargs.get("AZURE_AI_MODEL_DEPLOYMENT_NAME")
198198
print(f"Using model deployment: {model}")
199199

200200
agent_definition = PromptAgentDefinition(
@@ -288,7 +288,7 @@ def test_agent_creation_with_tracing_content_recording_disabled(self, **kwargs):
288288

289289
with self.create_client(operation_group="agents", **kwargs) as project_client:
290290

291-
model = kwargs.get("azure_ai_projects_tests_model_deployment_name")
291+
model = kwargs.get("AZURE_AI_MODEL_DEPLOYMENT_NAME")
292292
agent_definition = PromptAgentDefinition(
293293
# Required parameter
294294
model=model,
@@ -520,7 +520,7 @@ def test_agent_with_structured_output_with_instructions_content_recording_enable
520520

521521
with self.create_client(operation_group="tracing", **kwargs) as project_client:
522522

523-
model = kwargs.get("azure_ai_projects_tests_model_deployment_name")
523+
model = kwargs.get("AZURE_AI_MODEL_DEPLOYMENT_NAME")
524524

525525
# Define a JSON schema for structured output
526526
test_schema = {
@@ -607,7 +607,7 @@ def test_agent_with_structured_output_with_instructions_content_recording_disabl
607607

608608
with self.create_client(operation_group="agents", **kwargs) as project_client:
609609

610-
model = kwargs.get("azure_ai_projects_tests_model_deployment_name")
610+
model = kwargs.get("AZURE_AI_MODEL_DEPLOYMENT_NAME")
611611

612612
test_schema = {
613613
"type": "object",
@@ -681,7 +681,7 @@ def test_agent_with_structured_output_without_instructions_content_recording_ena
681681

682682
with self.create_client(operation_group="tracing", **kwargs) as project_client:
683683

684-
model = kwargs.get("azure_ai_projects_tests_model_deployment_name")
684+
model = kwargs.get("AZURE_AI_MODEL_DEPLOYMENT_NAME")
685685

686686
test_schema = {
687687
"type": "object",
@@ -763,7 +763,7 @@ def test_agent_with_structured_output_without_instructions_content_recording_dis
763763

764764
with self.create_client(operation_group="agents", **kwargs) as project_client:
765765

766-
model = kwargs.get("azure_ai_projects_tests_model_deployment_name")
766+
model = kwargs.get("AZURE_AI_MODEL_DEPLOYMENT_NAME")
767767

768768
test_schema = {
769769
"type": "object",

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ async def test_create_agent_with_tracing_content_recording_enabled(self, **kwarg
7171
assert True == AIProjectInstrumentor().is_instrumented()
7272

7373
project_client = self.create_async_client(operation_group="tracing", **kwargs)
74-
model = kwargs.get("azure_ai_projects_tests_model_deployment_name")
74+
model = kwargs.get("AZURE_AI_MODEL_DEPLOYMENT_NAME")
7575

7676
async with project_client:
7777
agent_definition = PromptAgentDefinition(
@@ -164,7 +164,7 @@ async def test_agent_creation_with_tracing_content_recording_disabled(self, **kw
164164
assert True == AIProjectInstrumentor().is_instrumented()
165165

166166
project_client = self.create_async_client(operation_group="agents", **kwargs)
167-
model = kwargs.get("azure_ai_projects_tests_model_deployment_name")
167+
model = kwargs.get("AZURE_AI_MODEL_DEPLOYMENT_NAME")
168168

169169
async with project_client:
170170
agent_definition = PromptAgentDefinition(
@@ -399,7 +399,7 @@ async def test_agent_with_structured_output_with_instructions_content_recording_
399399
project_client = self.create_async_client(operation_group="tracing", **kwargs)
400400

401401
async with project_client:
402-
model = kwargs.get("azure_ai_projects_tests_model_deployment_name")
402+
model = kwargs.get("AZURE_AI_MODEL_DEPLOYMENT_NAME")
403403

404404
# Define a JSON schema for structured output
405405
test_schema = {
@@ -489,7 +489,7 @@ async def test_agent_with_structured_output_with_instructions_content_recording_
489489
project_client = self.create_async_client(operation_group="agents", **kwargs)
490490

491491
async with project_client:
492-
model = kwargs.get("azure_ai_projects_tests_model_deployment_name")
492+
model = kwargs.get("AZURE_AI_MODEL_DEPLOYMENT_NAME")
493493

494494
test_schema = {
495495
"type": "object",
@@ -566,7 +566,7 @@ async def test_agent_with_structured_output_without_instructions_content_recordi
566566
project_client = self.create_async_client(operation_group="tracing", **kwargs)
567567

568568
async with project_client:
569-
model = kwargs.get("azure_ai_projects_tests_model_deployment_name")
569+
model = kwargs.get("AZURE_AI_MODEL_DEPLOYMENT_NAME")
570570

571571
test_schema = {
572572
"type": "object",
@@ -649,7 +649,7 @@ async def test_agent_with_structured_output_without_instructions_content_recordi
649649
project_client = self.create_async_client(operation_group="agents", **kwargs)
650650

651651
async with project_client:
652-
model = kwargs.get("azure_ai_projects_tests_model_deployment_name")
652+
model = kwargs.get("AZURE_AI_MODEL_DEPLOYMENT_NAME")
653653

654654
test_schema = {
655655
"type": "object",

0 commit comments

Comments
 (0)