From e736705d754f3f3b50103974edb50d6fbc9bf2d5 Mon Sep 17 00:00:00 2001 From: Shyju Krishnankutty Date: Mon, 16 Mar 2026 17:01:18 -0700 Subject: [PATCH 1/2] Run azure functions integration tests in release mode. --- .../SamplesValidation.cs | 4 ++-- .../WorkflowSamplesValidation.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dotnet/tests/Microsoft.Agents.AI.Hosting.AzureFunctions.IntegrationTests/SamplesValidation.cs b/dotnet/tests/Microsoft.Agents.AI.Hosting.AzureFunctions.IntegrationTests/SamplesValidation.cs index bd88c55cb8..5a63547972 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Hosting.AzureFunctions.IntegrationTests/SamplesValidation.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Hosting.AzureFunctions.IntegrationTests/SamplesValidation.cs @@ -825,7 +825,7 @@ private async Task BuildSampleAsync(string samplePath) ProcessStartInfo buildInfo = new() { FileName = "dotnet", - Arguments = $"build -f {s_dotnetTargetFramework}", + Arguments = $"build -f {s_dotnetTargetFramework} -c Release", WorkingDirectory = samplePath, UseShellExecute = false, RedirectStandardOutput = true, @@ -855,7 +855,7 @@ private Process StartFunctionApp(string samplePath, List logs) ProcessStartInfo startInfo = new() { FileName = "dotnet", - Arguments = $"run --no-build -f {s_dotnetTargetFramework} --port {AzureFunctionsPort}", + Arguments = $"run --no-build -f {s_dotnetTargetFramework} -c Release --port {AzureFunctionsPort}", WorkingDirectory = samplePath, UseShellExecute = false, RedirectStandardOutput = true, diff --git a/dotnet/tests/Microsoft.Agents.AI.Hosting.AzureFunctions.IntegrationTests/WorkflowSamplesValidation.cs b/dotnet/tests/Microsoft.Agents.AI.Hosting.AzureFunctions.IntegrationTests/WorkflowSamplesValidation.cs index d5ea083894..bf601f1095 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Hosting.AzureFunctions.IntegrationTests/WorkflowSamplesValidation.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Hosting.AzureFunctions.IntegrationTests/WorkflowSamplesValidation.cs @@ -437,7 +437,7 @@ private Process StartFunctionApp(string samplePath, List logs, bool r ProcessStartInfo startInfo = new() { FileName = "dotnet", - Arguments = $"run -f {s_dotnetTargetFramework} --port {AzureFunctionsPort}", + Arguments = $"run -f {s_dotnetTargetFramework} -c Release --port {AzureFunctionsPort}", WorkingDirectory = samplePath, UseShellExecute = false, RedirectStandardOutput = true, From 81a498e65d96f03cc521d4d405a8ab211f9f79e9 Mon Sep 17 00:00:00 2001 From: Shyju Krishnankutty Date: Mon, 16 Mar 2026 19:08:52 -0700 Subject: [PATCH 2/2] Use debug when in debug build. --- .../SamplesValidation.cs | 10 ++++++++-- .../WorkflowSamplesValidation.cs | 8 +++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/dotnet/tests/Microsoft.Agents.AI.Hosting.AzureFunctions.IntegrationTests/SamplesValidation.cs b/dotnet/tests/Microsoft.Agents.AI.Hosting.AzureFunctions.IntegrationTests/SamplesValidation.cs index 5a63547972..c416fb6a2a 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Hosting.AzureFunctions.IntegrationTests/SamplesValidation.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Hosting.AzureFunctions.IntegrationTests/SamplesValidation.cs @@ -21,6 +21,12 @@ public sealed class SamplesValidation(ITestOutputHelper outputHelper) : IAsyncLi private const string RedisPort = "6379"; private static readonly string s_dotnetTargetFramework = GetTargetFramework(); + +#if DEBUG + private const string BuildConfiguration = "Debug"; +#else + private const string BuildConfiguration = "Release"; +#endif private static readonly HttpClient s_sharedHttpClient = new(); private static readonly IConfiguration s_configuration = new ConfigurationBuilder() @@ -825,7 +831,7 @@ private async Task BuildSampleAsync(string samplePath) ProcessStartInfo buildInfo = new() { FileName = "dotnet", - Arguments = $"build -f {s_dotnetTargetFramework} -c Release", + Arguments = $"build -f {s_dotnetTargetFramework} -c {BuildConfiguration}", WorkingDirectory = samplePath, UseShellExecute = false, RedirectStandardOutput = true, @@ -855,7 +861,7 @@ private Process StartFunctionApp(string samplePath, List logs) ProcessStartInfo startInfo = new() { FileName = "dotnet", - Arguments = $"run --no-build -f {s_dotnetTargetFramework} -c Release --port {AzureFunctionsPort}", + Arguments = $"run --no-build -f {s_dotnetTargetFramework} -c {BuildConfiguration} --port {AzureFunctionsPort}", WorkingDirectory = samplePath, UseShellExecute = false, RedirectStandardOutput = true, diff --git a/dotnet/tests/Microsoft.Agents.AI.Hosting.AzureFunctions.IntegrationTests/WorkflowSamplesValidation.cs b/dotnet/tests/Microsoft.Agents.AI.Hosting.AzureFunctions.IntegrationTests/WorkflowSamplesValidation.cs index bf601f1095..efb02b1aff 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Hosting.AzureFunctions.IntegrationTests/WorkflowSamplesValidation.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Hosting.AzureFunctions.IntegrationTests/WorkflowSamplesValidation.cs @@ -20,6 +20,12 @@ public sealed class WorkflowSamplesValidation(ITestOutputHelper outputHelper) : private const string DtsPort = "8080"; private static readonly string s_dotnetTargetFramework = GetTargetFramework(); + +#if DEBUG + private const string BuildConfiguration = "Debug"; +#else + private const string BuildConfiguration = "Release"; +#endif private static readonly HttpClient s_sharedHttpClient = new(); private static readonly IConfiguration s_configuration = new ConfigurationBuilder() @@ -437,7 +443,7 @@ private Process StartFunctionApp(string samplePath, List logs, bool r ProcessStartInfo startInfo = new() { FileName = "dotnet", - Arguments = $"run -f {s_dotnetTargetFramework} -c Release --port {AzureFunctionsPort}", + Arguments = $"run -f {s_dotnetTargetFramework} -c {BuildConfiguration} --port {AzureFunctionsPort}", WorkingDirectory = samplePath, UseShellExecute = false, RedirectStandardOutput = true,