Skip to content

Commit 9faa8b0

Browse files
committed
Path resolution #2
1 parent 0b5f1bc commit 9faa8b0

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

  • dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Framework

‎dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Framework/AgentFactory.cs‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using System.Diagnostics;
77
using System.IO;
88
using System.Linq;
9+
using System.Reflection;
910
using System.Threading;
1011
using System.Threading.Tasks;
1112
using Azure.AI.Agents.Persistent;
@@ -55,13 +56,18 @@ internal static class AgentFactory
5556
AgentCreationOptions creationOptions = new() { Kernel = kernelBuilder.Build() };
5657
AzureAIAgentFactory factory = new();
5758

59+
Console.WriteLine($"ENVIRONMENT: {Environment.CurrentDirectory}");
60+
Console.WriteLine($"APPDOMAIN: {AppDomain.CurrentDomain.BaseDirectory}");
61+
Console.WriteLine($"DIRECTORY: {Directory.GetCurrentDirectory()}");
62+
Console.WriteLine($"ASSEMBLY: {Assembly.GetExecutingAssembly().Location}");
63+
5864
return s_agentMap = (await Task.WhenAll(_agentDefinitions.Select(kvp => CreateAgentAsync(kvp.Key, kvp.Value, cancellationToken)))).ToFrozenDictionary(t => t.Name, t => t.Id);
5965

6066
async Task<(string Name, string? Id)> CreateAgentAsync(string id, string file, CancellationToken cancellationToken)
6167
{
6268
try
6369
{
64-
string filePath = Path.Combine("Agents", file);
70+
string filePath = Path.Combine(Assembly.GetExecutingAssembly().Location, "Agents", file);
6571
Assert.True(File.Exists(filePath), $"Agent definition file not found: {filePath}");
6672

6773
Debug.WriteLine($"TEST AGENT: Creating - {file}");

0 commit comments

Comments
 (0)