Skip to content

Commit c692821

Browse files
authored
Address IT failure for V2 (#2421)
1 parent a116eda commit c692821

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

dotnet/tests/AzureAI.IntegrationTests/AIProjectClientCreateTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public class AIProjectClientCreateTests
2828
public async Task CreateAgent_CreatesAgentWithCorrectMetadataAsync(string createMechanism)
2929
{
3030
// Arrange.
31-
const string AgentName = "IntegrationTestAgent";
31+
string AgentName = AIProjectClientFixture.GenerateUniqueAgentName("IntegrationTestAgent");
3232
const string AgentDescription = "An agent created during integration tests";
3333
const string AgentInstructions = "You are an integration test agent";
3434

@@ -86,7 +86,7 @@ public async Task CreateAgent_CreatesAgentWithCorrectMetadataAsync(string create
8686
public async Task CreateAgent_CreatesAgentWithVectorStoresAsync(string createMechanism)
8787
{
8888
// Arrange.
89-
const string AgentName = "VectorStoreAgent";
89+
string AgentName = AIProjectClientFixture.GenerateUniqueAgentName("VectorStoreAgent");
9090
const string AgentInstructions = """
9191
You are a helpful agent that can help fetch data from files you know about.
9292
Use the File Search Tool to look up codes for words.
@@ -159,7 +159,7 @@ You are a helpful agent that can help fetch data from files you know about.
159159
public async Task CreateAgent_CreatesAgentWithCodeInterpreterAsync(string createMechanism)
160160
{
161161
// Arrange.
162-
const string AgentName = "CodeInterpreterAgent";
162+
string AgentName = AIProjectClientFixture.GenerateUniqueAgentName("CodeInterpreterAgent");
163163
const string AgentInstructions = """
164164
You are a helpful coding agent. A Python file is provided. Use the Code Interpreter Tool to run the file
165165
and report the SECRET_NUMBER value it prints. Respond only with the number.
@@ -229,7 +229,7 @@ and report the SECRET_NUMBER value it prints. Respond only with the number.
229229
public async Task CreateAgent_CreatesAgentWithAIFunctionToolsAsync(string createMechanism)
230230
{
231231
// Arrange.
232-
const string AgentName = "WeatherAgent";
232+
string AgentName = AIProjectClientFixture.GenerateUniqueAgentName("WeatherAgent");
233233
const string AgentInstructions = "You are a helpful weather assistant. Always call the GetWeather function to answer questions about weather.";
234234

235235
static string GetWeather(string location) => $"The weather in {location} is sunny with a high of 23C.";

dotnet/tests/AzureAI.IntegrationTests/AIProjectClientFixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public async Task<ChatClientAgent> CreateChatClientAgentAsync(
114114
return await this._client.CreateAIAgentAsync(GenerateUniqueAgentName(name), model: s_config.DeploymentName, instructions: instructions, tools: aiTools);
115115
}
116116

117-
private static string GenerateUniqueAgentName(string baseName) =>
117+
public static string GenerateUniqueAgentName(string baseName) =>
118118
$"{baseName}-{Guid.NewGuid().ToString("N").Substring(0, 8)}";
119119

120120
public Task DeleteAgentAsync(ChatClientAgent agent) =>

0 commit comments

Comments
 (0)