From 3ac826d0ef60ed3900b7be11cc121f15eddef9a0 Mon Sep 17 00:00:00 2001 From: Chidozie Ononiwu Date: Thu, 29 Jan 2026 23:46:23 -0800 Subject: [PATCH 1/7] Extend testing infrastructure for Remote MCP --- .../Client/CommandTestsBase.cs | 216 ++++++++++++++++-- .../Client/RecordedCommandTestsBase.cs | 3 + 2 files changed, 196 insertions(+), 23 deletions(-) diff --git a/core/Azure.Mcp.Core/tests/Azure.Mcp.Tests/Client/CommandTestsBase.cs b/core/Azure.Mcp.Core/tests/Azure.Mcp.Tests/Client/CommandTestsBase.cs index dcc683ee0e..f4db3c20b7 100644 --- a/core/Azure.Mcp.Core/tests/Azure.Mcp.Tests/Client/CommandTestsBase.cs +++ b/core/Azure.Mcp.Core/tests/Azure.Mcp.Tests/Client/CommandTestsBase.cs @@ -1,6 +1,9 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +using System.Diagnostics; +using System.Net; +using System.Net.Sockets; using System.Text; using System.Text.Json; using System.Text.Json.Nodes; @@ -9,11 +12,17 @@ using ModelContextProtocol.Client; using ModelContextProtocol.Protocol; using Xunit; +using static System.Net.WebRequestMethods; namespace Azure.Mcp.Tests.Client; public abstract class CommandTestsBase(ITestOutputHelper output) : IAsyncLifetime, IDisposable { + private HttpClient? _http; + private Process? _httpServerProcess; + private static string? _baseUrl => Environment.GetEnvironmentVariable("ASPNETCORE_URLS"); + private static bool UseHttp => string.Equals(Environment.GetEnvironmentVariable("MCP_TEST_TRANSPORT"), "http", StringComparison.OrdinalIgnoreCase); + protected const string TenantNameReason = "Service principals cannot use TenantName for lookup"; protected McpClient Client { get; private set; } = default!; @@ -78,20 +87,119 @@ protected virtual async ValueTask LoadSettingsAsync() } } - protected virtual async ValueTask InitializeAsyncInternal(TestProxyFixture? proxy = null) + /// + /// Creates a stdio transport for local process-based testing. + /// + /// Optional test proxy fixture to configure environment variables for playback or recording. + private async Task CreateStdioTransportAsync(TestProxyFixture? proxy, string executablePath, List arguments) { - await LoadSettingsAsync(); + string[] args = arguments.ToArray(); + var envVarDictionary = GetEnvironmentVariables(proxy); - string executablePath = McpTestUtilities.GetAzMcpExecutablePath(); + StdioClientTransportOptions transportOptions = new() + { + Name = "Test Server", + Command = executablePath, + Arguments = args, + // Direct stderr to test output helper as required by task + StandardErrorLines = line => Output.WriteLine($"[MCP Server] {line}"), + EnvironmentVariables = envVarDictionary + }; - // Use custom arguments if provided, otherwise use standard mode (debug can be enabled via environment variable) - var debugEnvVar = Environment.GetEnvironmentVariable("AZURE_MCP_TEST_DEBUG"); - var enableDebug = string.Equals(debugEnvVar, "true", StringComparison.OrdinalIgnoreCase) || Settings.DebugOutput; - string[] defaultArgs = enableDebug - ? ["server", "start", "--mode", "all", "--debug"] - : ["server", "start", "--mode", "all"]; - var arguments = CustomArguments ?? defaultArgs; + if (!string.IsNullOrEmpty(Settings.TestPackage)) + { + Environment.CurrentDirectory = Settings.SettingsDirectory; + transportOptions.Command = "npx"; + transportOptions.Arguments = ["-y", Settings.TestPackage, .. args]; + } + + return await Task.FromResult(new StdioClientTransport(transportOptions)); + } + + /// + /// Creates an HTTP (SSE) transport for remote server testing. + /// Set MCP_TEST_SERVER_URL environment variable to specify the server URL. + /// + /// Optional test proxy fixture to configure environment variables for playback or recording. + private async Task CreateHttpClientAsync(TestProxyFixture? proxy) + { + _http = new HttpClient(); + + if (proxy?.Proxy != null) + { + _http.DefaultRequestHeaders.TryAddWithoutValidation("x-recording-upstream-base-uri", _baseUrl); + _http.DefaultRequestHeaders.TryAddWithoutValidation( + "x-recording-mode", TestMode is TestMode.Playback ? "playback" : TestMode is TestMode.Record ? "record" : "live"); + } + + await Task.CompletedTask; + } + + protected void SetHttpRecordingId(string recordingId) + { + if (_http != null && !string.IsNullOrEmpty(recordingId)) + { + if (_http.DefaultRequestHeaders.Contains("x-recording-id")) + { + _http.DefaultRequestHeaders.Remove("x-recording-id"); + } + _http.DefaultRequestHeaders.TryAddWithoutValidation("x-recording-id", recordingId); + } + } + + private async Task CallToolOverHttpAsync(string command, Dictionary parameters) + { + var request = new + { + jsonrpc = "2.0", + method = "tools/call", + @params = new { name = command, arguments = parameters }, + id = Guid.NewGuid().ToString() + }; + + var uri = $"{_baseUrl}/mcp"; + var content = new StringContent(JsonSerializer.Serialize(request), Encoding.UTF8, "application/json"); + var resp = await _http!.PostAsync(uri, content); + var body = await resp.Content.ReadAsStringAsync(); + resp.EnsureSuccessStatusCode(); + + var root = JsonSerializer.Deserialize(body); + if (root.TryGetProperty("result", out var result) && + result.TryGetProperty("results", out var results)) + { + return results; + } + return null; + } + + private async Task StartHttpServerProcessAsync(TestProxyFixture? proxy, string executablePath, List arguments) + { + // Configure arguments for HTTP mode + arguments.AddRange(new[] { "--transport", "http", "--outgoing-auth-strategy", "UseHostingEnvironmentIdentity" }); + var envVarDictionary = GetEnvironmentVariables(proxy); + + var processStartInfo = new ProcessStartInfo(executablePath, string.Join(" ", arguments.ToArray())) + { + RedirectStandardOutput = true, + RedirectStandardError = true, + }; + + foreach (var kvp in envVarDictionary) + { + if (kvp.Value != null) + { + processStartInfo.Environment[kvp.Key] = kvp.Value; + } + } + + _httpServerProcess = Process.Start(processStartInfo); + + await WaitForServerReadinessAsync(_baseUrl); + } + + private Dictionary GetEnvironmentVariables(TestProxyFixture? proxy) + { Dictionary envVarDictionary = [ // Propagate playback signaling & sanitized identifiers to server process. @@ -111,24 +219,66 @@ protected virtual async ValueTask InitializeAsyncInternal(TestProxyFixture? prox } } - StdioClientTransportOptions transportOptions = new() + // Add any custom environment variables from settings + if (Settings?.EnvironmentVariables != null) { - Name = "Test Server", - Command = executablePath, - Arguments = arguments, - // Direct stderr to test output helper as required by task - StandardErrorLines = line => Output.WriteLine($"[MCP Server] {line}"), - EnvironmentVariables = envVarDictionary - }; + foreach (var kvp in Settings.EnvironmentVariables) + { + envVarDictionary[kvp.Key] = kvp.Value; + } + } - if (!string.IsNullOrEmpty(Settings.TestPackage)) + return envVarDictionary; + } + + private async Task WaitForServerReadinessAsync(string? uri, int timeoutSeconds = 30, int pollIntervalMs = 500) + { + using var httpClient = new HttpClient(); + var timeout = TimeSpan.FromSeconds(timeoutSeconds); + var stopwatch = Stopwatch.StartNew(); + + while (stopwatch.Elapsed < timeout) { - Environment.CurrentDirectory = Settings.SettingsDirectory; - transportOptions.Command = "npx"; - transportOptions.Arguments = ["-y", Settings.TestPackage, .. arguments]; + try + { + var response = await httpClient.GetAsync(uri); + if (response.IsSuccessStatusCode) + { + return; // Server is ready + } + } + catch (HttpRequestException) + { + // Server not yet available, continue polling + } + await Task.Delay(pollIntervalMs); + } + + throw new TimeoutException($"Server at {uri} did not become ready within {timeoutSeconds} seconds"); + } + + protected virtual async ValueTask InitializeAsyncInternal(TestProxyFixture? proxy = null) + { + await LoadSettingsAsync(); + string executablePath = McpTestUtilities.GetAzMcpExecutablePath(); + + // Use custom arguments if provided, otherwise use standard mode (debug can be enabled via environment variable) + var debugEnvVar = Environment.GetEnvironmentVariable("AZURE_MCP_TEST_DEBUG"); + var enableDebug = string.Equals(debugEnvVar, "true", StringComparison.OrdinalIgnoreCase) || Settings.DebugOutput; + List defaultArgs = enableDebug + ? ["server", "start", "--mode", "all", "--debug"] + : ["server", "start", "--mode", "all"]; + var arguments = CustomArguments?.ToList() ?? defaultArgs; + + if (UseHttp) + { + await CreateHttpClientAsync(proxy); + await StartHttpServerProcessAsync(proxy, executablePath, arguments); + Output.WriteLine($"HTTP test client initialized at {_baseUrl}"); + return; } - var clientTransport = new StdioClientTransport(transportOptions); + var clientTransport = await CreateStdioTransportAsync(proxy, executablePath, arguments); Output.WriteLine("Attempting to start MCP Client"); Client = await McpClient.CreateAsync(clientTransport); Output.WriteLine("MCP client initialized successfully"); @@ -136,6 +286,8 @@ protected virtual async ValueTask InitializeAsyncInternal(TestProxyFixture? prox protected Task CallToolAsync(string command, Dictionary parameters) { + if (UseHttp && _http != null) + return CallToolOverHttpAsync(command, parameters); return CallToolAsync(command, parameters, Client); } @@ -223,6 +375,24 @@ protected virtual void Dispose(bool disposing) { disposable.Dispose(); } + + if (_httpServerProcess != null) + { + try + { + if (!_httpServerProcess.HasExited) + { + _httpServerProcess.Kill(); + _httpServerProcess.WaitForExit(2000); + } + } + catch { } + finally + { + _httpServerProcess.Dispose(); + _httpServerProcess = null; + } + } } // Failure output may contain request and response details that should be output for failed tests. diff --git a/core/Azure.Mcp.Core/tests/Azure.Mcp.Tests/Client/RecordedCommandTestsBase.cs b/core/Azure.Mcp.Core/tests/Azure.Mcp.Tests/Client/RecordedCommandTestsBase.cs index b5bba60d7a..1299c19abd 100644 --- a/core/Azure.Mcp.Core/tests/Azure.Mcp.Tests/Client/RecordedCommandTestsBase.cs +++ b/core/Azure.Mcp.Core/tests/Azure.Mcp.Tests/Client/RecordedCommandTestsBase.cs @@ -153,6 +153,9 @@ public override async ValueTask InitializeAsync() // start recording/playback session await StartRecordOrPlayback(); + // Ensure HTTP client has the recording ID if we are using HTTP transport + SetHttpRecordingId(RecordingId); + // apply custom matcher if test has attribute await ApplyAttributeMatcherSettings(); From e9254738a6b9eb44a30bc2ace99552a6689c937c Mon Sep 17 00:00:00 2001 From: Chidozie Ononiwu Date: Mon, 2 Feb 2026 15:37:32 -0800 Subject: [PATCH 2/7] Update test resource Depolyment to allow http mode --- .../Client/CommandTestsBase.cs | 123 ++++++++++++++---- .../TestResources/New-TestResources.ps1 | 5 +- eng/scripts/Deploy-TestResources.ps1 | 5 +- eng/scripts/helpers/TestResourcesHelpers.ps1 | 8 +- .../src/Properties/launchSettings.json | 7 +- .../Azure.Mcp.Tools.Acr.LiveTests.csproj | 13 ++ .../tests/test-resources-post.ps1 | 3 +- 7 files changed, 132 insertions(+), 32 deletions(-) diff --git a/core/Azure.Mcp.Core/tests/Azure.Mcp.Tests/Client/CommandTestsBase.cs b/core/Azure.Mcp.Core/tests/Azure.Mcp.Tests/Client/CommandTestsBase.cs index f4db3c20b7..c054ad0ba9 100644 --- a/core/Azure.Mcp.Core/tests/Azure.Mcp.Tests/Client/CommandTestsBase.cs +++ b/core/Azure.Mcp.Core/tests/Azure.Mcp.Tests/Client/CommandTestsBase.cs @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +using System.Buffers.Text; using System.Diagnostics; -using System.Net; -using System.Net.Sockets; +using System.Net.Http.Headers; using System.Text; using System.Text.Json; using System.Text.Json.Nodes; @@ -157,17 +157,42 @@ protected void SetHttpRecordingId(string recordingId) id = Guid.NewGuid().ToString() }; - var uri = $"{_baseUrl}/mcp"; var content = new StringContent(JsonSerializer.Serialize(request), Encoding.UTF8, "application/json"); - var resp = await _http!.PostAsync(uri, content); - var body = await resp.Content.ReadAsStringAsync(); - resp.EnsureSuccessStatusCode(); + using var requestMessage = new HttpRequestMessage(HttpMethod.Post, _baseUrl) + { + Content = content + }; + requestMessage.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); + requestMessage.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("text/event-stream")); - var root = JsonSerializer.Deserialize(body); - if (root.TryGetProperty("result", out var result) && - result.TryGetProperty("results", out var results)) + var resp = await _http!.SendAsync(requestMessage); + if (resp.IsSuccessStatusCode) { - return results; + var body = await resp.Content.ReadAsStringAsync(); + var json = ExtractJsonFromSse(body); + if (json == null) + { + return null; + } + var root = JsonSerializer.Deserialize(json); + if (root.TryGetProperty("result", out var result) && + result.TryGetProperty("content", out var contentArray) && + contentArray.GetArrayLength() > 0) + { + var firstContent = contentArray[0]; + if (firstContent.TryGetProperty("text", out var textElement)) + { + var textContent = textElement.GetString(); + if (!string.IsNullOrEmpty(textContent)) + { + var parsed = JsonSerializer.Deserialize(textContent); + if (parsed.TryGetProperty("results", out var results)) + { + return results; + } + } + } + } } return null; } @@ -175,7 +200,7 @@ protected void SetHttpRecordingId(string recordingId) private async Task StartHttpServerProcessAsync(TestProxyFixture? proxy, string executablePath, List arguments) { // Configure arguments for HTTP mode - arguments.AddRange(new[] { "--transport", "http", "--outgoing-auth-strategy", "UseHostingEnvironmentIdentity" }); + arguments.AddRange(new[] { "--transport", "http", "--outgoing-auth-strategy", "UseHostingEnvironmentIdentity", "--dangerously-disable-http-incoming-auth" }); var envVarDictionary = GetEnvironmentVariables(proxy); @@ -195,7 +220,7 @@ private async Task StartHttpServerProcessAsync(TestProxyFixture? proxy, string e _httpServerProcess = Process.Start(processStartInfo); - await WaitForServerReadinessAsync(_baseUrl); + await WaitForServerReadinessAsync(); } private Dictionary GetEnvironmentVariables(TestProxyFixture? proxy) @@ -231,30 +256,74 @@ private async Task StartHttpServerProcessAsync(TestProxyFixture? proxy, string e return envVarDictionary; } - private async Task WaitForServerReadinessAsync(string? uri, int timeoutSeconds = 30, int pollIntervalMs = 500) + private async Task WaitForServerReadinessAsync(int timeoutSeconds = 60, int pollIntervalMs = 500) { - using var httpClient = new HttpClient(); - var timeout = TimeSpan.FromSeconds(timeoutSeconds); - var stopwatch = Stopwatch.StartNew(); + if (string.IsNullOrWhiteSpace(_baseUrl)) + { + throw new ArgumentException("Base URL is not set (ASPNETCORE_URLS)."); + } + + var deadline = DateTime.UtcNow.AddSeconds(timeoutSeconds); - while (stopwatch.Elapsed < timeout) + while (DateTime.UtcNow < deadline) { try { - var response = await httpClient.GetAsync(uri); - if (response.IsSuccessStatusCode) + var request = new { - return; // Server is ready + jsonrpc = "2.0", + method = "tools/list", + @params = new { }, + id = Guid.NewGuid().ToString() + }; + + var content = new StringContent(JsonSerializer.Serialize(request), Encoding.UTF8, "application/json"); + using var requestMessage = new HttpRequestMessage(HttpMethod.Post, _baseUrl) + { + Content = content + }; + requestMessage.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); + requestMessage.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("text/event-stream")); + using var resp = await _http!.SendAsync(requestMessage); + if (resp.IsSuccessStatusCode) + { + return; } } - catch (HttpRequestException) + catch { - // Server not yet available, continue polling + // swallow and retry } + await Task.Delay(pollIntervalMs); } - throw new TimeoutException($"Server at {uri} did not become ready within {timeoutSeconds} seconds"); + throw new TimeoutException($"MCP server at {_baseUrl} did not become ready within {timeoutSeconds} seconds."); + } + + private static string? ExtractJsonFromSse(string response) + { + var trimmed = response.TrimStart(); + if (trimmed.StartsWith('{')) + { + return response; + } + + foreach (var line in response.Split('\n')) + { + var cleanLine = line.Trim(); + + if (cleanLine.StartsWith("data:", StringComparison.Ordinal)) + { + var jsonPart = cleanLine[5..].TrimStart(); // Remove "data:" and any leading whitespace + if (jsonPart.StartsWith('{')) + { + return jsonPart; + } + } + } + + return null; } protected virtual async ValueTask InitializeAsyncInternal(TestProxyFixture? proxy = null) @@ -356,6 +425,11 @@ public void Dispose() public virtual async ValueTask DisposeAsync() { await DisposeAsyncCore().ConfigureAwait(false); + if (_http is not null) + { + _http.Dispose(); + _http = null; + } Dispose(disposing: false); GC.SuppressFinalize(this); } @@ -406,6 +480,7 @@ protected virtual void Dispose(bool disposing) // overrides should still call base.DisposeAsyncCore() protected virtual async ValueTask DisposeAsyncCore() { - await Client.DisposeAsync().ConfigureAwait(false); + if (Client != null) + await Client.DisposeAsync().ConfigureAwait(false); } } diff --git a/eng/common/TestResources/New-TestResources.ps1 b/eng/common/TestResources/New-TestResources.ps1 index 1acc02fe42..1deff320d8 100755 --- a/eng/common/TestResources/New-TestResources.ps1 +++ b/eng/common/TestResources/New-TestResources.ps1 @@ -119,7 +119,10 @@ param ( # hotfix branches if and when the dynamic subscription configuration # secrets get updated to add new parameters. [Parameter(ValueFromRemainingArguments = $true)] - $NewTestResourcesRemainingArguments + $NewTestResourcesRemainingArguments, + + [Parameter()] + [switch] $UseHttpTransport ) . (Join-Path $PSScriptRoot .. scripts common.ps1) diff --git a/eng/scripts/Deploy-TestResources.ps1 b/eng/scripts/Deploy-TestResources.ps1 index 4d8dd647bf..da37fb51b5 100644 --- a/eng/scripts/Deploy-TestResources.ps1 +++ b/eng/scripts/Deploy-TestResources.ps1 @@ -6,7 +6,8 @@ param( [string]$BaseName, [int]$DeleteAfterHours = 12, [switch]$Unique, - [switch]$Parallel + [switch]$Parallel, + [switch] $UseHttpTransport ) $ErrorActionPreference = 'Stop' @@ -94,6 +95,7 @@ Deploying$($AsJob ? ' in background job' : ''): -BaseName $BaseName ` -TestResourcesDirectory $testResourcesDirectory ` -DeleteAfterHours $DeleteAfterHours ` + -UseHttpTransport:$UseHttpTransport ` -Force } -ArgumentList $RepoRoot, $SubscriptionId, $ResourceGroupName, $BaseName, $TestResourcesDirectory, $DeleteAfterHours @@ -104,6 +106,7 @@ Deploying$($AsJob ? ' in background job' : ''): -BaseName $BaseName ` -TestResourcesDirectory $testResourcesDirectory ` -DeleteAfterHours $DeleteAfterHours ` + -UseHttpTransport:$UseHttpTransport ` -Force } } diff --git a/eng/scripts/helpers/TestResourcesHelpers.ps1 b/eng/scripts/helpers/TestResourcesHelpers.ps1 index ec74d3e5a8..e82ec9eb6d 100644 --- a/eng/scripts/helpers/TestResourcesHelpers.ps1 +++ b/eng/scripts/helpers/TestResourcesHelpers.ps1 @@ -17,7 +17,8 @@ function New-TestSettings { [string] $ResourceGroupName, [string] $BaseName, [hashtable] $DeploymentOutputs, - [string] $OutputPath + [string] $OutputPath, + [switch] $UseHttpTransport ) if($env:ARM_OIDC_TOKEN -and $TenantId -and $TestApplicationId) { @@ -59,6 +60,11 @@ function New-TestSettings { TestMode = "Live" } + if ($UseHttpTransport) { + $testSettings.EnvironmentVariables["MCP_TEST_TRANSPORT"] = "http" + $testSettings.EnvironmentVariables["ASPNETCORE_URLS"] = "http://localhost:1031" + } + # Add DeploymentOutputs if provided if($DeploymentOutputs -and $DeploymentOutputs.Count -gt 0) { $testSettings.DeploymentOutputs = $DeploymentOutputs diff --git a/servers/Azure.Mcp.Server/src/Properties/launchSettings.json b/servers/Azure.Mcp.Server/src/Properties/launchSettings.json index bffcb4ab1d..4a3a90752f 100644 --- a/servers/Azure.Mcp.Server/src/Properties/launchSettings.json +++ b/servers/Azure.Mcp.Server/src/Properties/launchSettings.json @@ -2,12 +2,12 @@ "profiles": { "debug-remotemcp": { "commandName": "Project", - "commandLineArgs": "server start --transport http --outgoing-auth-strategy UseHostingEnvironmentIdentity", + "commandLineArgs": "server start --transport http --outgoing-auth-strategy UseHostingEnvironmentIdentity --dangerously-disable-http-incoming-auth", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development", "ASPNETCORE_URLS": "http://localhost:1031", "AzureAd__TenantId": "70a036f6-8e4d-4615-bad6-149c02e7720d", - "AzureAd__ClientId": "ca1e0302-d50a-47d7-b5e6-7aff49884bce", + "AzureAd__ClientId": "2d83e5a3-929f-49d5-9835-516849ceb9f4", "AzureAd__Instance": "https://login.microsoftonline.com/" }, "dotnetRunMessages": true @@ -21,5 +21,4 @@ "dotnetRunMessages": true } }, - "$schema": "https://json.schemastore.org/launchsettings.json" -} \ No newline at end of file + "$schema": "https://json.schemastore.org/launchsettings.json" \ No newline at end of file diff --git a/tools/Azure.Mcp.Tools.Acr/tests/Azure.Mcp.Tools.Acr.LiveTests/Azure.Mcp.Tools.Acr.LiveTests.csproj b/tools/Azure.Mcp.Tools.Acr/tests/Azure.Mcp.Tools.Acr.LiveTests/Azure.Mcp.Tools.Acr.LiveTests.csproj index e74f8b0ff2..b728b56757 100644 --- a/tools/Azure.Mcp.Tools.Acr/tests/Azure.Mcp.Tools.Acr.LiveTests/Azure.Mcp.Tools.Acr.LiveTests.csproj +++ b/tools/Azure.Mcp.Tools.Acr/tests/Azure.Mcp.Tools.Acr.LiveTests/Azure.Mcp.Tools.Acr.LiveTests.csproj @@ -14,5 +14,18 @@ + + + True + True + Resources.resx + + + + + ResXFileCodeGenerator + Resources.Designer.cs + + diff --git a/tools/Azure.Mcp.Tools.Acr/tests/test-resources-post.ps1 b/tools/Azure.Mcp.Tools.Acr/tests/test-resources-post.ps1 index eadf2c4fdb..15eb93bf4a 100644 --- a/tools/Azure.Mcp.Tools.Acr/tests/test-resources-post.ps1 +++ b/tools/Azure.Mcp.Tools.Acr/tests/test-resources-post.ps1 @@ -3,7 +3,8 @@ param( [string] $TestApplicationId, [string] $ResourceGroupName, [string] $BaseName, - [hashtable] $DeploymentOutputs + [hashtable] $DeploymentOutputs, + [switch] $UseHttpTransport ) $ErrorActionPreference = "Stop" From 00f200263bda347947d3a8efc870d297575d1a97 Mon Sep 17 00:00:00 2001 From: Chidozie Ononiwu Date: Mon, 2 Feb 2026 19:08:46 -0800 Subject: [PATCH 3/7] Update test-resources-post file to take UseHttpTransport --- core/Azure.Mcp.Core/tests/test-resources-post.ps1 | 3 ++- tools/Azure.Mcp.Tools.Aks/tests/test-resources-post.ps1 | 3 ++- .../Azure.Mcp.Tools.AppConfig/tests/test-resources-post.ps1 | 3 ++- .../Azure.Mcp.Tools.AppService/tests/test-resources-post.ps1 | 3 ++- .../tests/test-resources-post.ps1 | 3 ++- tools/Azure.Mcp.Tools.AzureIsv/tests/test-resources-post.ps1 | 3 ++- .../tests/test-resources-post.ps1 | 3 ++- .../tests/test-resources-post.ps1 | 3 ++- tools/Azure.Mcp.Tools.Cosmos/tests/test-resources-post.ps1 | 3 ++- tools/Azure.Mcp.Tools.Deploy/tests/test-resources-post.ps1 | 3 ++- .../Azure.Mcp.Tools.EventGrid/tests/test-resources-post.ps1 | 3 ++- .../Azure.Mcp.Tools.EventHubs/tests/test-resources-post.ps1 | 3 ++- .../Azure.Mcp.Tools.FileShares/tests/test-resources-post.ps1 | 3 ++- tools/Azure.Mcp.Tools.Foundry/tests/test-resources-post.ps1 | 3 ++- .../tests/test-resources-post.ps1 | 3 ++- tools/Azure.Mcp.Tools.Grafana/tests/test-resources-post.ps1 | 3 ++- tools/Azure.Mcp.Tools.KeyVault/tests/test-resources-post.ps1 | 3 ++- tools/Azure.Mcp.Tools.Kusto/tests/test-resources-post.ps1 | 3 ++- .../tests/test-resources-post.ps1 | 3 ++- .../tests/test-resources-post.ps1 | 3 ++- .../tests/test-resources-post.ps1 | 3 ++- tools/Azure.Mcp.Tools.Monitor/tests/test-resources-post.ps1 | 3 ++- tools/Azure.Mcp.Tools.Postgres/tests/test-resources-post.ps1 | 3 ++- tools/Azure.Mcp.Tools.Quota/tests/test-resources-post.ps1 | 3 ++- tools/Azure.Mcp.Tools.Redis/tests/test-resources-post.ps1 | 3 ++- .../tests/test-resources-post.ps1 | 3 ++- tools/Azure.Mcp.Tools.Search/tests/test-resources-post.ps1 | 3 ++- .../Azure.Mcp.Tools.ServiceBus/tests/test-resources-post.ps1 | 3 ++- tools/Azure.Mcp.Tools.SignalR/tests/test-resources-post.ps1 | 5 +++-- tools/Azure.Mcp.Tools.Speech/tests/test-resources-post.ps1 | 3 ++- tools/Azure.Mcp.Tools.Sql/tests/test-resources-post.ps1 | 3 ++- tools/Azure.Mcp.Tools.Storage/tests/test-resources-post.ps1 | 3 ++- .../tests/test-resources-post.ps1 | 3 ++- .../tests/test-resources-post.ps1 | 3 ++- .../Azure.Mcp.Tools.Workbooks/tests/test-resources-post.ps1 | 3 ++- 35 files changed, 71 insertions(+), 36 deletions(-) diff --git a/core/Azure.Mcp.Core/tests/test-resources-post.ps1 b/core/Azure.Mcp.Core/tests/test-resources-post.ps1 index b02b0a155c..035ff0c14b 100644 --- a/core/Azure.Mcp.Core/tests/test-resources-post.ps1 +++ b/core/Azure.Mcp.Core/tests/test-resources-post.ps1 @@ -3,7 +3,8 @@ param( [string] $TestApplicationId, [string] $ResourceGroupName, [string] $BaseName, - [hashtable] $DeploymentOutputs + [hashtable] $DeploymentOutputs, + [switch] $UseHttpTransport ) $ErrorActionPreference = "Stop" diff --git a/tools/Azure.Mcp.Tools.Aks/tests/test-resources-post.ps1 b/tools/Azure.Mcp.Tools.Aks/tests/test-resources-post.ps1 index b02b0a155c..035ff0c14b 100644 --- a/tools/Azure.Mcp.Tools.Aks/tests/test-resources-post.ps1 +++ b/tools/Azure.Mcp.Tools.Aks/tests/test-resources-post.ps1 @@ -3,7 +3,8 @@ param( [string] $TestApplicationId, [string] $ResourceGroupName, [string] $BaseName, - [hashtable] $DeploymentOutputs + [hashtable] $DeploymentOutputs, + [switch] $UseHttpTransport ) $ErrorActionPreference = "Stop" diff --git a/tools/Azure.Mcp.Tools.AppConfig/tests/test-resources-post.ps1 b/tools/Azure.Mcp.Tools.AppConfig/tests/test-resources-post.ps1 index b02b0a155c..035ff0c14b 100644 --- a/tools/Azure.Mcp.Tools.AppConfig/tests/test-resources-post.ps1 +++ b/tools/Azure.Mcp.Tools.AppConfig/tests/test-resources-post.ps1 @@ -3,7 +3,8 @@ param( [string] $TestApplicationId, [string] $ResourceGroupName, [string] $BaseName, - [hashtable] $DeploymentOutputs + [hashtable] $DeploymentOutputs, + [switch] $UseHttpTransport ) $ErrorActionPreference = "Stop" diff --git a/tools/Azure.Mcp.Tools.AppService/tests/test-resources-post.ps1 b/tools/Azure.Mcp.Tools.AppService/tests/test-resources-post.ps1 index 7f236b6ded..edd50f74cb 100644 --- a/tools/Azure.Mcp.Tools.AppService/tests/test-resources-post.ps1 +++ b/tools/Azure.Mcp.Tools.AppService/tests/test-resources-post.ps1 @@ -3,7 +3,8 @@ param( [string] $TestApplicationId, [string] $ResourceGroupName, [string] $BaseName, - [hashtable] $DeploymentOutputs + [hashtable] $DeploymentOutputs, + [switch] $UseHttpTransport ) $ErrorActionPreference = "Stop" diff --git a/tools/Azure.Mcp.Tools.Authorization/tests/test-resources-post.ps1 b/tools/Azure.Mcp.Tools.Authorization/tests/test-resources-post.ps1 index b02b0a155c..035ff0c14b 100644 --- a/tools/Azure.Mcp.Tools.Authorization/tests/test-resources-post.ps1 +++ b/tools/Azure.Mcp.Tools.Authorization/tests/test-resources-post.ps1 @@ -3,7 +3,8 @@ param( [string] $TestApplicationId, [string] $ResourceGroupName, [string] $BaseName, - [hashtable] $DeploymentOutputs + [hashtable] $DeploymentOutputs, + [switch] $UseHttpTransport ) $ErrorActionPreference = "Stop" diff --git a/tools/Azure.Mcp.Tools.AzureIsv/tests/test-resources-post.ps1 b/tools/Azure.Mcp.Tools.AzureIsv/tests/test-resources-post.ps1 index b02b0a155c..035ff0c14b 100644 --- a/tools/Azure.Mcp.Tools.AzureIsv/tests/test-resources-post.ps1 +++ b/tools/Azure.Mcp.Tools.AzureIsv/tests/test-resources-post.ps1 @@ -3,7 +3,8 @@ param( [string] $TestApplicationId, [string] $ResourceGroupName, [string] $BaseName, - [hashtable] $DeploymentOutputs + [hashtable] $DeploymentOutputs, + [switch] $UseHttpTransport ) $ErrorActionPreference = "Stop" diff --git a/tools/Azure.Mcp.Tools.Communication/tests/test-resources-post.ps1 b/tools/Azure.Mcp.Tools.Communication/tests/test-resources-post.ps1 index a5d9203c7e..a981a1f1bb 100644 --- a/tools/Azure.Mcp.Tools.Communication/tests/test-resources-post.ps1 +++ b/tools/Azure.Mcp.Tools.Communication/tests/test-resources-post.ps1 @@ -3,7 +3,8 @@ param( [string] $TestApplicationId, [string] $ResourceGroupName, [string] $BaseName, - [hashtable] $DeploymentOutputs + [hashtable] $DeploymentOutputs, + [switch] $UseHttpTransport ) $ErrorActionPreference = "Stop" diff --git a/tools/Azure.Mcp.Tools.ConfidentialLedger/tests/test-resources-post.ps1 b/tools/Azure.Mcp.Tools.ConfidentialLedger/tests/test-resources-post.ps1 index 7e9855c9b6..2004ed11f4 100644 --- a/tools/Azure.Mcp.Tools.ConfidentialLedger/tests/test-resources-post.ps1 +++ b/tools/Azure.Mcp.Tools.ConfidentialLedger/tests/test-resources-post.ps1 @@ -3,7 +3,8 @@ param( [string] $TestApplicationId, [string] $ResourceGroupName, [string] $BaseName, - [hashtable] $DeploymentOutputs + [hashtable] $DeploymentOutputs, + [switch] $UseHttpTransport ) $ErrorActionPreference = "Stop" diff --git a/tools/Azure.Mcp.Tools.Cosmos/tests/test-resources-post.ps1 b/tools/Azure.Mcp.Tools.Cosmos/tests/test-resources-post.ps1 index b02b0a155c..035ff0c14b 100644 --- a/tools/Azure.Mcp.Tools.Cosmos/tests/test-resources-post.ps1 +++ b/tools/Azure.Mcp.Tools.Cosmos/tests/test-resources-post.ps1 @@ -3,7 +3,8 @@ param( [string] $TestApplicationId, [string] $ResourceGroupName, [string] $BaseName, - [hashtable] $DeploymentOutputs + [hashtable] $DeploymentOutputs, + [switch] $UseHttpTransport ) $ErrorActionPreference = "Stop" diff --git a/tools/Azure.Mcp.Tools.Deploy/tests/test-resources-post.ps1 b/tools/Azure.Mcp.Tools.Deploy/tests/test-resources-post.ps1 index b02b0a155c..035ff0c14b 100644 --- a/tools/Azure.Mcp.Tools.Deploy/tests/test-resources-post.ps1 +++ b/tools/Azure.Mcp.Tools.Deploy/tests/test-resources-post.ps1 @@ -3,7 +3,8 @@ param( [string] $TestApplicationId, [string] $ResourceGroupName, [string] $BaseName, - [hashtable] $DeploymentOutputs + [hashtable] $DeploymentOutputs, + [switch] $UseHttpTransport ) $ErrorActionPreference = "Stop" diff --git a/tools/Azure.Mcp.Tools.EventGrid/tests/test-resources-post.ps1 b/tools/Azure.Mcp.Tools.EventGrid/tests/test-resources-post.ps1 index ed88461abf..07c5fb036c 100644 --- a/tools/Azure.Mcp.Tools.EventGrid/tests/test-resources-post.ps1 +++ b/tools/Azure.Mcp.Tools.EventGrid/tests/test-resources-post.ps1 @@ -3,7 +3,8 @@ param( [string] $TestApplicationId, [string] $ResourceGroupName, [string] $BaseName, - [hashtable] $DeploymentOutputs + [hashtable] $DeploymentOutputs, + [switch] $UseHttpTransport ) $ErrorActionPreference = "Stop" diff --git a/tools/Azure.Mcp.Tools.EventHubs/tests/test-resources-post.ps1 b/tools/Azure.Mcp.Tools.EventHubs/tests/test-resources-post.ps1 index 0e23373fd1..2b25bb0f78 100644 --- a/tools/Azure.Mcp.Tools.EventHubs/tests/test-resources-post.ps1 +++ b/tools/Azure.Mcp.Tools.EventHubs/tests/test-resources-post.ps1 @@ -3,7 +3,8 @@ param( [string] $TestApplicationId, [string] $ResourceGroupName, [string] $BaseName, - [hashtable] $DeploymentOutputs + [hashtable] $DeploymentOutputs, + [switch] $UseHttpTransport ) $ErrorActionPreference = "Stop" diff --git a/tools/Azure.Mcp.Tools.FileShares/tests/test-resources-post.ps1 b/tools/Azure.Mcp.Tools.FileShares/tests/test-resources-post.ps1 index 4cc9257d89..33824225ec 100644 --- a/tools/Azure.Mcp.Tools.FileShares/tests/test-resources-post.ps1 +++ b/tools/Azure.Mcp.Tools.FileShares/tests/test-resources-post.ps1 @@ -3,7 +3,8 @@ param( [string] $TestApplicationId, [string] $ResourceGroupName, [string] $BaseName, - [hashtable] $DeploymentOutputs + [hashtable] $DeploymentOutputs, + [switch] $UseHttpTransport ) $ErrorActionPreference = "Stop" diff --git a/tools/Azure.Mcp.Tools.Foundry/tests/test-resources-post.ps1 b/tools/Azure.Mcp.Tools.Foundry/tests/test-resources-post.ps1 index 290922fc53..ad17d053ec 100644 --- a/tools/Azure.Mcp.Tools.Foundry/tests/test-resources-post.ps1 +++ b/tools/Azure.Mcp.Tools.Foundry/tests/test-resources-post.ps1 @@ -3,7 +3,8 @@ param( [string] $TestApplicationId, [string] $ResourceGroupName, [string] $BaseName, - [hashtable] $DeploymentOutputs + [hashtable] $DeploymentOutputs, + [switch] $UseHttpTransport ) $ErrorActionPreference = "Stop" diff --git a/tools/Azure.Mcp.Tools.FunctionApp/tests/test-resources-post.ps1 b/tools/Azure.Mcp.Tools.FunctionApp/tests/test-resources-post.ps1 index 8500e72a8c..771fb4fa06 100644 --- a/tools/Azure.Mcp.Tools.FunctionApp/tests/test-resources-post.ps1 +++ b/tools/Azure.Mcp.Tools.FunctionApp/tests/test-resources-post.ps1 @@ -3,7 +3,8 @@ param( [string] $TestApplicationId, [string] $ResourceGroupName, [string] $BaseName, - [hashtable] $DeploymentOutputs + [hashtable] $DeploymentOutputs, + [switch] $UseHttpTransport ) $ErrorActionPreference = "Stop" diff --git a/tools/Azure.Mcp.Tools.Grafana/tests/test-resources-post.ps1 b/tools/Azure.Mcp.Tools.Grafana/tests/test-resources-post.ps1 index 54dbd8877e..0b40228bcb 100644 --- a/tools/Azure.Mcp.Tools.Grafana/tests/test-resources-post.ps1 +++ b/tools/Azure.Mcp.Tools.Grafana/tests/test-resources-post.ps1 @@ -3,7 +3,8 @@ param( [string] $TestApplicationId, [string] $ResourceGroupName, [string] $BaseName, - [hashtable] $DeploymentOutputs + [hashtable] $DeploymentOutputs, + [switch] $UseHttpTransport ) # cspell: words GRAFANAWORKSPACENAME diff --git a/tools/Azure.Mcp.Tools.KeyVault/tests/test-resources-post.ps1 b/tools/Azure.Mcp.Tools.KeyVault/tests/test-resources-post.ps1 index 56032cd740..49fee78e44 100644 --- a/tools/Azure.Mcp.Tools.KeyVault/tests/test-resources-post.ps1 +++ b/tools/Azure.Mcp.Tools.KeyVault/tests/test-resources-post.ps1 @@ -3,7 +3,8 @@ param( [string] $TestApplicationId, [string] $ResourceGroupName, [string] $BaseName, - [hashtable] $DeploymentOutputs + [hashtable] $DeploymentOutputs, + [switch] $UseHttpTransport ) $ErrorActionPreference = "Stop" diff --git a/tools/Azure.Mcp.Tools.Kusto/tests/test-resources-post.ps1 b/tools/Azure.Mcp.Tools.Kusto/tests/test-resources-post.ps1 index b02b0a155c..035ff0c14b 100644 --- a/tools/Azure.Mcp.Tools.Kusto/tests/test-resources-post.ps1 +++ b/tools/Azure.Mcp.Tools.Kusto/tests/test-resources-post.ps1 @@ -3,7 +3,8 @@ param( [string] $TestApplicationId, [string] $ResourceGroupName, [string] $BaseName, - [hashtable] $DeploymentOutputs + [hashtable] $DeploymentOutputs, + [switch] $UseHttpTransport ) $ErrorActionPreference = "Stop" diff --git a/tools/Azure.Mcp.Tools.LoadTesting/tests/test-resources-post.ps1 b/tools/Azure.Mcp.Tools.LoadTesting/tests/test-resources-post.ps1 index b02b0a155c..035ff0c14b 100644 --- a/tools/Azure.Mcp.Tools.LoadTesting/tests/test-resources-post.ps1 +++ b/tools/Azure.Mcp.Tools.LoadTesting/tests/test-resources-post.ps1 @@ -3,7 +3,8 @@ param( [string] $TestApplicationId, [string] $ResourceGroupName, [string] $BaseName, - [hashtable] $DeploymentOutputs + [hashtable] $DeploymentOutputs, + [switch] $UseHttpTransport ) $ErrorActionPreference = "Stop" diff --git a/tools/Azure.Mcp.Tools.ManagedLustre/tests/test-resources-post.ps1 b/tools/Azure.Mcp.Tools.ManagedLustre/tests/test-resources-post.ps1 index 2ff192dda8..923a785ff5 100644 --- a/tools/Azure.Mcp.Tools.ManagedLustre/tests/test-resources-post.ps1 +++ b/tools/Azure.Mcp.Tools.ManagedLustre/tests/test-resources-post.ps1 @@ -3,7 +3,8 @@ param( [string] $TestApplicationId, [string] $ResourceGroupName, [string] $BaseName, - [hashtable] $DeploymentOutputs + [hashtable] $DeploymentOutputs, + [switch] $UseHttpTransport ) $ErrorActionPreference = "Stop" diff --git a/tools/Azure.Mcp.Tools.Marketplace/tests/test-resources-post.ps1 b/tools/Azure.Mcp.Tools.Marketplace/tests/test-resources-post.ps1 index b02b0a155c..035ff0c14b 100644 --- a/tools/Azure.Mcp.Tools.Marketplace/tests/test-resources-post.ps1 +++ b/tools/Azure.Mcp.Tools.Marketplace/tests/test-resources-post.ps1 @@ -3,7 +3,8 @@ param( [string] $TestApplicationId, [string] $ResourceGroupName, [string] $BaseName, - [hashtable] $DeploymentOutputs + [hashtable] $DeploymentOutputs, + [switch] $UseHttpTransport ) $ErrorActionPreference = "Stop" diff --git a/tools/Azure.Mcp.Tools.Monitor/tests/test-resources-post.ps1 b/tools/Azure.Mcp.Tools.Monitor/tests/test-resources-post.ps1 index a80f2ed6a7..e82d1813ad 100644 --- a/tools/Azure.Mcp.Tools.Monitor/tests/test-resources-post.ps1 +++ b/tools/Azure.Mcp.Tools.Monitor/tests/test-resources-post.ps1 @@ -3,7 +3,8 @@ param( [string] $TestApplicationId, [string] $ResourceGroupName, [string] $BaseName, - [hashtable] $DeploymentOutputs + [hashtable] $DeploymentOutputs, + [switch] $UseHttpTransport ) $ErrorActionPreference = "Stop" diff --git a/tools/Azure.Mcp.Tools.Postgres/tests/test-resources-post.ps1 b/tools/Azure.Mcp.Tools.Postgres/tests/test-resources-post.ps1 index 5b30a91de6..8f1b411101 100644 --- a/tools/Azure.Mcp.Tools.Postgres/tests/test-resources-post.ps1 +++ b/tools/Azure.Mcp.Tools.Postgres/tests/test-resources-post.ps1 @@ -4,7 +4,8 @@ param( [string] $TestApplicationId, [string] $ResourceGroupName, [string] $BaseName, - [hashtable] $DeploymentOutputs + [hashtable] $DeploymentOutputs, + [switch] $UseHttpTransport ) $ErrorActionPreference = "Stop" diff --git a/tools/Azure.Mcp.Tools.Quota/tests/test-resources-post.ps1 b/tools/Azure.Mcp.Tools.Quota/tests/test-resources-post.ps1 index b02b0a155c..035ff0c14b 100644 --- a/tools/Azure.Mcp.Tools.Quota/tests/test-resources-post.ps1 +++ b/tools/Azure.Mcp.Tools.Quota/tests/test-resources-post.ps1 @@ -3,7 +3,8 @@ param( [string] $TestApplicationId, [string] $ResourceGroupName, [string] $BaseName, - [hashtable] $DeploymentOutputs + [hashtable] $DeploymentOutputs, + [switch] $UseHttpTransport ) $ErrorActionPreference = "Stop" diff --git a/tools/Azure.Mcp.Tools.Redis/tests/test-resources-post.ps1 b/tools/Azure.Mcp.Tools.Redis/tests/test-resources-post.ps1 index b02b0a155c..035ff0c14b 100644 --- a/tools/Azure.Mcp.Tools.Redis/tests/test-resources-post.ps1 +++ b/tools/Azure.Mcp.Tools.Redis/tests/test-resources-post.ps1 @@ -3,7 +3,8 @@ param( [string] $TestApplicationId, [string] $ResourceGroupName, [string] $BaseName, - [hashtable] $DeploymentOutputs + [hashtable] $DeploymentOutputs, + [switch] $UseHttpTransport ) $ErrorActionPreference = "Stop" diff --git a/tools/Azure.Mcp.Tools.ResourceHealth/tests/test-resources-post.ps1 b/tools/Azure.Mcp.Tools.ResourceHealth/tests/test-resources-post.ps1 index 7dcef8d5c6..8d7b42d76b 100644 --- a/tools/Azure.Mcp.Tools.ResourceHealth/tests/test-resources-post.ps1 +++ b/tools/Azure.Mcp.Tools.ResourceHealth/tests/test-resources-post.ps1 @@ -9,7 +9,8 @@ [CmdletBinding()] param ( [Parameter(Mandatory)] - [hashtable] $AdditionalParameters + [hashtable] $AdditionalParameters, + [switch] $UseHttpTransport ) Write-Host "Running ResourceHealth post-deployment setup..." diff --git a/tools/Azure.Mcp.Tools.Search/tests/test-resources-post.ps1 b/tools/Azure.Mcp.Tools.Search/tests/test-resources-post.ps1 index dddeaa41ae..d4453c66a4 100644 --- a/tools/Azure.Mcp.Tools.Search/tests/test-resources-post.ps1 +++ b/tools/Azure.Mcp.Tools.Search/tests/test-resources-post.ps1 @@ -3,7 +3,8 @@ param( [string] $TestApplicationId, [string] $ResourceGroupName, [string] $BaseName, - [hashtable] $DeploymentOutputs + [hashtable] $DeploymentOutputs, + [switch] $UseHttpTransport ) diff --git a/tools/Azure.Mcp.Tools.ServiceBus/tests/test-resources-post.ps1 b/tools/Azure.Mcp.Tools.ServiceBus/tests/test-resources-post.ps1 index b02b0a155c..035ff0c14b 100644 --- a/tools/Azure.Mcp.Tools.ServiceBus/tests/test-resources-post.ps1 +++ b/tools/Azure.Mcp.Tools.ServiceBus/tests/test-resources-post.ps1 @@ -3,7 +3,8 @@ param( [string] $TestApplicationId, [string] $ResourceGroupName, [string] $BaseName, - [hashtable] $DeploymentOutputs + [hashtable] $DeploymentOutputs, + [switch] $UseHttpTransport ) $ErrorActionPreference = "Stop" diff --git a/tools/Azure.Mcp.Tools.SignalR/tests/test-resources-post.ps1 b/tools/Azure.Mcp.Tools.SignalR/tests/test-resources-post.ps1 index a4e75d14a1..771fb4fa06 100644 --- a/tools/Azure.Mcp.Tools.SignalR/tests/test-resources-post.ps1 +++ b/tools/Azure.Mcp.Tools.SignalR/tests/test-resources-post.ps1 @@ -1,9 +1,10 @@ -param( +param( [string] $TenantId, [string] $TestApplicationId, [string] $ResourceGroupName, [string] $BaseName, - [hashtable] $DeploymentOutputs + [hashtable] $DeploymentOutputs, + [switch] $UseHttpTransport ) $ErrorActionPreference = "Stop" diff --git a/tools/Azure.Mcp.Tools.Speech/tests/test-resources-post.ps1 b/tools/Azure.Mcp.Tools.Speech/tests/test-resources-post.ps1 index 8d3d637c55..2aec8b6d0a 100644 --- a/tools/Azure.Mcp.Tools.Speech/tests/test-resources-post.ps1 +++ b/tools/Azure.Mcp.Tools.Speech/tests/test-resources-post.ps1 @@ -3,7 +3,8 @@ param( [string] $TestApplicationId, [string] $ResourceGroupName, [string] $BaseName, - [hashtable] $DeploymentOutputs + [hashtable] $DeploymentOutputs, + [switch] $UseHttpTransport ) $ErrorActionPreference = "Stop" diff --git a/tools/Azure.Mcp.Tools.Sql/tests/test-resources-post.ps1 b/tools/Azure.Mcp.Tools.Sql/tests/test-resources-post.ps1 index 117bde3cfb..6776da8725 100644 --- a/tools/Azure.Mcp.Tools.Sql/tests/test-resources-post.ps1 +++ b/tools/Azure.Mcp.Tools.Sql/tests/test-resources-post.ps1 @@ -3,7 +3,8 @@ param( [string] $TestApplicationId, [string] $ResourceGroupName, [string] $BaseName, - [hashtable] $DeploymentOutputs + [hashtable] $DeploymentOutputs, + [switch] $UseHttpTransport ) $ErrorActionPreference = "Stop" diff --git a/tools/Azure.Mcp.Tools.Storage/tests/test-resources-post.ps1 b/tools/Azure.Mcp.Tools.Storage/tests/test-resources-post.ps1 index 1cfb33128a..4349af356c 100644 --- a/tools/Azure.Mcp.Tools.Storage/tests/test-resources-post.ps1 +++ b/tools/Azure.Mcp.Tools.Storage/tests/test-resources-post.ps1 @@ -3,7 +3,8 @@ param( [string] $TestApplicationId, [string] $ResourceGroupName, [string] $BaseName, - [hashtable] $DeploymentOutputs + [hashtable] $DeploymentOutputs, + [switch] $UseHttpTransport ) $ErrorActionPreference = "Stop" diff --git a/tools/Azure.Mcp.Tools.StorageSync/tests/test-resources-post.ps1 b/tools/Azure.Mcp.Tools.StorageSync/tests/test-resources-post.ps1 index 34115f9490..0ed950af83 100644 --- a/tools/Azure.Mcp.Tools.StorageSync/tests/test-resources-post.ps1 +++ b/tools/Azure.Mcp.Tools.StorageSync/tests/test-resources-post.ps1 @@ -3,7 +3,8 @@ param( [string] $TestApplicationId, [string] $ResourceGroupName, [string] $BaseName, - [hashtable] $DeploymentOutputs + [hashtable] $DeploymentOutputs, + [switch] $UseHttpTransport ) $ErrorActionPreference = "Stop" diff --git a/tools/Azure.Mcp.Tools.VirtualDesktop/tests/test-resources-post.ps1 b/tools/Azure.Mcp.Tools.VirtualDesktop/tests/test-resources-post.ps1 index 897e5e72e0..68452cbf4c 100644 --- a/tools/Azure.Mcp.Tools.VirtualDesktop/tests/test-resources-post.ps1 +++ b/tools/Azure.Mcp.Tools.VirtualDesktop/tests/test-resources-post.ps1 @@ -3,7 +3,8 @@ param( [string] $TestApplicationId, [string] $ResourceGroupName, [string] $BaseName, - [hashtable] $DeploymentOutputs + [hashtable] $DeploymentOutputs, + [switch] $UseHttpTransport ) $ErrorActionPreference = "Stop" diff --git a/tools/Azure.Mcp.Tools.Workbooks/tests/test-resources-post.ps1 b/tools/Azure.Mcp.Tools.Workbooks/tests/test-resources-post.ps1 index b02b0a155c..035ff0c14b 100644 --- a/tools/Azure.Mcp.Tools.Workbooks/tests/test-resources-post.ps1 +++ b/tools/Azure.Mcp.Tools.Workbooks/tests/test-resources-post.ps1 @@ -3,7 +3,8 @@ param( [string] $TestApplicationId, [string] $ResourceGroupName, [string] $BaseName, - [hashtable] $DeploymentOutputs + [hashtable] $DeploymentOutputs, + [switch] $UseHttpTransport ) $ErrorActionPreference = "Stop" From 8fb0b5179f688adad6d4d85c79158f081a0197f2 Mon Sep 17 00:00:00 2001 From: Chidozie Ononiwu Date: Mon, 2 Feb 2026 19:38:11 -0800 Subject: [PATCH 4/7] Update live test pipeline to run test usig http transport --- .../TestResources/deploy-test-resources.yml | 3 ++ eng/pipelines/templates/jobs/live-test.yml | 29 ++++++++++++++++++- eng/scripts/Deploy-TestResources.ps1 | 2 +- .../src/Properties/launchSettings.json | 7 +++-- .../Azure.Mcp.Tools.Acr.LiveTests.csproj | 14 --------- 5 files changed, 36 insertions(+), 19 deletions(-) diff --git a/eng/common/TestResources/deploy-test-resources.yml b/eng/common/TestResources/deploy-test-resources.yml index 30efe36e23..a8545029fc 100644 --- a/eng/common/TestResources/deploy-test-resources.yml +++ b/eng/common/TestResources/deploy-test-resources.yml @@ -11,6 +11,7 @@ parameters: UseFederatedAuth: true PersistOidcToken: false SelfContainedPostScript: self-contained-test-resources-post.ps1 + UseHttpTransport: false # SubscriptionConfiguration will be splatted into the parameters of the test # resources script. It should be JSON in the form: @@ -108,6 +109,7 @@ steps: -SelfContainedPostScript $postScriptPath ` -CI ` -Force ` + -UseHttpTransport:('${{ parameters.UseHttpTransport }}' -eq 'true') ` -Verbose | Out-Null - ${{ if eq(parameters.PersistOidcToken, true) }}: @@ -153,6 +155,7 @@ steps: -CI ` -ServicePrincipalAuth ` -Force ` + -UseHttpTransport:('${{ parameters.UseHttpTransport }}' -eq 'true') ` -Verbose | Out-Null displayName: 🚀 Deploy test resources env: diff --git a/eng/pipelines/templates/jobs/live-test.yml b/eng/pipelines/templates/jobs/live-test.yml index 04b0f3d3ac..e18aec1bfc 100644 --- a/eng/pipelines/templates/jobs/live-test.yml +++ b/eng/pipelines/templates/jobs/live-test.yml @@ -62,7 +62,34 @@ jobs: TestResourcesDirectory: $(Build.SourcesDirectory)/$(TestResourcesPath) - task: AzurePowershell@5 - displayName: "Run tests - az pwsh" + displayName: "Run tests (stdio) - az pwsh" + env: + AZURE_TEST_MODE: 'live' + SYSTEM_ACCESSTOKEN: $(System.AccessToken) + AZURE_MCP_COLLECT_TELEMETRY: 'false' + inputs: + azureSubscription: azure-sdk-tests-public + azurePowerShellVersion: 'LatestVersion' + scriptType: InlineScript + Inline: | + ./eng/scripts/Test-Code.ps1 ` + -TestType 'Live' ` + -Path $(PathToTest) ` + -TestResultsPath '$(Build.ArtifactStagingDirectory)/testResults' + + exit $LastExitCode + pwsh: true + workingDirectory: $(Build.SourcesDirectory) + + - template: /eng/common/TestResources/deploy-test-resources.yml + parameters: + ServiceConnection: azure-sdk-tests-public + PersistOidcToken: true + TestResourcesDirectory: $(Build.SourcesDirectory)/$(TestResourcesPath) + UseHttpTransport: true + + - task: AzurePowershell@5 + displayName: "Run tests (http) - az pwsh" env: AZURE_TEST_MODE: 'live' SYSTEM_ACCESSTOKEN: $(System.AccessToken) diff --git a/eng/scripts/Deploy-TestResources.ps1 b/eng/scripts/Deploy-TestResources.ps1 index da37fb51b5..338400e235 100644 --- a/eng/scripts/Deploy-TestResources.ps1 +++ b/eng/scripts/Deploy-TestResources.ps1 @@ -7,7 +7,7 @@ param( [int]$DeleteAfterHours = 12, [switch]$Unique, [switch]$Parallel, - [switch] $UseHttpTransport + [switch]$UseHttpTransport ) $ErrorActionPreference = 'Stop' diff --git a/servers/Azure.Mcp.Server/src/Properties/launchSettings.json b/servers/Azure.Mcp.Server/src/Properties/launchSettings.json index 4a3a90752f..bffcb4ab1d 100644 --- a/servers/Azure.Mcp.Server/src/Properties/launchSettings.json +++ b/servers/Azure.Mcp.Server/src/Properties/launchSettings.json @@ -2,12 +2,12 @@ "profiles": { "debug-remotemcp": { "commandName": "Project", - "commandLineArgs": "server start --transport http --outgoing-auth-strategy UseHostingEnvironmentIdentity --dangerously-disable-http-incoming-auth", + "commandLineArgs": "server start --transport http --outgoing-auth-strategy UseHostingEnvironmentIdentity", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development", "ASPNETCORE_URLS": "http://localhost:1031", "AzureAd__TenantId": "70a036f6-8e4d-4615-bad6-149c02e7720d", - "AzureAd__ClientId": "2d83e5a3-929f-49d5-9835-516849ceb9f4", + "AzureAd__ClientId": "ca1e0302-d50a-47d7-b5e6-7aff49884bce", "AzureAd__Instance": "https://login.microsoftonline.com/" }, "dotnetRunMessages": true @@ -21,4 +21,5 @@ "dotnetRunMessages": true } }, - "$schema": "https://json.schemastore.org/launchsettings.json" \ No newline at end of file + "$schema": "https://json.schemastore.org/launchsettings.json" +} \ No newline at end of file diff --git a/tools/Azure.Mcp.Tools.Acr/tests/Azure.Mcp.Tools.Acr.LiveTests/Azure.Mcp.Tools.Acr.LiveTests.csproj b/tools/Azure.Mcp.Tools.Acr/tests/Azure.Mcp.Tools.Acr.LiveTests/Azure.Mcp.Tools.Acr.LiveTests.csproj index b728b56757..0f06a032a0 100644 --- a/tools/Azure.Mcp.Tools.Acr/tests/Azure.Mcp.Tools.Acr.LiveTests/Azure.Mcp.Tools.Acr.LiveTests.csproj +++ b/tools/Azure.Mcp.Tools.Acr/tests/Azure.Mcp.Tools.Acr.LiveTests/Azure.Mcp.Tools.Acr.LiveTests.csproj @@ -14,18 +14,4 @@ - - - True - True - Resources.resx - - - - - ResXFileCodeGenerator - Resources.Designer.cs - - - From ed1ec76c4bc693becc58f00c41ff67327776a493 Mon Sep 17 00:00:00 2001 From: Chidozie Ononiwu Date: Wed, 4 Feb 2026 12:51:11 -0800 Subject: [PATCH 5/7] Update test resource Depolyment to allow http mode --- .../Client/CommandTestsBase.cs | 55 ++++++++++--------- .../Client/RecordedCommandTestsBase.cs | 1 - 2 files changed, 30 insertions(+), 26 deletions(-) diff --git a/core/Azure.Mcp.Core/tests/Azure.Mcp.Tests/Client/CommandTestsBase.cs b/core/Azure.Mcp.Core/tests/Azure.Mcp.Tests/Client/CommandTestsBase.cs index c054ad0ba9..8902861c5d 100644 --- a/core/Azure.Mcp.Core/tests/Azure.Mcp.Tests/Client/CommandTestsBase.cs +++ b/core/Azure.Mcp.Core/tests/Azure.Mcp.Tests/Client/CommandTestsBase.cs @@ -219,8 +219,6 @@ private async Task StartHttpServerProcessAsync(TestProxyFixture? proxy, string e } _httpServerProcess = Process.Start(processStartInfo); - - await WaitForServerReadinessAsync(); } private Dictionary GetEnvironmentVariables(TestProxyFixture? proxy) @@ -269,26 +267,28 @@ private async Task WaitForServerReadinessAsync(int timeoutSeconds = 60, int poll { try { - var request = new - { - jsonrpc = "2.0", - method = "tools/list", - @params = new { }, - id = Guid.NewGuid().ToString() - }; - - var content = new StringContent(JsonSerializer.Serialize(request), Encoding.UTF8, "application/json"); - using var requestMessage = new HttpRequestMessage(HttpMethod.Post, _baseUrl) - { - Content = content - }; - requestMessage.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); - requestMessage.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("text/event-stream")); - using var resp = await _http!.SendAsync(requestMessage); - if (resp.IsSuccessStatusCode) - { - return; - } + await Client.ListToolsAsync(cancellationToken: CancellationToken.None); + return; + //var request = new + //{ + // jsonrpc = "2.0", + // method = "tools/list", + // @params = new { }, + // id = Guid.NewGuid().ToString() + //}; + // + //var content = new StringContent(JsonSerializer.Serialize(request), Encoding.UTF8, "application/json"); + //using var requestMessage = new HttpRequestMessage(HttpMethod.Post, _baseUrl) + //{ + // Content = content + //}; + //requestMessage.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); + //requestMessage.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("text/event-stream")); + //using var resp = await _http!.SendAsync(requestMessage); + //if (resp.IsSuccessStatusCode) + //{ + // return; + //} } catch { @@ -341,9 +341,16 @@ protected virtual async ValueTask InitializeAsyncInternal(TestProxyFixture? prox if (UseHttp) { - await CreateHttpClientAsync(proxy); await StartHttpServerProcessAsync(proxy, executablePath, arguments); + var transport = new HttpClientTransport(new() + { + Endpoint = new Uri(_baseUrl!), + TransportMode = HttpTransportMode.StreamableHttp + }); + Client = await McpClient.CreateAsync(transport); + await WaitForServerReadinessAsync(); Output.WriteLine($"HTTP test client initialized at {_baseUrl}"); + return; } @@ -355,8 +362,6 @@ protected virtual async ValueTask InitializeAsyncInternal(TestProxyFixture? prox protected Task CallToolAsync(string command, Dictionary parameters) { - if (UseHttp && _http != null) - return CallToolOverHttpAsync(command, parameters); return CallToolAsync(command, parameters, Client); } diff --git a/core/Azure.Mcp.Core/tests/Azure.Mcp.Tests/Client/RecordedCommandTestsBase.cs b/core/Azure.Mcp.Core/tests/Azure.Mcp.Tests/Client/RecordedCommandTestsBase.cs index 1299c19abd..96ae4dab4a 100644 --- a/core/Azure.Mcp.Core/tests/Azure.Mcp.Tests/Client/RecordedCommandTestsBase.cs +++ b/core/Azure.Mcp.Core/tests/Azure.Mcp.Tests/Client/RecordedCommandTestsBase.cs @@ -6,7 +6,6 @@ using System.Text; using Azure.Mcp.Tests.Client.Attributes; using Azure.Mcp.Tests.Client.Helpers; -using Azure.Mcp.Tests.Generated; using Azure.Mcp.Tests.Generated.Models; using Azure.Mcp.Tests.Helpers; using Xunit; From 491094f70cf578681df1da7f0007422dded66ad5 Mon Sep 17 00:00:00 2001 From: Chidozie Ononiwu Date: Wed, 4 Feb 2026 18:26:35 -0800 Subject: [PATCH 6/7] Add LiveServerFixture --- .../ClientToolTests.cs | 3 +- .../Azure.Mcp.Core.LiveTests/CommandTests.cs | 2 +- .../LiveServerCollection.cs | 10 + .../RecordedCommandTestHarness.cs | 3 +- .../RecordedCommandTestsBaseTests.cs | 13 +- .../Client/CommandTestsBase.cs | 274 +----------------- .../Client/LiveServerCollection.cs | 10 + .../Client/LiveServerFixture.cs | 190 ++++++++++++ .../Client/RecordedCommandTestsBase.cs | 5 +- .../tests/Azure.Mcp.Tests/Client/TestProxy.cs | 2 - .../LiveServerCollection.cs | 10 + .../LiveServerCollection.cs | 10 + .../LiveServerCollection.cs | 10 + .../LiveServerCollection.cs | 10 + .../LiveServerCollection.cs | 10 + .../LiveServerCollection.cs | 10 + .../LiveServerCollection.cs | 10 + .../LiveServerCollection.cs | 10 + .../LiveServerCollection.cs | 10 + .../LiveServerCollection.cs | 10 + .../LiveServerCollection.cs | 10 + .../LiveServerCollection.cs | 10 + .../LiveServerCollection.cs | 10 + .../LiveServerCollection.cs | 10 + .../LiveServerCollection.cs | 10 + .../LiveServerCollection.cs | 10 + .../LiveServerCollection.cs | 10 + .../LiveServerCollection.cs | 10 + .../LiveServerCollection.cs | 10 + .../LiveServerCollection.cs | 10 + .../LiveServerCollection.cs | 10 + .../LiveServerCollection.cs | 10 + .../LiveServerCollection.cs | 10 + .../LiveServerCollection.cs | 10 + .../LiveServerCollection.cs | 10 + .../LiveServerCollection.cs | 10 + .../LiveServerCollection.cs | 10 + .../LiveServerCollection.cs | 10 + .../LiveServerCollection.cs | 10 + .../LiveServerCollection.cs | 10 + .../LiveServerCollection.cs | 10 + .../LiveServerCollection.cs | 10 + .../LiveServerCollection.cs | 10 + .../LiveServerCollection.cs | 10 + .../LiveServerCollection.cs | 10 + .../LiveServerCollection.cs | 10 + 46 files changed, 594 insertions(+), 278 deletions(-) create mode 100644 core/Azure.Mcp.Core/tests/Azure.Mcp.Core.LiveTests/LiveServerCollection.cs create mode 100644 core/Azure.Mcp.Core/tests/Azure.Mcp.Tests/Client/LiveServerCollection.cs create mode 100644 core/Azure.Mcp.Core/tests/Azure.Mcp.Tests/Client/LiveServerFixture.cs create mode 100644 tools/Azure.Mcp.Tools.Acr/tests/Azure.Mcp.Tools.Acr.LiveTests/LiveServerCollection.cs create mode 100644 tools/Azure.Mcp.Tools.Aks/tests/Azure.Mcp.Tools.Aks.LiveTests/LiveServerCollection.cs create mode 100644 tools/Azure.Mcp.Tools.AppConfig/tests/Azure.Mcp.Tools.AppConfig.LiveTests/LiveServerCollection.cs create mode 100644 tools/Azure.Mcp.Tools.AppService/tests/Azure.Mcp.Tools.AppService.LiveTests/LiveServerCollection.cs create mode 100644 tools/Azure.Mcp.Tools.Authorization/tests/Azure.Mcp.Tools.Authorization.LiveTests/LiveServerCollection.cs create mode 100644 tools/Azure.Mcp.Tools.AzureIsv/tests/Azure.Mcp.Tools.AzureIsv.LiveTests/LiveServerCollection.cs create mode 100644 tools/Azure.Mcp.Tools.Communication/tests/Azure.Mcp.Tools.Communication.LiveTests/LiveServerCollection.cs create mode 100644 tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.LiveTests/LiveServerCollection.cs create mode 100644 tools/Azure.Mcp.Tools.ConfidentialLedger/tests/Azure.Mcp.Tools.ConfidentialLedger.LiveTests/LiveServerCollection.cs create mode 100644 tools/Azure.Mcp.Tools.Cosmos/tests/Azure.Mcp.Tools.Cosmos.LiveTests/LiveServerCollection.cs create mode 100644 tools/Azure.Mcp.Tools.Deploy/tests/Azure.Mcp.Tools.Deploy.LiveTests/LiveServerCollection.cs create mode 100644 tools/Azure.Mcp.Tools.EventGrid/tests/Azure.Mcp.Tools.EventGrid.LiveTests/LiveServerCollection.cs create mode 100644 tools/Azure.Mcp.Tools.EventHubs/tests/Azure.Mcp.Tools.EventHubs.LiveTests/LiveServerCollection.cs create mode 100644 tools/Azure.Mcp.Tools.FileShares/tests/Azure.Mcp.Tools.FileShares.LiveTests/LiveServerCollection.cs create mode 100644 tools/Azure.Mcp.Tools.Foundry/tests/Azure.Mcp.Tools.Foundry.LiveTests/LiveServerCollection.cs create mode 100644 tools/Azure.Mcp.Tools.FunctionApp/tests/Azure.Mcp.Tools.FunctionApp.LiveTests/LiveServerCollection.cs create mode 100644 tools/Azure.Mcp.Tools.Grafana/tests/Azure.Mcp.Tools.Grafana.LiveTests/LiveServerCollection.cs create mode 100644 tools/Azure.Mcp.Tools.KeyVault/tests/Azure.Mcp.Tools.KeyVault.LiveTests/LiveServerCollection.cs create mode 100644 tools/Azure.Mcp.Tools.Kusto/tests/Azure.Mcp.Tools.Kusto.LiveTests/LiveServerCollection.cs create mode 100644 tools/Azure.Mcp.Tools.LoadTesting/tests/Azure.Mcp.Tools.LoadTesting.LiveTests/LiveServerCollection.cs create mode 100644 tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.LiveTests/LiveServerCollection.cs create mode 100644 tools/Azure.Mcp.Tools.Marketplace/tests/Azure.Mcp.Tools.Marketplace.LiveTests/LiveServerCollection.cs create mode 100644 tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.LiveTests/LiveServerCollection.cs create mode 100644 tools/Azure.Mcp.Tools.Postgres/tests/Azure.Mcp.Tools.Postgres.LiveTests/LiveServerCollection.cs create mode 100644 tools/Azure.Mcp.Tools.Pricing/tests/Azure.Mcp.Tools.Pricing.LiveTests/LiveServerCollection.cs create mode 100644 tools/Azure.Mcp.Tools.Quota/tests/Azure.Mcp.Tools.Quota.LiveTests/LiveServerCollection.cs create mode 100644 tools/Azure.Mcp.Tools.Redis/tests/Azure.Mcp.Tools.Redis.LiveTests/LiveServerCollection.cs create mode 100644 tools/Azure.Mcp.Tools.Search/tests/Azure.Mcp.Tools.Search.LiveTests/LiveServerCollection.cs create mode 100644 tools/Azure.Mcp.Tools.ServiceBus/tests/Azure.Mcp.Tools.ServiceBus.LiveTests/LiveServerCollection.cs create mode 100644 tools/Azure.Mcp.Tools.SignalR/tests/Azure.Mcp.Tools.SignalR.LiveTests/LiveServerCollection.cs create mode 100644 tools/Azure.Mcp.Tools.Speech/tests/Azure.Mcp.Tools.Speech.LiveTests/LiveServerCollection.cs create mode 100644 tools/Azure.Mcp.Tools.Sql/tests/Azure.Mcp.Tools.Sql.LiveTests/LiveServerCollection.cs create mode 100644 tools/Azure.Mcp.Tools.Storage/tests/Azure.Mcp.Tools.Storage.LiveTests/LiveServerCollection.cs create mode 100644 tools/Azure.Mcp.Tools.StorageSync/tests/Azure.Mcp.Tools.StorageSync.LiveTests/LiveServerCollection.cs create mode 100644 tools/Azure.Mcp.Tools.VirtualDesktop/tests/Azure.Mcp.Tools.VirtualDesktop.LiveTests/LiveServerCollection.cs create mode 100644 tools/Azure.Mcp.Tools.Workbooks/tests/Azure.Mcp.Tools.Workbooks.LiveTests/LiveServerCollection.cs diff --git a/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.LiveTests/ClientToolTests.cs b/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.LiveTests/ClientToolTests.cs index 817735357d..0f2fb35117 100644 --- a/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.LiveTests/ClientToolTests.cs +++ b/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.LiveTests/ClientToolTests.cs @@ -12,7 +12,8 @@ namespace Azure.Mcp.Core.LiveTests; -public class ClientToolTests(ITestOutputHelper output, TestProxyFixture testProxyFixture) : RecordedCommandTestsBase(output, testProxyFixture) +[Collection("LiveServer")] +public class ClientToolTests(ITestOutputHelper output, TestProxyFixture testProxyFixture, LiveServerFixture liveServerFixture) : RecordedCommandTestsBase(output, testProxyFixture, liveServerFixture) { [Fact] diff --git a/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.LiveTests/CommandTests.cs b/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.LiveTests/CommandTests.cs index fb9263f40e..1180149947 100644 --- a/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.LiveTests/CommandTests.cs +++ b/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.LiveTests/CommandTests.cs @@ -10,7 +10,7 @@ namespace Azure.Mcp.Core.LiveTests; -public class CommandTests(ITestOutputHelper output, TestProxyFixture testProxyFixture) : RecordedCommandTestsBase(output, testProxyFixture) +public class CommandTests(ITestOutputHelper output, TestProxyFixture testProxyFixture, LiveServerFixture liveServerFixture) : RecordedCommandTestsBase(output, testProxyFixture, liveServerFixture) { [Fact] public async Task Should_list_groups_by_subscription() diff --git a/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.LiveTests/LiveServerCollection.cs b/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.LiveTests/LiveServerCollection.cs new file mode 100644 index 0000000000..b38f396023 --- /dev/null +++ b/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.LiveTests/LiveServerCollection.cs @@ -0,0 +1,10 @@ +using Azure.Mcp.Tests.Client; +using Xunit; + +namespace Azure.Mcp.Core.LiveTests +{ + [CollectionDefinition("LiveServer")] + public sealed class LiveServerCollection : ICollectionFixture + { + } +} diff --git a/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.LiveTests/RecordingFramework/RecordedCommandTestHarness.cs b/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.LiveTests/RecordingFramework/RecordedCommandTestHarness.cs index ae7626879e..fdb5b6ddad 100644 --- a/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.LiveTests/RecordingFramework/RecordedCommandTestHarness.cs +++ b/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.LiveTests/RecordingFramework/RecordedCommandTestHarness.cs @@ -13,7 +13,8 @@ namespace Azure.Mcp.Core.LiveTests.RecordingFramework; /// /// /// -internal sealed class RecordedCommandTestHarness(ITestOutputHelper output, TestProxyFixture fixture) : RecordedCommandTestsBase(output, fixture) +[Collection("LiveServer")] +internal sealed class RecordedCommandTestHarness(ITestOutputHelper output, TestProxyFixture fixture, LiveServerFixture liveServerFixture) : RecordedCommandTestsBase(output, fixture, liveServerFixture) { public TestMode DesiredMode { get; set; } = TestMode.Record; diff --git a/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.LiveTests/RecordingFramework/RecordedCommandTestsBaseTests.cs b/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.LiveTests/RecordingFramework/RecordedCommandTestsBaseTests.cs index ae5e69bc1c..d2f7db24ef 100644 --- a/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.LiveTests/RecordingFramework/RecordedCommandTestsBaseTests.cs +++ b/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.LiveTests/RecordingFramework/RecordedCommandTestsBaseTests.cs @@ -6,6 +6,7 @@ using System.Reflection; using System.Text; using System.Text.Json; +using Azure.Mcp.Tests.Client; using Azure.Mcp.Tests.Client.Attributes; using Azure.Mcp.Tests.Client.Helpers; using Azure.Mcp.Tests.Generated.Models; @@ -131,6 +132,7 @@ public sealed class RecordedCommandTestsBaseTest : IAsyncLifetime private string TestDisplayName = string.Empty; private readonly TemporaryAssetsPathResolver Resolver = new(); private readonly TestProxyFixture Fixture; + private readonly LiveServerFixture LiveServerFixture; private ITestOutputHelper CollectedOutput = Substitute.For(); private RecordedCommandTestHarness? DefaultHarness; @@ -138,6 +140,7 @@ public RecordedCommandTestsBaseTest() { Fixture = new TestProxyFixture(); Fixture.ConfigurePathResolver(Resolver); + LiveServerFixture = new LiveServerFixture(); } [Fact] @@ -169,7 +172,7 @@ public async Task PerTestMatcherAttributeAppliesWhenPresent() Assert.True(activeMatcher!.CompareBodies); Assert.True(activeMatcher.IgnoreQueryOrdering); - DefaultHarness = new RecordedCommandTestHarness(CollectedOutput, Fixture) + DefaultHarness = new RecordedCommandTestHarness(CollectedOutput, Fixture, LiveServerFixture) { DesiredMode = TestMode.Record, EnableDefaultSanitizerAdditions = false, @@ -180,7 +183,7 @@ public async Task PerTestMatcherAttributeAppliesWhenPresent() DefaultHarness.RegisterVariable("attrKey", "attrValue"); await DefaultHarness.DisposeAsync(); - var playbackHarness = new RecordedCommandTestHarness(CollectedOutput, Fixture) + var playbackHarness = new RecordedCommandTestHarness(CollectedOutput, Fixture, LiveServerFixture) { DesiredMode = TestMode.Playback, EnableDefaultSanitizerAdditions = false, @@ -226,7 +229,7 @@ public void CustomMatcherAttributeClearsAfterExecution() [Fact] public async Task GlobalMatcherAndSanitizerAppliesWhenPresent() { - DefaultHarness = new RecordedCommandTestHarness(CollectedOutput, Fixture) + DefaultHarness = new RecordedCommandTestHarness(CollectedOutput, Fixture, LiveServerFixture) { DesiredMode = TestMode.Record, TestMatcher = new CustomDefaultMatcher @@ -256,7 +259,7 @@ public async Task VariableSurvivesRecordPlaybackRoundtrip() DefaultHarness.RegisterVariable("roundtrip", "value"); await DefaultHarness.DisposeAsync(); - var playbackHarness = new RecordedCommandTestHarness(CollectedOutput, Fixture) + var playbackHarness = new RecordedCommandTestHarness(CollectedOutput, Fixture, LiveServerFixture) { DesiredMode = TestMode.Playback, }; @@ -270,7 +273,7 @@ public ValueTask InitializeAsync() { TestDisplayName = TestContext.Current?.Test?.TestCase?.TestCaseDisplayName ?? throw new InvalidDataException("Test case display name is not available."); - var harness = new RecordedCommandTestHarness(CollectedOutput, Fixture) + var harness = new RecordedCommandTestHarness(CollectedOutput, Fixture, LiveServerFixture) { DesiredMode = TestMode.Record }; diff --git a/core/Azure.Mcp.Core/tests/Azure.Mcp.Tests/Client/CommandTestsBase.cs b/core/Azure.Mcp.Core/tests/Azure.Mcp.Tests/Client/CommandTestsBase.cs index 8902861c5d..034a1a567e 100644 --- a/core/Azure.Mcp.Core/tests/Azure.Mcp.Tests/Client/CommandTestsBase.cs +++ b/core/Azure.Mcp.Core/tests/Azure.Mcp.Tests/Client/CommandTestsBase.cs @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -using System.Buffers.Text; -using System.Diagnostics; using System.Net.Http.Headers; using System.Text; using System.Text.Json; @@ -12,23 +10,19 @@ using ModelContextProtocol.Client; using ModelContextProtocol.Protocol; using Xunit; -using static System.Net.WebRequestMethods; namespace Azure.Mcp.Tests.Client; -public abstract class CommandTestsBase(ITestOutputHelper output) : IAsyncLifetime, IDisposable +[Collection("LiveServer")] +public abstract class CommandTestsBase(ITestOutputHelper output, LiveServerFixture liveServerFixture) : IAsyncLifetime, IDisposable { - private HttpClient? _http; - private Process? _httpServerProcess; - private static string? _baseUrl => Environment.GetEnvironmentVariable("ASPNETCORE_URLS"); - private static bool UseHttp => string.Equals(Environment.GetEnvironmentVariable("MCP_TEST_TRANSPORT"), "http", StringComparison.OrdinalIgnoreCase); - protected const string TenantNameReason = "Service principals cannot use TenantName for lookup"; protected McpClient Client { get; private set; } = default!; protected LiveTestSettings Settings { get; set; } = default!; protected StringBuilder FailureOutput { get; } = new(); protected ITestOutputHelper Output { get; } = output; + protected LiveServerFixture LiveServerFixture { get; } = liveServerFixture; public string[]? CustomArguments; public TestMode TestMode = TestMode.Live; @@ -87,140 +81,6 @@ protected virtual async ValueTask LoadSettingsAsync() } } - /// - /// Creates a stdio transport for local process-based testing. - /// - /// Optional test proxy fixture to configure environment variables for playback or recording. - private async Task CreateStdioTransportAsync(TestProxyFixture? proxy, string executablePath, List arguments) - { - string[] args = arguments.ToArray(); - var envVarDictionary = GetEnvironmentVariables(proxy); - - StdioClientTransportOptions transportOptions = new() - { - Name = "Test Server", - Command = executablePath, - Arguments = args, - // Direct stderr to test output helper as required by task - StandardErrorLines = line => Output.WriteLine($"[MCP Server] {line}"), - EnvironmentVariables = envVarDictionary - }; - - if (!string.IsNullOrEmpty(Settings.TestPackage)) - { - Environment.CurrentDirectory = Settings.SettingsDirectory; - transportOptions.Command = "npx"; - transportOptions.Arguments = ["-y", Settings.TestPackage, .. args]; - } - - return await Task.FromResult(new StdioClientTransport(transportOptions)); - } - - /// - /// Creates an HTTP (SSE) transport for remote server testing. - /// Set MCP_TEST_SERVER_URL environment variable to specify the server URL. - /// - /// Optional test proxy fixture to configure environment variables for playback or recording. - private async Task CreateHttpClientAsync(TestProxyFixture? proxy) - { - _http = new HttpClient(); - - if (proxy?.Proxy != null) - { - _http.DefaultRequestHeaders.TryAddWithoutValidation("x-recording-upstream-base-uri", _baseUrl); - _http.DefaultRequestHeaders.TryAddWithoutValidation( - "x-recording-mode", TestMode is TestMode.Playback ? "playback" : TestMode is TestMode.Record ? "record" : "live"); - } - - await Task.CompletedTask; - } - - protected void SetHttpRecordingId(string recordingId) - { - if (_http != null && !string.IsNullOrEmpty(recordingId)) - { - if (_http.DefaultRequestHeaders.Contains("x-recording-id")) - { - _http.DefaultRequestHeaders.Remove("x-recording-id"); - } - _http.DefaultRequestHeaders.TryAddWithoutValidation("x-recording-id", recordingId); - } - } - - private async Task CallToolOverHttpAsync(string command, Dictionary parameters) - { - var request = new - { - jsonrpc = "2.0", - method = "tools/call", - @params = new { name = command, arguments = parameters }, - id = Guid.NewGuid().ToString() - }; - - var content = new StringContent(JsonSerializer.Serialize(request), Encoding.UTF8, "application/json"); - using var requestMessage = new HttpRequestMessage(HttpMethod.Post, _baseUrl) - { - Content = content - }; - requestMessage.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); - requestMessage.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("text/event-stream")); - - var resp = await _http!.SendAsync(requestMessage); - if (resp.IsSuccessStatusCode) - { - var body = await resp.Content.ReadAsStringAsync(); - var json = ExtractJsonFromSse(body); - if (json == null) - { - return null; - } - var root = JsonSerializer.Deserialize(json); - if (root.TryGetProperty("result", out var result) && - result.TryGetProperty("content", out var contentArray) && - contentArray.GetArrayLength() > 0) - { - var firstContent = contentArray[0]; - if (firstContent.TryGetProperty("text", out var textElement)) - { - var textContent = textElement.GetString(); - if (!string.IsNullOrEmpty(textContent)) - { - var parsed = JsonSerializer.Deserialize(textContent); - if (parsed.TryGetProperty("results", out var results)) - { - return results; - } - } - } - } - } - return null; - } - - private async Task StartHttpServerProcessAsync(TestProxyFixture? proxy, string executablePath, List arguments) - { - // Configure arguments for HTTP mode - arguments.AddRange(new[] { "--transport", "http", "--outgoing-auth-strategy", "UseHostingEnvironmentIdentity", "--dangerously-disable-http-incoming-auth" }); - - var envVarDictionary = GetEnvironmentVariables(proxy); - - var processStartInfo = new ProcessStartInfo(executablePath, string.Join(" ", arguments.ToArray())) - { - RedirectStandardOutput = true, - RedirectStandardError = true, - }; - - foreach (var kvp in envVarDictionary) - { - if (kvp.Value != null) - { - processStartInfo.Environment[kvp.Key] = kvp.Value; - } - } - - _httpServerProcess = Process.Start(processStartInfo); - } - private Dictionary GetEnvironmentVariables(TestProxyFixture? proxy) { Dictionary envVarDictionary = [ @@ -254,78 +114,6 @@ private async Task StartHttpServerProcessAsync(TestProxyFixture? proxy, string e return envVarDictionary; } - private async Task WaitForServerReadinessAsync(int timeoutSeconds = 60, int pollIntervalMs = 500) - { - if (string.IsNullOrWhiteSpace(_baseUrl)) - { - throw new ArgumentException("Base URL is not set (ASPNETCORE_URLS)."); - } - - var deadline = DateTime.UtcNow.AddSeconds(timeoutSeconds); - - while (DateTime.UtcNow < deadline) - { - try - { - await Client.ListToolsAsync(cancellationToken: CancellationToken.None); - return; - //var request = new - //{ - // jsonrpc = "2.0", - // method = "tools/list", - // @params = new { }, - // id = Guid.NewGuid().ToString() - //}; - // - //var content = new StringContent(JsonSerializer.Serialize(request), Encoding.UTF8, "application/json"); - //using var requestMessage = new HttpRequestMessage(HttpMethod.Post, _baseUrl) - //{ - // Content = content - //}; - //requestMessage.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); - //requestMessage.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("text/event-stream")); - //using var resp = await _http!.SendAsync(requestMessage); - //if (resp.IsSuccessStatusCode) - //{ - // return; - //} - } - catch - { - // swallow and retry - } - - await Task.Delay(pollIntervalMs); - } - - throw new TimeoutException($"MCP server at {_baseUrl} did not become ready within {timeoutSeconds} seconds."); - } - - private static string? ExtractJsonFromSse(string response) - { - var trimmed = response.TrimStart(); - if (trimmed.StartsWith('{')) - { - return response; - } - - foreach (var line in response.Split('\n')) - { - var cleanLine = line.Trim(); - - if (cleanLine.StartsWith("data:", StringComparison.Ordinal)) - { - var jsonPart = cleanLine[5..].TrimStart(); // Remove "data:" and any leading whitespace - if (jsonPart.StartsWith('{')) - { - return jsonPart; - } - } - } - - return null; - } - protected virtual async ValueTask InitializeAsyncInternal(TestProxyFixture? proxy = null) { await LoadSettingsAsync(); @@ -339,25 +127,13 @@ protected virtual async ValueTask InitializeAsyncInternal(TestProxyFixture? prox : ["server", "start", "--mode", "all"]; var arguments = CustomArguments?.ToList() ?? defaultArgs; - if (UseHttp) - { - await StartHttpServerProcessAsync(proxy, executablePath, arguments); - var transport = new HttpClientTransport(new() - { - Endpoint = new Uri(_baseUrl!), - TransportMode = HttpTransportMode.StreamableHttp - }); - Client = await McpClient.CreateAsync(transport); - await WaitForServerReadinessAsync(); - Output.WriteLine($"HTTP test client initialized at {_baseUrl}"); - - return; - } + LiveServerFixture.environmentVariables = GetEnvironmentVariables(proxy); + LiveServerFixture.arguments = arguments; + LiveServerFixture.output = Output; + LiveServerFixture.settings = Settings; - var clientTransport = await CreateStdioTransportAsync(proxy, executablePath, arguments); - Output.WriteLine("Attempting to start MCP Client"); - Client = await McpClient.CreateAsync(clientTransport); - Output.WriteLine("MCP client initialized successfully"); + await LiveServerFixture.EnsureStartedAsync(); + Client = LiveServerFixture.GetMcpClient(); } protected Task CallToolAsync(string command, Dictionary parameters) @@ -430,11 +206,6 @@ public void Dispose() public virtual async ValueTask DisposeAsync() { await DisposeAsyncCore().ConfigureAwait(false); - if (_http is not null) - { - _http.Dispose(); - _http = null; - } Dispose(disposing: false); GC.SuppressFinalize(this); } @@ -448,30 +219,6 @@ protected virtual void Dispose(bool disposing) // No unmanaged resources to release, but if we had, we'd release them here. // _disposableResource?.Dispose(); // _disposableResource = null; - - // Handle things normally disposed in DisposeAsyncCore - if (Client is IDisposable disposable) - { - disposable.Dispose(); - } - - if (_httpServerProcess != null) - { - try - { - if (!_httpServerProcess.HasExited) - { - _httpServerProcess.Kill(); - _httpServerProcess.WaitForExit(2000); - } - } - catch { } - finally - { - _httpServerProcess.Dispose(); - _httpServerProcess = null; - } - } } // Failure output may contain request and response details that should be output for failed tests. @@ -485,7 +232,6 @@ protected virtual void Dispose(bool disposing) // overrides should still call base.DisposeAsyncCore() protected virtual async ValueTask DisposeAsyncCore() { - if (Client != null) - await Client.DisposeAsync().ConfigureAwait(false); + } } diff --git a/core/Azure.Mcp.Core/tests/Azure.Mcp.Tests/Client/LiveServerCollection.cs b/core/Azure.Mcp.Core/tests/Azure.Mcp.Tests/Client/LiveServerCollection.cs new file mode 100644 index 0000000000..f88339494b --- /dev/null +++ b/core/Azure.Mcp.Core/tests/Azure.Mcp.Tests/Client/LiveServerCollection.cs @@ -0,0 +1,10 @@ +using Azure.Mcp.Tests.Client; +using Xunit; + +namespace Azure.Mcp.Tests.Client +{ + [CollectionDefinition("LiveServer")] + public sealed class LiveServerCollection : ICollectionFixture + { + } +} diff --git a/core/Azure.Mcp.Core/tests/Azure.Mcp.Tests/Client/LiveServerFixture.cs b/core/Azure.Mcp.Core/tests/Azure.Mcp.Tests/Client/LiveServerFixture.cs new file mode 100644 index 0000000000..aadda4b62b --- /dev/null +++ b/core/Azure.Mcp.Core/tests/Azure.Mcp.Tests/Client/LiveServerFixture.cs @@ -0,0 +1,190 @@ +using System.Diagnostics; +using Azure.Mcp.Tests.Client.Helpers; +using ModelContextProtocol.Client; +using Xunit; +using Xunit.Sdk; + +namespace Azure.Mcp.Tests.Client; + +public sealed class LiveServerFixture() : IAsyncLifetime +{ + private readonly SemaphoreSlim _startLock = new(1, 1); + private Process? _httpServerProcess; + private McpClient? _mcpClient; + private string? _baseUrl; + private bool _started; + + public Dictionary environmentVariables = new(); + public List arguments = new(); + public ITestOutputHelper? output = null; + public LiveTestSettings? settings = null; + + public async ValueTask InitializeAsync() + { + } + + public async Task EnsureStartedAsync() + { + if (_started) + { + return; + } + await _startLock.WaitAsync().ConfigureAwait(false); + try + { + if (_started) + { + return; + } + string executablePath = McpTestUtilities.GetAzMcpExecutablePath(); + bool useHttp = string.Equals(Environment.GetEnvironmentVariable("MCP_TEST_TRANSPORT"), "http", StringComparison.OrdinalIgnoreCase); + _baseUrl = Environment.GetEnvironmentVariable("ASPNETCORE_URLS") ?? "http://localhost:5000"; + + if (useHttp) + { + await StartHttpServerProcessAsync(executablePath, arguments); + var transport = new HttpClientTransport(new() + { + Endpoint = new Uri(_baseUrl), + TransportMode = HttpTransportMode.StreamableHttp + }); + _mcpClient = await McpClient.CreateAsync(transport); + output?.WriteLine($"HTTP test client initialized at {_baseUrl}"); + await WaitForServerReadinessAsync(); + } + else + { + var clientTransport = await CreateStdioTransportAsync(executablePath, arguments); + output?.WriteLine("Attempting to start MCP Client"); + _mcpClient = await McpClient.CreateAsync(clientTransport); + output?.WriteLine("MCP client initialized successfully"); + } + _started = true; + } + finally + { + _startLock.Release(); + } + } + + public McpClient GetMcpClient() + { + if (_mcpClient == null) + { + throw new InvalidOperationException("MCP Client has not been initialized."); + } + return _mcpClient; + } + + private async Task StartHttpServerProcessAsync(string executablePath, List arguments) + { + arguments.AddRange(new[] { "--transport", "http", "--outgoing-auth-strategy", "UseHostingEnvironmentIdentity", "--dangerously-disable-http-incoming-auth" }); + + var processStartInfo = new ProcessStartInfo(executablePath, string.Join(" ", arguments.ToArray())) + { + RedirectStandardOutput = true, + RedirectStandardError = true, + }; + + foreach (var kvp in environmentVariables) + { + if (kvp.Value != null) + { + processStartInfo.Environment[kvp.Key] = kvp.Value; + } + } + + _httpServerProcess = Process.Start(processStartInfo); + } + + private async Task WaitForServerReadinessAsync(int timeoutSeconds = 60, int pollIntervalMs = 500) + { + if (string.IsNullOrWhiteSpace(_baseUrl)) + { + throw new ArgumentException("Base URL is not set (ASPNETCORE_URLS)."); + } + + var deadline = DateTime.UtcNow.AddSeconds(timeoutSeconds); + + while (DateTime.UtcNow < deadline) + { + try + { + await _mcpClient!.ListToolsAsync(cancellationToken: CancellationToken.None); + return; + } + catch + { + // swallow and retry + } + + await Task.Delay(pollIntervalMs); + } + + throw new TimeoutException($"MCP server at {_baseUrl} did not become ready within {timeoutSeconds} seconds."); + } + + private async Task CreateStdioTransportAsync(string executablePath, List arguments) + { + string[] args = arguments.ToArray(); + + StdioClientTransportOptions transportOptions = new() + { + Name = "Test Server", + Command = executablePath, + Arguments = args, + // Direct stderr to test output helper as required by task + StandardErrorLines = line => output?.WriteLine($"[MCP Server] {line}"), + EnvironmentVariables = environmentVariables + }; + + if (!string.IsNullOrEmpty(settings!.TestPackage)) + { + Environment.CurrentDirectory = settings!.SettingsDirectory; + transportOptions.Command = "npx"; + transportOptions.Arguments = ["-y", settings!.TestPackage, .. args]; + } + + return await Task.FromResult(new StdioClientTransport(transportOptions)); + } + + public async ValueTask DisposeAsync() + { + if (_mcpClient != null) + { + try + { + await _mcpClient.DisposeAsync().ConfigureAwait(false); + } + catch + { + // swallow; continue disposing process + } + finally + { + _mcpClient = null; + } + } + + if (_httpServerProcess != null) + { + try + { + if (!_httpServerProcess.HasExited) + { + _httpServerProcess.Kill(); + _httpServerProcess.WaitForExit(2000); + } + } + catch + { + // swallow; ensure handle is released + } + finally + { + _httpServerProcess.Dispose(); + _httpServerProcess = null; + } + } + } +} diff --git a/core/Azure.Mcp.Core/tests/Azure.Mcp.Tests/Client/RecordedCommandTestsBase.cs b/core/Azure.Mcp.Core/tests/Azure.Mcp.Tests/Client/RecordedCommandTestsBase.cs index 96ae4dab4a..65affa92fe 100644 --- a/core/Azure.Mcp.Core/tests/Azure.Mcp.Tests/Client/RecordedCommandTestsBase.cs +++ b/core/Azure.Mcp.Core/tests/Azure.Mcp.Tests/Client/RecordedCommandTestsBase.cs @@ -12,7 +12,7 @@ namespace Azure.Mcp.Tests.Client; -public abstract class RecordedCommandTestsBase(ITestOutputHelper output, TestProxyFixture fixture) : CommandTestsBase(output), IClassFixture +public abstract class RecordedCommandTestsBase(ITestOutputHelper output, TestProxyFixture fixture, LiveServerFixture liveServerFixture) : CommandTestsBase(output, liveServerFixture), IClassFixture { private const string EmptyGuid = "00000000-0000-0000-0000-000000000000"; @@ -152,9 +152,6 @@ public override async ValueTask InitializeAsync() // start recording/playback session await StartRecordOrPlayback(); - // Ensure HTTP client has the recording ID if we are using HTTP transport - SetHttpRecordingId(RecordingId); - // apply custom matcher if test has attribute await ApplyAttributeMatcherSettings(); diff --git a/core/Azure.Mcp.Core/tests/Azure.Mcp.Tests/Client/TestProxy.cs b/core/Azure.Mcp.Core/tests/Azure.Mcp.Tests/Client/TestProxy.cs index 2477e96cf5..025104cdc9 100644 --- a/core/Azure.Mcp.Core/tests/Azure.Mcp.Tests/Client/TestProxy.cs +++ b/core/Azure.Mcp.Core/tests/Azure.Mcp.Tests/Client/TestProxy.cs @@ -7,8 +7,6 @@ using System.Reflection; using System.Runtime.InteropServices; using System.Text; -using System.Threading; -using System.Threading.Tasks; using Azure.Mcp.Tests.Generated; namespace Azure.Mcp.Tests.Client; diff --git a/tools/Azure.Mcp.Tools.Acr/tests/Azure.Mcp.Tools.Acr.LiveTests/LiveServerCollection.cs b/tools/Azure.Mcp.Tools.Acr/tests/Azure.Mcp.Tools.Acr.LiveTests/LiveServerCollection.cs new file mode 100644 index 0000000000..39485abcee --- /dev/null +++ b/tools/Azure.Mcp.Tools.Acr/tests/Azure.Mcp.Tools.Acr.LiveTests/LiveServerCollection.cs @@ -0,0 +1,10 @@ +using Azure.Mcp.Tests.Client; +using Xunit; + +namespace Azure.Mcp.Tools.Acr.LiveTests +{ + [CollectionDefinition("LiveServer")] + public sealed class LiveServerCollection : ICollectionFixture + { + } +} diff --git a/tools/Azure.Mcp.Tools.Aks/tests/Azure.Mcp.Tools.Aks.LiveTests/LiveServerCollection.cs b/tools/Azure.Mcp.Tools.Aks/tests/Azure.Mcp.Tools.Aks.LiveTests/LiveServerCollection.cs new file mode 100644 index 0000000000..06793aa027 --- /dev/null +++ b/tools/Azure.Mcp.Tools.Aks/tests/Azure.Mcp.Tools.Aks.LiveTests/LiveServerCollection.cs @@ -0,0 +1,10 @@ +using Azure.Mcp.Tests.Client; +using Xunit; + +namespace Azure.Mcp.Tools.Aks.LiveTests +{ + [CollectionDefinition("LiveServer")] + public sealed class LiveServerCollection : ICollectionFixture + { + } +} diff --git a/tools/Azure.Mcp.Tools.AppConfig/tests/Azure.Mcp.Tools.AppConfig.LiveTests/LiveServerCollection.cs b/tools/Azure.Mcp.Tools.AppConfig/tests/Azure.Mcp.Tools.AppConfig.LiveTests/LiveServerCollection.cs new file mode 100644 index 0000000000..1aee13f8ef --- /dev/null +++ b/tools/Azure.Mcp.Tools.AppConfig/tests/Azure.Mcp.Tools.AppConfig.LiveTests/LiveServerCollection.cs @@ -0,0 +1,10 @@ +using Azure.Mcp.Tests.Client; +using Xunit; + +namespace Azure.Mcp.Tools.AppConfig.LiveTests +{ + [CollectionDefinition("LiveServer")] + public sealed class LiveServerCollection : ICollectionFixture + { + } +} diff --git a/tools/Azure.Mcp.Tools.AppService/tests/Azure.Mcp.Tools.AppService.LiveTests/LiveServerCollection.cs b/tools/Azure.Mcp.Tools.AppService/tests/Azure.Mcp.Tools.AppService.LiveTests/LiveServerCollection.cs new file mode 100644 index 0000000000..9a4afbe9c8 --- /dev/null +++ b/tools/Azure.Mcp.Tools.AppService/tests/Azure.Mcp.Tools.AppService.LiveTests/LiveServerCollection.cs @@ -0,0 +1,10 @@ +using Azure.Mcp.Tests.Client; +using Xunit; + +namespace Azure.Mcp.Tools.AppService.LiveTests +{ + [CollectionDefinition("LiveServer")] + public sealed class LiveServerCollection : ICollectionFixture + { + } +} diff --git a/tools/Azure.Mcp.Tools.Authorization/tests/Azure.Mcp.Tools.Authorization.LiveTests/LiveServerCollection.cs b/tools/Azure.Mcp.Tools.Authorization/tests/Azure.Mcp.Tools.Authorization.LiveTests/LiveServerCollection.cs new file mode 100644 index 0000000000..318dd1faf7 --- /dev/null +++ b/tools/Azure.Mcp.Tools.Authorization/tests/Azure.Mcp.Tools.Authorization.LiveTests/LiveServerCollection.cs @@ -0,0 +1,10 @@ +using Azure.Mcp.Tests.Client; +using Xunit; + +namespace Azure.Mcp.Tools.Authorization.LiveTests +{ + [CollectionDefinition("LiveServer")] + public sealed class LiveServerCollection : ICollectionFixture + { + } +} diff --git a/tools/Azure.Mcp.Tools.AzureIsv/tests/Azure.Mcp.Tools.AzureIsv.LiveTests/LiveServerCollection.cs b/tools/Azure.Mcp.Tools.AzureIsv/tests/Azure.Mcp.Tools.AzureIsv.LiveTests/LiveServerCollection.cs new file mode 100644 index 0000000000..06a1f46307 --- /dev/null +++ b/tools/Azure.Mcp.Tools.AzureIsv/tests/Azure.Mcp.Tools.AzureIsv.LiveTests/LiveServerCollection.cs @@ -0,0 +1,10 @@ +using Azure.Mcp.Tests.Client; +using Xunit; + +namespace Azure.Mcp.Tools.AzureIsv.LiveTests +{ + [CollectionDefinition("LiveServer")] + public sealed class LiveServerCollection : ICollectionFixture + { + } +} diff --git a/tools/Azure.Mcp.Tools.Communication/tests/Azure.Mcp.Tools.Communication.LiveTests/LiveServerCollection.cs b/tools/Azure.Mcp.Tools.Communication/tests/Azure.Mcp.Tools.Communication.LiveTests/LiveServerCollection.cs new file mode 100644 index 0000000000..6ae1560e87 --- /dev/null +++ b/tools/Azure.Mcp.Tools.Communication/tests/Azure.Mcp.Tools.Communication.LiveTests/LiveServerCollection.cs @@ -0,0 +1,10 @@ +using Azure.Mcp.Tests.Client; +using Xunit; + +namespace Azure.Mcp.Tools.Communication.LiveTests +{ + [CollectionDefinition("LiveServer")] + public sealed class LiveServerCollection : ICollectionFixture + { + } +} diff --git a/tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.LiveTests/LiveServerCollection.cs b/tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.LiveTests/LiveServerCollection.cs new file mode 100644 index 0000000000..52c4e5e473 --- /dev/null +++ b/tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.LiveTests/LiveServerCollection.cs @@ -0,0 +1,10 @@ +using Azure.Mcp.Tests.Client; +using Xunit; + +namespace Azure.Mcp.Tools.Compute.LiveTests +{ + [CollectionDefinition("LiveServer")] + public sealed class LiveServerCollection : ICollectionFixture + { + } +} diff --git a/tools/Azure.Mcp.Tools.ConfidentialLedger/tests/Azure.Mcp.Tools.ConfidentialLedger.LiveTests/LiveServerCollection.cs b/tools/Azure.Mcp.Tools.ConfidentialLedger/tests/Azure.Mcp.Tools.ConfidentialLedger.LiveTests/LiveServerCollection.cs new file mode 100644 index 0000000000..2641545b18 --- /dev/null +++ b/tools/Azure.Mcp.Tools.ConfidentialLedger/tests/Azure.Mcp.Tools.ConfidentialLedger.LiveTests/LiveServerCollection.cs @@ -0,0 +1,10 @@ +using Azure.Mcp.Tests.Client; +using Xunit; + +namespace Azure.Mcp.Tools.ConfidentialLedger.LiveTests +{ + [CollectionDefinition("LiveServer")] + public sealed class LiveServerCollection : ICollectionFixture + { + } +} diff --git a/tools/Azure.Mcp.Tools.Cosmos/tests/Azure.Mcp.Tools.Cosmos.LiveTests/LiveServerCollection.cs b/tools/Azure.Mcp.Tools.Cosmos/tests/Azure.Mcp.Tools.Cosmos.LiveTests/LiveServerCollection.cs new file mode 100644 index 0000000000..b7fe67e021 --- /dev/null +++ b/tools/Azure.Mcp.Tools.Cosmos/tests/Azure.Mcp.Tools.Cosmos.LiveTests/LiveServerCollection.cs @@ -0,0 +1,10 @@ +using Azure.Mcp.Tests.Client; +using Xunit; + +namespace Azure.Mcp.Tools.Cosmos.LiveTests +{ + [CollectionDefinition("LiveServer")] + public sealed class LiveServerCollection : ICollectionFixture + { + } +} diff --git a/tools/Azure.Mcp.Tools.Deploy/tests/Azure.Mcp.Tools.Deploy.LiveTests/LiveServerCollection.cs b/tools/Azure.Mcp.Tools.Deploy/tests/Azure.Mcp.Tools.Deploy.LiveTests/LiveServerCollection.cs new file mode 100644 index 0000000000..2956678f29 --- /dev/null +++ b/tools/Azure.Mcp.Tools.Deploy/tests/Azure.Mcp.Tools.Deploy.LiveTests/LiveServerCollection.cs @@ -0,0 +1,10 @@ +using Azure.Mcp.Tests.Client; +using Xunit; + +namespace Azure.Mcp.Tools.Deploy.LiveTests +{ + [CollectionDefinition("LiveServer")] + public sealed class LiveServerCollection : ICollectionFixture + { + } +} diff --git a/tools/Azure.Mcp.Tools.EventGrid/tests/Azure.Mcp.Tools.EventGrid.LiveTests/LiveServerCollection.cs b/tools/Azure.Mcp.Tools.EventGrid/tests/Azure.Mcp.Tools.EventGrid.LiveTests/LiveServerCollection.cs new file mode 100644 index 0000000000..f03fab76f5 --- /dev/null +++ b/tools/Azure.Mcp.Tools.EventGrid/tests/Azure.Mcp.Tools.EventGrid.LiveTests/LiveServerCollection.cs @@ -0,0 +1,10 @@ +using Azure.Mcp.Tests.Client; +using Xunit; + +namespace Azure.Mcp.Tools.EventGrid.LiveTests +{ + [CollectionDefinition("LiveServer")] + public sealed class LiveServerCollection : ICollectionFixture + { + } +} diff --git a/tools/Azure.Mcp.Tools.EventHubs/tests/Azure.Mcp.Tools.EventHubs.LiveTests/LiveServerCollection.cs b/tools/Azure.Mcp.Tools.EventHubs/tests/Azure.Mcp.Tools.EventHubs.LiveTests/LiveServerCollection.cs new file mode 100644 index 0000000000..193dccfdb6 --- /dev/null +++ b/tools/Azure.Mcp.Tools.EventHubs/tests/Azure.Mcp.Tools.EventHubs.LiveTests/LiveServerCollection.cs @@ -0,0 +1,10 @@ +using Azure.Mcp.Tests.Client; +using Xunit; + +namespace Azure.Mcp.Tools.EventHubs.LiveTests +{ + [CollectionDefinition("LiveServer")] + public sealed class LiveServerCollection : ICollectionFixture + { + } +} diff --git a/tools/Azure.Mcp.Tools.FileShares/tests/Azure.Mcp.Tools.FileShares.LiveTests/LiveServerCollection.cs b/tools/Azure.Mcp.Tools.FileShares/tests/Azure.Mcp.Tools.FileShares.LiveTests/LiveServerCollection.cs new file mode 100644 index 0000000000..1b07b3a431 --- /dev/null +++ b/tools/Azure.Mcp.Tools.FileShares/tests/Azure.Mcp.Tools.FileShares.LiveTests/LiveServerCollection.cs @@ -0,0 +1,10 @@ +using Azure.Mcp.Tests.Client; +using Xunit; + +namespace Azure.Mcp.Tools.FileShares.LiveTests +{ + [CollectionDefinition("LiveServer")] + public sealed class LiveServerCollection : ICollectionFixture + { + } +} diff --git a/tools/Azure.Mcp.Tools.Foundry/tests/Azure.Mcp.Tools.Foundry.LiveTests/LiveServerCollection.cs b/tools/Azure.Mcp.Tools.Foundry/tests/Azure.Mcp.Tools.Foundry.LiveTests/LiveServerCollection.cs new file mode 100644 index 0000000000..3dfb732945 --- /dev/null +++ b/tools/Azure.Mcp.Tools.Foundry/tests/Azure.Mcp.Tools.Foundry.LiveTests/LiveServerCollection.cs @@ -0,0 +1,10 @@ +using Azure.Mcp.Tests.Client; +using Xunit; + +namespace Azure.Mcp.Tools.Foundry.LiveTests +{ + [CollectionDefinition("LiveServer")] + public sealed class LiveServerCollection : ICollectionFixture + { + } +} diff --git a/tools/Azure.Mcp.Tools.FunctionApp/tests/Azure.Mcp.Tools.FunctionApp.LiveTests/LiveServerCollection.cs b/tools/Azure.Mcp.Tools.FunctionApp/tests/Azure.Mcp.Tools.FunctionApp.LiveTests/LiveServerCollection.cs new file mode 100644 index 0000000000..f368721f0c --- /dev/null +++ b/tools/Azure.Mcp.Tools.FunctionApp/tests/Azure.Mcp.Tools.FunctionApp.LiveTests/LiveServerCollection.cs @@ -0,0 +1,10 @@ +using Azure.Mcp.Tests.Client; +using Xunit; + +namespace Azure.Mcp.Tools.FunctionApp.LiveTests +{ + [CollectionDefinition("LiveServer")] + public sealed class LiveServerCollection : ICollectionFixture + { + } +} diff --git a/tools/Azure.Mcp.Tools.Grafana/tests/Azure.Mcp.Tools.Grafana.LiveTests/LiveServerCollection.cs b/tools/Azure.Mcp.Tools.Grafana/tests/Azure.Mcp.Tools.Grafana.LiveTests/LiveServerCollection.cs new file mode 100644 index 0000000000..f039314039 --- /dev/null +++ b/tools/Azure.Mcp.Tools.Grafana/tests/Azure.Mcp.Tools.Grafana.LiveTests/LiveServerCollection.cs @@ -0,0 +1,10 @@ +using Azure.Mcp.Tests.Client; +using Xunit; + +namespace Azure.Mcp.Tools.Grafana.LiveTests +{ + [CollectionDefinition("LiveServer")] + public sealed class LiveServerCollection : ICollectionFixture + { + } +} diff --git a/tools/Azure.Mcp.Tools.KeyVault/tests/Azure.Mcp.Tools.KeyVault.LiveTests/LiveServerCollection.cs b/tools/Azure.Mcp.Tools.KeyVault/tests/Azure.Mcp.Tools.KeyVault.LiveTests/LiveServerCollection.cs new file mode 100644 index 0000000000..520fdbb3f9 --- /dev/null +++ b/tools/Azure.Mcp.Tools.KeyVault/tests/Azure.Mcp.Tools.KeyVault.LiveTests/LiveServerCollection.cs @@ -0,0 +1,10 @@ +using Azure.Mcp.Tests.Client; +using Xunit; + +namespace Azure.Mcp.Tools.KeyVault.LiveTests +{ + [CollectionDefinition("LiveServer")] + public sealed class LiveServerCollection : ICollectionFixture + { + } +} diff --git a/tools/Azure.Mcp.Tools.Kusto/tests/Azure.Mcp.Tools.Kusto.LiveTests/LiveServerCollection.cs b/tools/Azure.Mcp.Tools.Kusto/tests/Azure.Mcp.Tools.Kusto.LiveTests/LiveServerCollection.cs new file mode 100644 index 0000000000..0507ddc895 --- /dev/null +++ b/tools/Azure.Mcp.Tools.Kusto/tests/Azure.Mcp.Tools.Kusto.LiveTests/LiveServerCollection.cs @@ -0,0 +1,10 @@ +using Azure.Mcp.Tests.Client; +using Xunit; + +namespace Azure.Mcp.Tools.Kusto.LiveTests +{ + [CollectionDefinition("LiveServer")] + public sealed class LiveServerCollection : ICollectionFixture + { + } +} diff --git a/tools/Azure.Mcp.Tools.LoadTesting/tests/Azure.Mcp.Tools.LoadTesting.LiveTests/LiveServerCollection.cs b/tools/Azure.Mcp.Tools.LoadTesting/tests/Azure.Mcp.Tools.LoadTesting.LiveTests/LiveServerCollection.cs new file mode 100644 index 0000000000..618100509e --- /dev/null +++ b/tools/Azure.Mcp.Tools.LoadTesting/tests/Azure.Mcp.Tools.LoadTesting.LiveTests/LiveServerCollection.cs @@ -0,0 +1,10 @@ +using Azure.Mcp.Tests.Client; +using Xunit; + +namespace Azure.Mcp.Tools.LoadTesting.LiveTests +{ + [CollectionDefinition("LiveServer")] + public sealed class LiveServerCollection : ICollectionFixture + { + } +} diff --git a/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.LiveTests/LiveServerCollection.cs b/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.LiveTests/LiveServerCollection.cs new file mode 100644 index 0000000000..38f6f4859c --- /dev/null +++ b/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.LiveTests/LiveServerCollection.cs @@ -0,0 +1,10 @@ +using Azure.Mcp.Tests.Client; +using Xunit; + +namespace Azure.Mcp.Tools.ManagedLustre.LiveTests +{ + [CollectionDefinition("LiveServer")] + public sealed class LiveServerCollection : ICollectionFixture + { + } +} diff --git a/tools/Azure.Mcp.Tools.Marketplace/tests/Azure.Mcp.Tools.Marketplace.LiveTests/LiveServerCollection.cs b/tools/Azure.Mcp.Tools.Marketplace/tests/Azure.Mcp.Tools.Marketplace.LiveTests/LiveServerCollection.cs new file mode 100644 index 0000000000..4a08100f46 --- /dev/null +++ b/tools/Azure.Mcp.Tools.Marketplace/tests/Azure.Mcp.Tools.Marketplace.LiveTests/LiveServerCollection.cs @@ -0,0 +1,10 @@ +using Azure.Mcp.Tests.Client; +using Xunit; + +namespace Azure.Mcp.Tools.Marketplace.LiveTests +{ + [CollectionDefinition("LiveServer")] + public sealed class LiveServerCollection : ICollectionFixture + { + } +} diff --git a/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.LiveTests/LiveServerCollection.cs b/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.LiveTests/LiveServerCollection.cs new file mode 100644 index 0000000000..5c183b09b7 --- /dev/null +++ b/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.LiveTests/LiveServerCollection.cs @@ -0,0 +1,10 @@ +using Azure.Mcp.Tests.Client; +using Xunit; + +namespace Azure.Mcp.Tools.Monitor.LiveTests +{ + [CollectionDefinition("LiveServer")] + public sealed class LiveServerCollection : ICollectionFixture + { + } +} diff --git a/tools/Azure.Mcp.Tools.Postgres/tests/Azure.Mcp.Tools.Postgres.LiveTests/LiveServerCollection.cs b/tools/Azure.Mcp.Tools.Postgres/tests/Azure.Mcp.Tools.Postgres.LiveTests/LiveServerCollection.cs new file mode 100644 index 0000000000..898149d5b7 --- /dev/null +++ b/tools/Azure.Mcp.Tools.Postgres/tests/Azure.Mcp.Tools.Postgres.LiveTests/LiveServerCollection.cs @@ -0,0 +1,10 @@ +using Azure.Mcp.Tests.Client; +using Xunit; + +namespace Azure.Mcp.Tools.Postgres.LiveTests +{ + [CollectionDefinition("LiveServer")] + public sealed class LiveServerCollection : ICollectionFixture + { + } +} diff --git a/tools/Azure.Mcp.Tools.Pricing/tests/Azure.Mcp.Tools.Pricing.LiveTests/LiveServerCollection.cs b/tools/Azure.Mcp.Tools.Pricing/tests/Azure.Mcp.Tools.Pricing.LiveTests/LiveServerCollection.cs new file mode 100644 index 0000000000..79d6322680 --- /dev/null +++ b/tools/Azure.Mcp.Tools.Pricing/tests/Azure.Mcp.Tools.Pricing.LiveTests/LiveServerCollection.cs @@ -0,0 +1,10 @@ +using Azure.Mcp.Tests.Client; +using Xunit; + +namespace Azure.Mcp.Tools.Pricing.LiveTests +{ + [CollectionDefinition("LiveServer")] + public sealed class LiveServerCollection : ICollectionFixture + { + } +} diff --git a/tools/Azure.Mcp.Tools.Quota/tests/Azure.Mcp.Tools.Quota.LiveTests/LiveServerCollection.cs b/tools/Azure.Mcp.Tools.Quota/tests/Azure.Mcp.Tools.Quota.LiveTests/LiveServerCollection.cs new file mode 100644 index 0000000000..c1605e0e47 --- /dev/null +++ b/tools/Azure.Mcp.Tools.Quota/tests/Azure.Mcp.Tools.Quota.LiveTests/LiveServerCollection.cs @@ -0,0 +1,10 @@ +using Azure.Mcp.Tests.Client; +using Xunit; + +namespace Azure.Mcp.Tools.Quota.LiveTests +{ + [CollectionDefinition("LiveServer")] + public sealed class LiveServerCollection : ICollectionFixture + { + } +} diff --git a/tools/Azure.Mcp.Tools.Redis/tests/Azure.Mcp.Tools.Redis.LiveTests/LiveServerCollection.cs b/tools/Azure.Mcp.Tools.Redis/tests/Azure.Mcp.Tools.Redis.LiveTests/LiveServerCollection.cs new file mode 100644 index 0000000000..3da265513d --- /dev/null +++ b/tools/Azure.Mcp.Tools.Redis/tests/Azure.Mcp.Tools.Redis.LiveTests/LiveServerCollection.cs @@ -0,0 +1,10 @@ +using Azure.Mcp.Tests.Client; +using Xunit; + +namespace Azure.Mcp.Tools.Redis.LiveTests +{ + [CollectionDefinition("LiveServer")] + public sealed class LiveServerCollection : ICollectionFixture + { + } +} diff --git a/tools/Azure.Mcp.Tools.Search/tests/Azure.Mcp.Tools.Search.LiveTests/LiveServerCollection.cs b/tools/Azure.Mcp.Tools.Search/tests/Azure.Mcp.Tools.Search.LiveTests/LiveServerCollection.cs new file mode 100644 index 0000000000..96195970df --- /dev/null +++ b/tools/Azure.Mcp.Tools.Search/tests/Azure.Mcp.Tools.Search.LiveTests/LiveServerCollection.cs @@ -0,0 +1,10 @@ +using Azure.Mcp.Tests.Client; +using Xunit; + +namespace Azure.Mcp.Tools.Search.LiveTests +{ + [CollectionDefinition("LiveServer")] + public sealed class LiveServerCollection : ICollectionFixture + { + } +} diff --git a/tools/Azure.Mcp.Tools.ServiceBus/tests/Azure.Mcp.Tools.ServiceBus.LiveTests/LiveServerCollection.cs b/tools/Azure.Mcp.Tools.ServiceBus/tests/Azure.Mcp.Tools.ServiceBus.LiveTests/LiveServerCollection.cs new file mode 100644 index 0000000000..bbf38f1b64 --- /dev/null +++ b/tools/Azure.Mcp.Tools.ServiceBus/tests/Azure.Mcp.Tools.ServiceBus.LiveTests/LiveServerCollection.cs @@ -0,0 +1,10 @@ +using Azure.Mcp.Tests.Client; +using Xunit; + +namespace Azure.Mcp.Tools.ServiceBus.LiveTests +{ + [CollectionDefinition("LiveServer")] + public sealed class LiveServerCollection : ICollectionFixture + { + } +} diff --git a/tools/Azure.Mcp.Tools.SignalR/tests/Azure.Mcp.Tools.SignalR.LiveTests/LiveServerCollection.cs b/tools/Azure.Mcp.Tools.SignalR/tests/Azure.Mcp.Tools.SignalR.LiveTests/LiveServerCollection.cs new file mode 100644 index 0000000000..74f2a6a931 --- /dev/null +++ b/tools/Azure.Mcp.Tools.SignalR/tests/Azure.Mcp.Tools.SignalR.LiveTests/LiveServerCollection.cs @@ -0,0 +1,10 @@ +using Azure.Mcp.Tests.Client; +using Xunit; + +namespace Azure.Mcp.Tools.SignalR.LiveTests +{ + [CollectionDefinition("LiveServer")] + public sealed class LiveServerCollection : ICollectionFixture + { + } +} diff --git a/tools/Azure.Mcp.Tools.Speech/tests/Azure.Mcp.Tools.Speech.LiveTests/LiveServerCollection.cs b/tools/Azure.Mcp.Tools.Speech/tests/Azure.Mcp.Tools.Speech.LiveTests/LiveServerCollection.cs new file mode 100644 index 0000000000..71183716a6 --- /dev/null +++ b/tools/Azure.Mcp.Tools.Speech/tests/Azure.Mcp.Tools.Speech.LiveTests/LiveServerCollection.cs @@ -0,0 +1,10 @@ +using Azure.Mcp.Tests.Client; +using Xunit; + +namespace Azure.Mcp.Tools.Speech.LiveTests +{ + [CollectionDefinition("LiveServer")] + public sealed class LiveServerCollection : ICollectionFixture + { + } +} diff --git a/tools/Azure.Mcp.Tools.Sql/tests/Azure.Mcp.Tools.Sql.LiveTests/LiveServerCollection.cs b/tools/Azure.Mcp.Tools.Sql/tests/Azure.Mcp.Tools.Sql.LiveTests/LiveServerCollection.cs new file mode 100644 index 0000000000..c0bdcc8b3f --- /dev/null +++ b/tools/Azure.Mcp.Tools.Sql/tests/Azure.Mcp.Tools.Sql.LiveTests/LiveServerCollection.cs @@ -0,0 +1,10 @@ +using Azure.Mcp.Tests.Client; +using Xunit; + +namespace Azure.Mcp.Tools.Sql.LiveTests +{ + [CollectionDefinition("LiveServer")] + public sealed class LiveServerCollection : ICollectionFixture + { + } +} diff --git a/tools/Azure.Mcp.Tools.Storage/tests/Azure.Mcp.Tools.Storage.LiveTests/LiveServerCollection.cs b/tools/Azure.Mcp.Tools.Storage/tests/Azure.Mcp.Tools.Storage.LiveTests/LiveServerCollection.cs new file mode 100644 index 0000000000..d6f46b61e3 --- /dev/null +++ b/tools/Azure.Mcp.Tools.Storage/tests/Azure.Mcp.Tools.Storage.LiveTests/LiveServerCollection.cs @@ -0,0 +1,10 @@ +using Azure.Mcp.Tests.Client; +using Xunit; + +namespace Azure.Mcp.Tools.Storage.LiveTests +{ + [CollectionDefinition("LiveServer")] + public sealed class LiveServerCollection : ICollectionFixture + { + } +} diff --git a/tools/Azure.Mcp.Tools.StorageSync/tests/Azure.Mcp.Tools.StorageSync.LiveTests/LiveServerCollection.cs b/tools/Azure.Mcp.Tools.StorageSync/tests/Azure.Mcp.Tools.StorageSync.LiveTests/LiveServerCollection.cs new file mode 100644 index 0000000000..10a36acf3b --- /dev/null +++ b/tools/Azure.Mcp.Tools.StorageSync/tests/Azure.Mcp.Tools.StorageSync.LiveTests/LiveServerCollection.cs @@ -0,0 +1,10 @@ +using Azure.Mcp.Tests.Client; +using Xunit; + +namespace Azure.Mcp.Tools.StorageSync.LiveTests +{ + [CollectionDefinition("LiveServer")] + public sealed class LiveServerCollection : ICollectionFixture + { + } +} diff --git a/tools/Azure.Mcp.Tools.VirtualDesktop/tests/Azure.Mcp.Tools.VirtualDesktop.LiveTests/LiveServerCollection.cs b/tools/Azure.Mcp.Tools.VirtualDesktop/tests/Azure.Mcp.Tools.VirtualDesktop.LiveTests/LiveServerCollection.cs new file mode 100644 index 0000000000..fdd4131707 --- /dev/null +++ b/tools/Azure.Mcp.Tools.VirtualDesktop/tests/Azure.Mcp.Tools.VirtualDesktop.LiveTests/LiveServerCollection.cs @@ -0,0 +1,10 @@ +using Azure.Mcp.Tests.Client; +using Xunit; + +namespace Azure.Mcp.Tools.VirtualDesktop.LiveTests +{ + [CollectionDefinition("LiveServer")] + public sealed class LiveServerCollection : ICollectionFixture + { + } +} diff --git a/tools/Azure.Mcp.Tools.Workbooks/tests/Azure.Mcp.Tools.Workbooks.LiveTests/LiveServerCollection.cs b/tools/Azure.Mcp.Tools.Workbooks/tests/Azure.Mcp.Tools.Workbooks.LiveTests/LiveServerCollection.cs new file mode 100644 index 0000000000..f2d35573c8 --- /dev/null +++ b/tools/Azure.Mcp.Tools.Workbooks/tests/Azure.Mcp.Tools.Workbooks.LiveTests/LiveServerCollection.cs @@ -0,0 +1,10 @@ +using Azure.Mcp.Tests.Client; +using Xunit; + +namespace Azure.Mcp.Tools.Workbooks.LiveTests +{ + [CollectionDefinition("LiveServer")] + public sealed class LiveServerCollection : ICollectionFixture + { + } +} From 82aeeb89defe1cbfb86ddc259dc197f6bc6163bf Mon Sep 17 00:00:00 2001 From: Chidozie Ononiwu Date: Wed, 4 Feb 2026 20:22:31 -0800 Subject: [PATCH 7/7] Update test files to use LiveServer collection --- .../tests/Azure.Mcp.Core.LiveTests/CommandTests.cs | 1 + .../tests/Azure.Mcp.Tools.Acr.LiveTests/AcrCommandTests.cs | 3 ++- .../tests/Azure.Mcp.Tools.Aks.LiveTests/AksCommandTests.cs | 3 ++- .../Azure.Mcp.Tools.Aks.LiveTests/NodepoolCommandTests.cs | 3 ++- .../Azure.Mcp.Tools.Aks.LiveTests/NodepoolGetCommandTests.cs | 3 ++- .../AppConfigCommandTests.cs | 3 ++- .../Database/DatabaseAddCommandLiveTests.cs | 3 ++- .../AuthorizationCommandTests.cs | 3 ++- .../AzureIsvCommandTests.cs | 3 ++- .../CommunicationCommandTests.cs | 3 ++- .../Email/EmailSendCommandLiveTests.cs | 3 ++- .../Azure.Mcp.Tools.Compute.LiveTests/ComputeCommandTests.cs | 3 ++- .../ConfidentialLedgerCommandTests.cs | 3 ++- .../Azure.Mcp.Tools.Cosmos.LiveTests/CosmosCommandTests.cs | 3 ++- .../Azure.Mcp.Tools.Deploy.LiveTests/DeployCommandTests.cs | 3 ++- .../EventGridCommandTests.cs | 4 ++-- .../EventHubsCommandTests.cs | 4 ++-- .../FileSharesCommandTests.cs | 3 ++- .../Azure.Mcp.Tools.Foundry.LiveTests/FoundryCommandTests.cs | 5 +++-- .../FunctionAppCommandTests.cs | 3 ++- .../Azure.Mcp.Tools.Grafana.LiveTests/GrafanaCommandTests.cs | 3 ++- .../KeyVaultCommandTests.cs | 3 ++- .../Azure.Mcp.Tools.Kusto.LiveTests/KustoCommandTests.cs | 3 ++- .../LoadTestingCommandTests.cs | 3 ++- .../ManagedLustreCommandTests.cs | 3 ++- .../ProductGetCommandTests.cs | 3 ++- .../ProductListCommandTests.cs | 3 ++- .../Azure.Mcp.Tools.Monitor.LiveTests/MonitorCommandTests.cs | 5 +++-- .../PostgresCommandTests.cs | 3 ++- .../PricingGetCommandTests.cs | 3 ++- .../Azure.Mcp.Tools.Quota.LiveTests/QuotaCommandTests.cs | 3 ++- .../Azure.Mcp.Tools.Redis.LiveTests/RedisCommandTests.cs | 3 ++- .../Azure.Mcp.Tools.Search.LiveTests/SearchCommandTests.cs | 3 ++- .../ServiceBusCommandTests.cs | 3 ++- .../Azure.Mcp.Tools.SignalR.LiveTests/SignalRCommandTests.cs | 5 +++-- .../Azure.Mcp.Tools.Speech.LiveTests/SpeechCommandTests.cs | 3 ++- .../tests/Azure.Mcp.Tools.Sql.LiveTests/SqlCommandTests.cs | 3 ++- .../Azure.Mcp.Tools.Storage.LiveTests/StorageCommandTests.cs | 3 ++- .../StorageSyncCommandTests.cs | 3 ++- .../VirtualDesktopCommandTests.cs | 3 ++- .../WorkbooksCommandTests.cs | 3 ++- 41 files changed, 84 insertions(+), 45 deletions(-) diff --git a/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.LiveTests/CommandTests.cs b/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.LiveTests/CommandTests.cs index 1180149947..a852828acd 100644 --- a/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.LiveTests/CommandTests.cs +++ b/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.LiveTests/CommandTests.cs @@ -10,6 +10,7 @@ namespace Azure.Mcp.Core.LiveTests; +[Collection("LiveServer")] public class CommandTests(ITestOutputHelper output, TestProxyFixture testProxyFixture, LiveServerFixture liveServerFixture) : RecordedCommandTestsBase(output, testProxyFixture, liveServerFixture) { [Fact] diff --git a/tools/Azure.Mcp.Tools.Acr/tests/Azure.Mcp.Tools.Acr.LiveTests/AcrCommandTests.cs b/tools/Azure.Mcp.Tools.Acr/tests/Azure.Mcp.Tools.Acr.LiveTests/AcrCommandTests.cs index cb1907a3e8..0e54164f42 100644 --- a/tools/Azure.Mcp.Tools.Acr/tests/Azure.Mcp.Tools.Acr.LiveTests/AcrCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Acr/tests/Azure.Mcp.Tools.Acr.LiveTests/AcrCommandTests.cs @@ -11,7 +11,8 @@ namespace Azure.Mcp.Tools.Acr.LiveTests; -public class AcrCommandTests(ITestOutputHelper output, TestProxyFixture fixture) : RecordedCommandTestsBase(output, fixture) +[Collection("LiveServer")] +public class AcrCommandTests(ITestOutputHelper output, TestProxyFixture fixture, LiveServerFixture liveServerFixture) : RecordedCommandTestsBase(output, fixture, liveServerFixture) { public override List DisabledDefaultSanitizers => [ diff --git a/tools/Azure.Mcp.Tools.Aks/tests/Azure.Mcp.Tools.Aks.LiveTests/AksCommandTests.cs b/tools/Azure.Mcp.Tools.Aks/tests/Azure.Mcp.Tools.Aks.LiveTests/AksCommandTests.cs index 38732bc6e0..22ce5217ff 100644 --- a/tools/Azure.Mcp.Tools.Aks/tests/Azure.Mcp.Tools.Aks.LiveTests/AksCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Aks/tests/Azure.Mcp.Tools.Aks.LiveTests/AksCommandTests.cs @@ -9,7 +9,8 @@ namespace Azure.Mcp.Tools.Aks.LiveTests; -public sealed class AksCommandTests(ITestOutputHelper output, TestProxyFixture fixture) : RecordedCommandTestsBase(output, fixture) +[Collection("LiveServer")] +public sealed class AksCommandTests(ITestOutputHelper output, TestProxyFixture fixture, LiveServerFixture liveServerFixture) : RecordedCommandTestsBase(output, fixture, liveServerFixture) { [Fact] diff --git a/tools/Azure.Mcp.Tools.Aks/tests/Azure.Mcp.Tools.Aks.LiveTests/NodepoolCommandTests.cs b/tools/Azure.Mcp.Tools.Aks/tests/Azure.Mcp.Tools.Aks.LiveTests/NodepoolCommandTests.cs index 41c5033277..53f84a8825 100644 --- a/tools/Azure.Mcp.Tools.Aks/tests/Azure.Mcp.Tools.Aks.LiveTests/NodepoolCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Aks/tests/Azure.Mcp.Tools.Aks.LiveTests/NodepoolCommandTests.cs @@ -9,7 +9,8 @@ namespace Azure.Mcp.Tools.Aks.LiveTests; -public sealed class NodepoolCommandTests(ITestOutputHelper output, TestProxyFixture fixture) : RecordedCommandTestsBase(output, fixture) +[Collection("LiveServer")] +public sealed class NodepoolCommandTests(ITestOutputHelper output, TestProxyFixture fixture, LiveServerFixture liveServerFixture) : RecordedCommandTestsBase(output, fixture, liveServerFixture) { [Fact] public async Task Should_list_nodepools_for_cluster() diff --git a/tools/Azure.Mcp.Tools.Aks/tests/Azure.Mcp.Tools.Aks.LiveTests/NodepoolGetCommandTests.cs b/tools/Azure.Mcp.Tools.Aks/tests/Azure.Mcp.Tools.Aks.LiveTests/NodepoolGetCommandTests.cs index 7149e43206..26694d9bc6 100644 --- a/tools/Azure.Mcp.Tools.Aks/tests/Azure.Mcp.Tools.Aks.LiveTests/NodepoolGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Aks/tests/Azure.Mcp.Tools.Aks.LiveTests/NodepoolGetCommandTests.cs @@ -9,7 +9,8 @@ namespace Azure.Mcp.Tools.Aks.LiveTests; -public sealed class NodepoolGetCommandTests(ITestOutputHelper output, TestProxyFixture fixture) : RecordedCommandTestsBase(output, fixture) +[Collection("LiveServer")] +public sealed class NodepoolGetCommandTests(ITestOutputHelper output, TestProxyFixture fixture, LiveServerFixture liveServerFixture) : RecordedCommandTestsBase(output, fixture, liveServerFixture) { [Fact] public async Task Should_get_nodepool_for_cluster() diff --git a/tools/Azure.Mcp.Tools.AppConfig/tests/Azure.Mcp.Tools.AppConfig.LiveTests/AppConfigCommandTests.cs b/tools/Azure.Mcp.Tools.AppConfig/tests/Azure.Mcp.Tools.AppConfig.LiveTests/AppConfigCommandTests.cs index 40440f7630..7091cd1f65 100644 --- a/tools/Azure.Mcp.Tools.AppConfig/tests/Azure.Mcp.Tools.AppConfig.LiveTests/AppConfigCommandTests.cs +++ b/tools/Azure.Mcp.Tools.AppConfig/tests/Azure.Mcp.Tools.AppConfig.LiveTests/AppConfigCommandTests.cs @@ -21,6 +21,7 @@ namespace Azure.Mcp.Tools.AppConfig.LiveTests; +[Collection("LiveServer")] public class AppConfigCommandTests : RecordedCommandTestsBase { private const string AccountsKey = "accounts"; @@ -35,7 +36,7 @@ public class AppConfigCommandTests : RecordedCommandTestsBase /// public override List DisabledDefaultSanitizers => [.. base.DisabledDefaultSanitizers, "AZSDK3493", "AZSDK3447"]; - public AppConfigCommandTests(ITestOutputHelper output, TestProxyFixture fixture) : base(output, fixture) + public AppConfigCommandTests(ITestOutputHelper output, TestProxyFixture fixture, LiveServerFixture liveServerFixture) : base(output, fixture, liveServerFixture) { _logger = NullLogger.Instance; var memoryCache = new MemoryCache(Microsoft.Extensions.Options.Options.Create(new MemoryCacheOptions())); diff --git a/tools/Azure.Mcp.Tools.AppService/tests/Azure.Mcp.Tools.AppService.LiveTests/Database/DatabaseAddCommandLiveTests.cs b/tools/Azure.Mcp.Tools.AppService/tests/Azure.Mcp.Tools.AppService.LiveTests/Database/DatabaseAddCommandLiveTests.cs index ee75f6a182..b58c4ed508 100644 --- a/tools/Azure.Mcp.Tools.AppService/tests/Azure.Mcp.Tools.AppService.LiveTests/Database/DatabaseAddCommandLiveTests.cs +++ b/tools/Azure.Mcp.Tools.AppService/tests/Azure.Mcp.Tools.AppService.LiveTests/Database/DatabaseAddCommandLiveTests.cs @@ -10,7 +10,8 @@ namespace Azure.Mcp.Tools.AppService.LiveTests.Database; [Trait("Command", "DatabaseAddCommand")] -public class DatabaseAddCommandLiveTests(ITestOutputHelper output, TestProxyFixture fixture) : RecordedCommandTestsBase(output, fixture) +[Collection("LiveServer")] +public class DatabaseAddCommandLiveTests(ITestOutputHelper output, TestProxyFixture fixture, LiveServerFixture liveServerFixture) : RecordedCommandTestsBase(output, fixture, liveServerFixture) { public override List BodyKeySanitizers => [ diff --git a/tools/Azure.Mcp.Tools.Authorization/tests/Azure.Mcp.Tools.Authorization.LiveTests/AuthorizationCommandTests.cs b/tools/Azure.Mcp.Tools.Authorization/tests/Azure.Mcp.Tools.Authorization.LiveTests/AuthorizationCommandTests.cs index 38f8a92f77..b238677966 100644 --- a/tools/Azure.Mcp.Tools.Authorization/tests/Azure.Mcp.Tools.Authorization.LiveTests/AuthorizationCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Authorization/tests/Azure.Mcp.Tools.Authorization.LiveTests/AuthorizationCommandTests.cs @@ -10,7 +10,8 @@ namespace Azure.Mcp.Tools.Authorization.LiveTests; -public class AuthorizationCommandTests(ITestOutputHelper output, TestProxyFixture fixture) : RecordedCommandTestsBase(output, fixture) +[Collection("LiveServer")] +public class AuthorizationCommandTests(ITestOutputHelper output, TestProxyFixture fixture, LiveServerFixture liveServerFixture) : RecordedCommandTestsBase(output, fixture, liveServerFixture) { [Fact] public async Task Should_list_role_assignments() diff --git a/tools/Azure.Mcp.Tools.AzureIsv/tests/Azure.Mcp.Tools.AzureIsv.LiveTests/AzureIsvCommandTests.cs b/tools/Azure.Mcp.Tools.AzureIsv/tests/Azure.Mcp.Tools.AzureIsv.LiveTests/AzureIsvCommandTests.cs index 02d1d6a738..cb39234ff4 100644 --- a/tools/Azure.Mcp.Tools.AzureIsv/tests/Azure.Mcp.Tools.AzureIsv.LiveTests/AzureIsvCommandTests.cs +++ b/tools/Azure.Mcp.Tools.AzureIsv/tests/Azure.Mcp.Tools.AzureIsv.LiveTests/AzureIsvCommandTests.cs @@ -9,7 +9,8 @@ namespace Azure.Mcp.Tools.AzureIsv.LiveTests; -public class AzureIsvCommandTests(ITestOutputHelper output, TestProxyFixture fixture) : RecordedCommandTestsBase(output, fixture) +[Collection("LiveServer")] +public class AzureIsvCommandTests(ITestOutputHelper output, TestProxyFixture fixture, LiveServerFixture liveServerFixture) : RecordedCommandTestsBase(output, fixture, liveServerFixture) { [Fact] public async Task Should_list_datadog_monitored_resources() diff --git a/tools/Azure.Mcp.Tools.Communication/tests/Azure.Mcp.Tools.Communication.LiveTests/CommunicationCommandTests.cs b/tools/Azure.Mcp.Tools.Communication/tests/Azure.Mcp.Tools.Communication.LiveTests/CommunicationCommandTests.cs index 574c6d721d..b84184d29b 100644 --- a/tools/Azure.Mcp.Tools.Communication/tests/Azure.Mcp.Tools.Communication.LiveTests/CommunicationCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Communication/tests/Azure.Mcp.Tools.Communication.LiveTests/CommunicationCommandTests.cs @@ -10,7 +10,8 @@ namespace Azure.Mcp.Tools.Communication.LiveTests; [Trait("Command", "SmsSendCommand")] -public class CommunicationCommandTests(ITestOutputHelper output, TestProxyFixture fixture) : RecordedCommandTestsBase(output, fixture) +[Collection("LiveServer")] +public class CommunicationCommandTests(ITestOutputHelper output, TestProxyFixture fixture, LiveServerFixture liveServerFixture) : RecordedCommandTestsBase(output, fixture, liveServerFixture) { private const string EmptyGuid = "00000000-0000-0000-0000-000000000000"; private string? endpointRecorded; diff --git a/tools/Azure.Mcp.Tools.Communication/tests/Azure.Mcp.Tools.Communication.LiveTests/Email/EmailSendCommandLiveTests.cs b/tools/Azure.Mcp.Tools.Communication/tests/Azure.Mcp.Tools.Communication.LiveTests/Email/EmailSendCommandLiveTests.cs index cffe17b772..91d8a09e79 100644 --- a/tools/Azure.Mcp.Tools.Communication/tests/Azure.Mcp.Tools.Communication.LiveTests/Email/EmailSendCommandLiveTests.cs +++ b/tools/Azure.Mcp.Tools.Communication/tests/Azure.Mcp.Tools.Communication.LiveTests/Email/EmailSendCommandLiveTests.cs @@ -12,7 +12,8 @@ namespace Azure.Mcp.Tools.Communication.LiveTests.Email; [Trait("Command", "EmailSendCommand")] -public class EmailSendCommandLiveTests(ITestOutputHelper output, TestProxyFixture fixture) : RecordedCommandTestsBase(output, fixture) +[Collection("LiveServer")] +public class EmailSendCommandLiveTests(ITestOutputHelper output, TestProxyFixture fixture, LiveServerFixture liveServerFixture) : RecordedCommandTestsBase(output, fixture, liveServerFixture) { private const string EmptyGuid = "00000000-0000-0000-0000-000000000000"; private string? endpointRecorded; diff --git a/tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.LiveTests/ComputeCommandTests.cs b/tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.LiveTests/ComputeCommandTests.cs index 11a10431a2..14afca85d6 100644 --- a/tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.LiveTests/ComputeCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.LiveTests/ComputeCommandTests.cs @@ -10,7 +10,8 @@ namespace Azure.Mcp.Tools.Compute.LiveTests; -public class ComputeCommandTests(ITestOutputHelper output, TestProxyFixture fixture) : RecordedCommandTestsBase(output, fixture) +[Collection("LiveServer")] +public class ComputeCommandTests(ITestOutputHelper output, TestProxyFixture fixture, LiveServerFixture liveServerFixture) : RecordedCommandTestsBase(output, fixture, liveServerFixture) { // Use Settings.ResourceBaseName with suffixes (following SQL pattern) private string VmName => $"{Settings.ResourceBaseName}-vm"; diff --git a/tools/Azure.Mcp.Tools.ConfidentialLedger/tests/Azure.Mcp.Tools.ConfidentialLedger.LiveTests/ConfidentialLedgerCommandTests.cs b/tools/Azure.Mcp.Tools.ConfidentialLedger/tests/Azure.Mcp.Tools.ConfidentialLedger.LiveTests/ConfidentialLedgerCommandTests.cs index 2ac0974818..89b6459d03 100644 --- a/tools/Azure.Mcp.Tools.ConfidentialLedger/tests/Azure.Mcp.Tools.ConfidentialLedger.LiveTests/ConfidentialLedgerCommandTests.cs +++ b/tools/Azure.Mcp.Tools.ConfidentialLedger/tests/Azure.Mcp.Tools.ConfidentialLedger.LiveTests/ConfidentialLedgerCommandTests.cs @@ -8,7 +8,8 @@ namespace Azure.Mcp.Tools.ConfidentialLedger.LiveTests; -public class ConfidentialLedgerCommandTests(ITestOutputHelper output) : CommandTestsBase(output) +[Collection("LiveServer")] +public class ConfidentialLedgerCommandTests(ITestOutputHelper output, LiveServerFixture liveServerFixture) : CommandTestsBase(output, liveServerFixture) { [Fact] public async Task Should_append_entry_successfully() diff --git a/tools/Azure.Mcp.Tools.Cosmos/tests/Azure.Mcp.Tools.Cosmos.LiveTests/CosmosCommandTests.cs b/tools/Azure.Mcp.Tools.Cosmos/tests/Azure.Mcp.Tools.Cosmos.LiveTests/CosmosCommandTests.cs index c8030f6f9a..32e64b6a81 100644 --- a/tools/Azure.Mcp.Tools.Cosmos/tests/Azure.Mcp.Tools.Cosmos.LiveTests/CosmosCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Cosmos/tests/Azure.Mcp.Tools.Cosmos.LiveTests/CosmosCommandTests.cs @@ -10,7 +10,8 @@ namespace Azure.Mcp.Tools.Cosmos.LiveTests; -public class CosmosCommandTests(ITestOutputHelper output, TestProxyFixture fixture) : RecordedCommandTestsBase(output, fixture) +[Collection("LiveServer")] +public class CosmosCommandTests(ITestOutputHelper output, TestProxyFixture fixture, LiveServerFixture liveServerFixture) : RecordedCommandTestsBase(output, fixture, liveServerFixture) { protected override RecordingOptions? RecordingOptions => new() { diff --git a/tools/Azure.Mcp.Tools.Deploy/tests/Azure.Mcp.Tools.Deploy.LiveTests/DeployCommandTests.cs b/tools/Azure.Mcp.Tools.Deploy/tests/Azure.Mcp.Tools.Deploy.LiveTests/DeployCommandTests.cs index c1b73ce2bf..297d87acf4 100644 --- a/tools/Azure.Mcp.Tools.Deploy/tests/Azure.Mcp.Tools.Deploy.LiveTests/DeployCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Deploy/tests/Azure.Mcp.Tools.Deploy.LiveTests/DeployCommandTests.cs @@ -9,7 +9,8 @@ namespace Azure.Mcp.Tools.Deploy.LiveTests; -public class DeployCommandTests(ITestOutputHelper output, TestProxyFixture fixture) : RecordedCommandTestsBase(output, fixture) +[Collection("LiveServer")] +public class DeployCommandTests(ITestOutputHelper output, TestProxyFixture fixture, LiveServerFixture liveServerFixture) : RecordedCommandTestsBase(output, fixture, liveServerFixture) { private string _subscriptionId = default!; diff --git a/tools/Azure.Mcp.Tools.EventGrid/tests/Azure.Mcp.Tools.EventGrid.LiveTests/EventGridCommandTests.cs b/tools/Azure.Mcp.Tools.EventGrid/tests/Azure.Mcp.Tools.EventGrid.LiveTests/EventGridCommandTests.cs index 802c301a57..5ab1d04af3 100644 --- a/tools/Azure.Mcp.Tools.EventGrid/tests/Azure.Mcp.Tools.EventGrid.LiveTests/EventGridCommandTests.cs +++ b/tools/Azure.Mcp.Tools.EventGrid/tests/Azure.Mcp.Tools.EventGrid.LiveTests/EventGridCommandTests.cs @@ -10,8 +10,8 @@ namespace Azure.Mcp.Tools.EventGrid.LiveTests; -public class EventGridCommandTests(ITestOutputHelper output, TestProxyFixture fixture) - : RecordedCommandTestsBase(output, fixture) +[Collection("LiveServer")] +public class EventGridCommandTests(ITestOutputHelper output, TestProxyFixture fixture, LiveServerFixture liveServerFixture) : RecordedCommandTestsBase(output, fixture, liveServerFixture) { public override List UriRegexSanitizers => [ diff --git a/tools/Azure.Mcp.Tools.EventHubs/tests/Azure.Mcp.Tools.EventHubs.LiveTests/EventHubsCommandTests.cs b/tools/Azure.Mcp.Tools.EventHubs/tests/Azure.Mcp.Tools.EventHubs.LiveTests/EventHubsCommandTests.cs index 93931baf0c..bae748b4ed 100644 --- a/tools/Azure.Mcp.Tools.EventHubs/tests/Azure.Mcp.Tools.EventHubs.LiveTests/EventHubsCommandTests.cs +++ b/tools/Azure.Mcp.Tools.EventHubs/tests/Azure.Mcp.Tools.EventHubs.LiveTests/EventHubsCommandTests.cs @@ -11,8 +11,8 @@ namespace Azure.Mcp.Tools.EventHubs.LiveTests; -public class EventHubsCommandTests(ITestOutputHelper output, TestProxyFixture fixture) - : RecordedCommandTestsBase(output, fixture) +[Collection("LiveServer")] +public class EventHubsCommandTests(ITestOutputHelper output, TestProxyFixture fixture, LiveServerFixture liveServerFixture) : RecordedCommandTestsBase(output, fixture, liveServerFixture) { // Disable AZSDK2003 sanitizer to prevent it from over-sanitizing resource names in recordings. public override List DisabledDefaultSanitizers => diff --git a/tools/Azure.Mcp.Tools.FileShares/tests/Azure.Mcp.Tools.FileShares.LiveTests/FileSharesCommandTests.cs b/tools/Azure.Mcp.Tools.FileShares/tests/Azure.Mcp.Tools.FileShares.LiveTests/FileSharesCommandTests.cs index b3b83dc582..91cd839ec7 100644 --- a/tools/Azure.Mcp.Tools.FileShares/tests/Azure.Mcp.Tools.FileShares.LiveTests/FileSharesCommandTests.cs +++ b/tools/Azure.Mcp.Tools.FileShares/tests/Azure.Mcp.Tools.FileShares.LiveTests/FileSharesCommandTests.cs @@ -15,7 +15,8 @@ namespace Azure.Mcp.Tools.FileShares.LiveTests; /// Live tests for FileShares commands. /// These tests exercise the actual Azure FileShares resource provider with real resources. /// -public class FileSharesCommandTests(ITestOutputHelper output, TestProxyFixture fixture) : RecordedCommandTestsBase(output, fixture) +[Collection("LiveServer")] +public class FileSharesCommandTests(ITestOutputHelper output, TestProxyFixture fixture, LiveServerFixture liveServerFixture) : RecordedCommandTestsBase(output, fixture, liveServerFixture) { private string FileShare1Name => $"{Settings.ResourceBaseName}-fileshare-01"; private string FileShare2Name => $"{Settings.ResourceBaseName}-fileshare-02"; diff --git a/tools/Azure.Mcp.Tools.Foundry/tests/Azure.Mcp.Tools.Foundry.LiveTests/FoundryCommandTests.cs b/tools/Azure.Mcp.Tools.Foundry/tests/Azure.Mcp.Tools.Foundry.LiveTests/FoundryCommandTests.cs index ecb66b6f2b..e8debcea63 100644 --- a/tools/Azure.Mcp.Tools.Foundry/tests/Azure.Mcp.Tools.Foundry.LiveTests/FoundryCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Foundry/tests/Azure.Mcp.Tools.Foundry.LiveTests/FoundryCommandTests.cs @@ -11,8 +11,9 @@ namespace Azure.Mcp.Tools.Foundry.LiveTests; -public class FoundryCommandTests(ITestOutputHelper output) - : CommandTestsBase(output) +[Collection("LiveServer")] +public class FoundryCommandTests(ITestOutputHelper output, LiveServerFixture liveServerFixture) + : CommandTestsBase(output, liveServerFixture) { [Fact] public async Task Should_list_foundry_models() diff --git a/tools/Azure.Mcp.Tools.FunctionApp/tests/Azure.Mcp.Tools.FunctionApp.LiveTests/FunctionAppCommandTests.cs b/tools/Azure.Mcp.Tools.FunctionApp/tests/Azure.Mcp.Tools.FunctionApp.LiveTests/FunctionAppCommandTests.cs index eee5053a8a..12e35d2f10 100644 --- a/tools/Azure.Mcp.Tools.FunctionApp/tests/Azure.Mcp.Tools.FunctionApp.LiveTests/FunctionAppCommandTests.cs +++ b/tools/Azure.Mcp.Tools.FunctionApp/tests/Azure.Mcp.Tools.FunctionApp.LiveTests/FunctionAppCommandTests.cs @@ -10,7 +10,8 @@ namespace Azure.Mcp.Tools.FunctionApp.LiveTests; -public sealed class FunctionAppCommandTests(ITestOutputHelper output, TestProxyFixture fixture) : RecordedCommandTestsBase(output, fixture) +[Collection("LiveServer")] +public sealed class FunctionAppCommandTests(ITestOutputHelper output, TestProxyFixture fixture, LiveServerFixture liveServerFixture) : RecordedCommandTestsBase(output, fixture, liveServerFixture) { public override List BodyKeySanitizers => [ diff --git a/tools/Azure.Mcp.Tools.Grafana/tests/Azure.Mcp.Tools.Grafana.LiveTests/GrafanaCommandTests.cs b/tools/Azure.Mcp.Tools.Grafana/tests/Azure.Mcp.Tools.Grafana.LiveTests/GrafanaCommandTests.cs index 6413a4f32e..1af1ce6d9a 100644 --- a/tools/Azure.Mcp.Tools.Grafana/tests/Azure.Mcp.Tools.Grafana.LiveTests/GrafanaCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Grafana/tests/Azure.Mcp.Tools.Grafana.LiveTests/GrafanaCommandTests.cs @@ -9,7 +9,8 @@ namespace Azure.Mcp.Tools.Grafana.LiveTests; -public class GrafanaCommandTests(ITestOutputHelper output, TestProxyFixture fixture) : RecordedCommandTestsBase(output, fixture) +[Collection("LiveServer")] +public class GrafanaCommandTests(ITestOutputHelper output, TestProxyFixture fixture, LiveServerFixture liveServerFixture) : RecordedCommandTestsBase(output, fixture, liveServerFixture) { [Fact] public async Task Should_list_grafana_workspaces_by_subscription_id() diff --git a/tools/Azure.Mcp.Tools.KeyVault/tests/Azure.Mcp.Tools.KeyVault.LiveTests/KeyVaultCommandTests.cs b/tools/Azure.Mcp.Tools.KeyVault/tests/Azure.Mcp.Tools.KeyVault.LiveTests/KeyVaultCommandTests.cs index 1f13949254..37e3d1e228 100644 --- a/tools/Azure.Mcp.Tools.KeyVault/tests/Azure.Mcp.Tools.KeyVault.LiveTests/KeyVaultCommandTests.cs +++ b/tools/Azure.Mcp.Tools.KeyVault/tests/Azure.Mcp.Tools.KeyVault.LiveTests/KeyVaultCommandTests.cs @@ -14,7 +14,8 @@ namespace Azure.Mcp.Tools.KeyVault.LiveTests; -public class KeyVaultCommandTests(ITestOutputHelper output, TestProxyFixture fixture) : RecordedCommandTestsBase(output, fixture) +[Collection("LiveServer")] +public class KeyVaultCommandTests(ITestOutputHelper output, TestProxyFixture fixture, LiveServerFixture liveServerFixture) : RecordedCommandTestsBase(output, fixture, liveServerFixture) { private readonly KeyVaultTestCertificateAssets _importCertificateAssets = KeyVaultTestCertificates.Load(); diff --git a/tools/Azure.Mcp.Tools.Kusto/tests/Azure.Mcp.Tools.Kusto.LiveTests/KustoCommandTests.cs b/tools/Azure.Mcp.Tools.Kusto/tests/Azure.Mcp.Tools.Kusto.LiveTests/KustoCommandTests.cs index 17d92706f9..ce20afec9e 100644 --- a/tools/Azure.Mcp.Tools.Kusto/tests/Azure.Mcp.Tools.Kusto.LiveTests/KustoCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Kusto/tests/Azure.Mcp.Tools.Kusto.LiveTests/KustoCommandTests.cs @@ -14,6 +14,7 @@ namespace Azure.Mcp.Tools.Kusto.LiveTests; +[Collection("LiveServer")] public class KustoCommandTests : RecordedCommandTestsBase { private const string TestDatabaseName = "ToDoLists"; @@ -22,7 +23,7 @@ public class KustoCommandTests : RecordedCommandTestsBase private const string Sanitized = "Sanitized"; private readonly ServiceProvider _httpClientProvider; - public KustoCommandTests(ITestOutputHelper output, TestProxyFixture fixture) : base(output, fixture) + public KustoCommandTests(ITestOutputHelper output, TestProxyFixture fixture, LiveServerFixture liveServerFixture) : base(output, fixture, liveServerFixture) { _httpClientProvider = TestHttpClientFactoryProvider.Create(fixture); } diff --git a/tools/Azure.Mcp.Tools.LoadTesting/tests/Azure.Mcp.Tools.LoadTesting.LiveTests/LoadTestingCommandTests.cs b/tools/Azure.Mcp.Tools.LoadTesting/tests/Azure.Mcp.Tools.LoadTesting.LiveTests/LoadTestingCommandTests.cs index 9dd041347b..020286df40 100644 --- a/tools/Azure.Mcp.Tools.LoadTesting/tests/Azure.Mcp.Tools.LoadTesting.LiveTests/LoadTestingCommandTests.cs +++ b/tools/Azure.Mcp.Tools.LoadTesting/tests/Azure.Mcp.Tools.LoadTesting.LiveTests/LoadTestingCommandTests.cs @@ -10,7 +10,8 @@ namespace Azure.Mcp.Tools.LoadTesting.LiveTests; -public class LoadTestingCommandTests(ITestOutputHelper output, TestProxyFixture fixture) : RecordedCommandTestsBase(output, fixture) +[Collection("LiveServer")] +public class LoadTestingCommandTests(ITestOutputHelper output, TestProxyFixture fixture, LiveServerFixture liveServerFixture) : RecordedCommandTestsBase(output, fixture, liveServerFixture) { private const string TestResourceName = "TestResourceName"; private const string TestRunId = "TestRunId"; diff --git a/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.LiveTests/ManagedLustreCommandTests.cs b/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.LiveTests/ManagedLustreCommandTests.cs index 130e4408e8..b6211195dc 100644 --- a/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.LiveTests/ManagedLustreCommandTests.cs +++ b/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.LiveTests/ManagedLustreCommandTests.cs @@ -12,7 +12,8 @@ namespace Azure.Mcp.Tools.ManagedLustre.LiveTests; -public partial class ManagedLustreCommandTests(ITestOutputHelper output, TestProxyFixture fixture) : RecordedCommandTestsBase(output, fixture) +[Collection("LiveServer")] +public partial class ManagedLustreCommandTests(ITestOutputHelper output, TestProxyFixture fixture, LiveServerFixture liveServerFixture) : RecordedCommandTestsBase(output, fixture, liveServerFixture) { private static readonly string[] _sanitizedHeaders = [ diff --git a/tools/Azure.Mcp.Tools.Marketplace/tests/Azure.Mcp.Tools.Marketplace.LiveTests/ProductGetCommandTests.cs b/tools/Azure.Mcp.Tools.Marketplace/tests/Azure.Mcp.Tools.Marketplace.LiveTests/ProductGetCommandTests.cs index 0473bbbc55..f1144dd25b 100644 --- a/tools/Azure.Mcp.Tools.Marketplace/tests/Azure.Mcp.Tools.Marketplace.LiveTests/ProductGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Marketplace/tests/Azure.Mcp.Tools.Marketplace.LiveTests/ProductGetCommandTests.cs @@ -9,7 +9,8 @@ namespace Azure.Mcp.Tools.Marketplace.LiveTests; -public sealed class ProductGetCommandTests(ITestOutputHelper output, TestProxyFixture fixture) : RecordedCommandTestsBase(output, fixture) +[Collection("LiveServer")] +public sealed class ProductGetCommandTests(ITestOutputHelper output, TestProxyFixture fixture, LiveServerFixture liveServerFixture) : RecordedCommandTestsBase(output, fixture, liveServerFixture) { private const string ProductKey = "product"; private const string ProductId = "test_test_pmc2pc1.vmsr_uat_beta"; diff --git a/tools/Azure.Mcp.Tools.Marketplace/tests/Azure.Mcp.Tools.Marketplace.LiveTests/ProductListCommandTests.cs b/tools/Azure.Mcp.Tools.Marketplace/tests/Azure.Mcp.Tools.Marketplace.LiveTests/ProductListCommandTests.cs index 21efe1f1fe..fce93b4999 100644 --- a/tools/Azure.Mcp.Tools.Marketplace/tests/Azure.Mcp.Tools.Marketplace.LiveTests/ProductListCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Marketplace/tests/Azure.Mcp.Tools.Marketplace.LiveTests/ProductListCommandTests.cs @@ -9,7 +9,8 @@ namespace Azure.Mcp.Tools.Marketplace.LiveTests; -public sealed class ProductListCommandTests(ITestOutputHelper output, TestProxyFixture fixture) : RecordedCommandTestsBase(output, fixture) +[Collection("LiveServer")] +public sealed class ProductListCommandTests(ITestOutputHelper output, TestProxyFixture fixture, LiveServerFixture liveServerFixture) : RecordedCommandTestsBase(output, fixture, liveServerFixture) { private const string ProductsKey = "products"; private const string Language = "en"; diff --git a/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.LiveTests/MonitorCommandTests.cs b/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.LiveTests/MonitorCommandTests.cs index 021be7de10..bbfe0ba96c 100644 --- a/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.LiveTests/MonitorCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.LiveTests/MonitorCommandTests.cs @@ -22,6 +22,7 @@ namespace Azure.Mcp.Tools.Monitor.LiveTests; +[Collection("LiveServer")] public sealed class MonitorCommandTests : RecordedCommandTestsBase { private LogAnalyticsHelper? _logHelper; @@ -35,8 +36,8 @@ public sealed class MonitorCommandTests : RecordedCommandTestsBase private string? _appInsightsName; private string? _bingWebTestName; - public MonitorCommandTests(ITestOutputHelper output, TestProxyFixture fixture) - : base(output, fixture) + public MonitorCommandTests(ITestOutputHelper output, TestProxyFixture fixture, LiveServerFixture liveServerFixture) + : base(output, fixture, liveServerFixture) { _memoryCache = new MemoryCache(new MemoryCacheOptions()); var cacheService = new SingleUserCliCacheService(_memoryCache); diff --git a/tools/Azure.Mcp.Tools.Postgres/tests/Azure.Mcp.Tools.Postgres.LiveTests/PostgresCommandTests.cs b/tools/Azure.Mcp.Tools.Postgres/tests/Azure.Mcp.Tools.Postgres.LiveTests/PostgresCommandTests.cs index 5ddbac9b5d..ac3fce966c 100644 --- a/tools/Azure.Mcp.Tools.Postgres/tests/Azure.Mcp.Tools.Postgres.LiveTests/PostgresCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Postgres/tests/Azure.Mcp.Tools.Postgres.LiveTests/PostgresCommandTests.cs @@ -13,7 +13,8 @@ namespace Azure.Mcp.Tools.Postgres.LiveTests; -public class PostgresCommandTests(ITestOutputHelper output) : CommandTestsBase(output) +[Collection("LiveServer")] +public class PostgresCommandTests(ITestOutputHelper output, LiveServerFixture liveServerFixture) : CommandTestsBase(output, liveServerFixture) { private string TestDatabaseName => Settings.DeploymentOutputs["TESTDATABASENAME"]; private string ServerName => Settings.DeploymentOutputs["POSTGRESSERVERNAME"]; diff --git a/tools/Azure.Mcp.Tools.Pricing/tests/Azure.Mcp.Tools.Pricing.LiveTests/PricingGetCommandTests.cs b/tools/Azure.Mcp.Tools.Pricing/tests/Azure.Mcp.Tools.Pricing.LiveTests/PricingGetCommandTests.cs index c3b4bacada..64ef23c9d7 100644 --- a/tools/Azure.Mcp.Tools.Pricing/tests/Azure.Mcp.Tools.Pricing.LiveTests/PricingGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Pricing/tests/Azure.Mcp.Tools.Pricing.LiveTests/PricingGetCommandTests.cs @@ -14,7 +14,8 @@ namespace Azure.Mcp.Tools.Pricing.LiveTests; /// These tests call the real Azure Retail Prices API (https://prices.azure.com). /// The API is public and does not require authentication. /// -public sealed class PricingGetCommandTests(ITestOutputHelper output, TestProxyFixture fixture) : RecordedCommandTestsBase(output, fixture) +[Collection("LiveServer")] +public sealed class PricingGetCommandTests(ITestOutputHelper output, TestProxyFixture fixture, LiveServerFixture liveServerFixture) : RecordedCommandTestsBase(output, fixture, liveServerFixture) { private const string PricesKey = "prices"; public override bool EnableDefaultSanitizerAdditions => false; diff --git a/tools/Azure.Mcp.Tools.Quota/tests/Azure.Mcp.Tools.Quota.LiveTests/QuotaCommandTests.cs b/tools/Azure.Mcp.Tools.Quota/tests/Azure.Mcp.Tools.Quota.LiveTests/QuotaCommandTests.cs index ba60488905..33c5641c16 100644 --- a/tools/Azure.Mcp.Tools.Quota/tests/Azure.Mcp.Tools.Quota.LiveTests/QuotaCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Quota/tests/Azure.Mcp.Tools.Quota.LiveTests/QuotaCommandTests.cs @@ -10,7 +10,8 @@ namespace Azure.Mcp.Tools.Quota.LiveTests; -public sealed class QuotaCommandTests(ITestOutputHelper output, TestProxyFixture fixture) : RecordedCommandTestsBase(output, fixture) +[Collection("LiveServer")] +public sealed class QuotaCommandTests(ITestOutputHelper output, TestProxyFixture fixture, LiveServerFixture liveServerFixture) : RecordedCommandTestsBase(output, fixture, liveServerFixture) { /// /// Disable the default sanitizer that redacts all JSON properties named "name". We need this diff --git a/tools/Azure.Mcp.Tools.Redis/tests/Azure.Mcp.Tools.Redis.LiveTests/RedisCommandTests.cs b/tools/Azure.Mcp.Tools.Redis/tests/Azure.Mcp.Tools.Redis.LiveTests/RedisCommandTests.cs index eb043587fa..ea2fe0dcf7 100644 --- a/tools/Azure.Mcp.Tools.Redis/tests/Azure.Mcp.Tools.Redis.LiveTests/RedisCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Redis/tests/Azure.Mcp.Tools.Redis.LiveTests/RedisCommandTests.cs @@ -10,7 +10,8 @@ namespace Azure.Mcp.Tools.Redis.LiveTests; -public class RedisCommandTests(ITestOutputHelper output, TestProxyFixture fixture) : RecordedCommandTestsBase(output, fixture) +[Collection("LiveServer")] +public class RedisCommandTests(ITestOutputHelper output, TestProxyFixture fixture, LiveServerFixture liveServerFixture) : RecordedCommandTestsBase(output, fixture, liveServerFixture) { public override List BodyKeySanitizers { get; } = new List { diff --git a/tools/Azure.Mcp.Tools.Search/tests/Azure.Mcp.Tools.Search.LiveTests/SearchCommandTests.cs b/tools/Azure.Mcp.Tools.Search/tests/Azure.Mcp.Tools.Search.LiveTests/SearchCommandTests.cs index f8170a662c..c58810b5e2 100644 --- a/tools/Azure.Mcp.Tools.Search/tests/Azure.Mcp.Tools.Search.LiveTests/SearchCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Search/tests/Azure.Mcp.Tools.Search.LiveTests/SearchCommandTests.cs @@ -10,7 +10,8 @@ namespace Azure.Mcp.Tools.Search.LiveTests; -public class SearchCommandTests(ITestOutputHelper output, TestProxyFixture fixture) : RecordedCommandTestsBase(output, fixture) +[Collection("LiveServer")] +public class SearchCommandTests(ITestOutputHelper output, TestProxyFixture fixture, LiveServerFixture liveServerFixture) : RecordedCommandTestsBase(output, fixture, liveServerFixture) { private const string IndexName = "products"; private const string SanitizedValue = "Sanitized"; diff --git a/tools/Azure.Mcp.Tools.ServiceBus/tests/Azure.Mcp.Tools.ServiceBus.LiveTests/ServiceBusCommandTests.cs b/tools/Azure.Mcp.Tools.ServiceBus/tests/Azure.Mcp.Tools.ServiceBus.LiveTests/ServiceBusCommandTests.cs index d31c5e2f16..62ec746602 100644 --- a/tools/Azure.Mcp.Tools.ServiceBus/tests/Azure.Mcp.Tools.ServiceBus.LiveTests/ServiceBusCommandTests.cs +++ b/tools/Azure.Mcp.Tools.ServiceBus/tests/Azure.Mcp.Tools.ServiceBus.LiveTests/ServiceBusCommandTests.cs @@ -16,7 +16,8 @@ namespace Azure.Mcp.Tools.ServiceBus.LiveTests { - public class ServiceBusCommandTests(ITestOutputHelper output, TestProxyFixture fixture) : RecordedCommandTestsBase(output, fixture) + [Collection("LiveServer")] + public class ServiceBusCommandTests(ITestOutputHelper output, TestProxyFixture fixture, LiveServerFixture liveServerFixture) : RecordedCommandTestsBase(output, fixture, liveServerFixture) { private const string QueueName = "queue1"; private const string TopicName = "topic1"; diff --git a/tools/Azure.Mcp.Tools.SignalR/tests/Azure.Mcp.Tools.SignalR.LiveTests/SignalRCommandTests.cs b/tools/Azure.Mcp.Tools.SignalR/tests/Azure.Mcp.Tools.SignalR.LiveTests/SignalRCommandTests.cs index 1ca9adf94a..2184c71ba8 100644 --- a/tools/Azure.Mcp.Tools.SignalR/tests/Azure.Mcp.Tools.SignalR.LiveTests/SignalRCommandTests.cs +++ b/tools/Azure.Mcp.Tools.SignalR/tests/Azure.Mcp.Tools.SignalR.LiveTests/SignalRCommandTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Text.Json; @@ -10,7 +10,8 @@ namespace Azure.Mcp.Tools.SignalR.LiveTests; -public sealed class SignalRCommandTests(ITestOutputHelper output, TestProxyFixture fixture) : RecordedCommandTestsBase(output, fixture) +[Collection("LiveServer")] +public sealed class SignalRCommandTests(ITestOutputHelper output, TestProxyFixture fixture, LiveServerFixture liveServerFixture) : RecordedCommandTestsBase(output, fixture, liveServerFixture) { private const string SanitizedValue = "Sanitized"; diff --git a/tools/Azure.Mcp.Tools.Speech/tests/Azure.Mcp.Tools.Speech.LiveTests/SpeechCommandTests.cs b/tools/Azure.Mcp.Tools.Speech/tests/Azure.Mcp.Tools.Speech.LiveTests/SpeechCommandTests.cs index 7281babb70..187265e9ca 100644 --- a/tools/Azure.Mcp.Tools.Speech/tests/Azure.Mcp.Tools.Speech.LiveTests/SpeechCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Speech/tests/Azure.Mcp.Tools.Speech.LiveTests/SpeechCommandTests.cs @@ -10,7 +10,8 @@ namespace Azure.Mcp.Tools.Speech.LiveTests; -public class SpeechCommandTests(ITestOutputHelper output) : CommandTestsBase(output) +[Collection("LiveServer")] +public class SpeechCommandTests(ITestOutputHelper output, LiveServerFixture liveServerFixture) : CommandTestsBase(output, liveServerFixture) { #region SpeechToText Tests diff --git a/tools/Azure.Mcp.Tools.Sql/tests/Azure.Mcp.Tools.Sql.LiveTests/SqlCommandTests.cs b/tools/Azure.Mcp.Tools.Sql/tests/Azure.Mcp.Tools.Sql.LiveTests/SqlCommandTests.cs index 4fe733d8ce..8116eb89d3 100644 --- a/tools/Azure.Mcp.Tools.Sql/tests/Azure.Mcp.Tools.Sql.LiveTests/SqlCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Sql/tests/Azure.Mcp.Tools.Sql.LiveTests/SqlCommandTests.cs @@ -11,7 +11,8 @@ namespace Azure.Mcp.Tools.Sql.LiveTests; -public class SqlCommandTests(ITestOutputHelper output, TestProxyFixture fixture) : RecordedCommandTestsBase(output, fixture) +[Collection("LiveServer")] +public class SqlCommandTests(ITestOutputHelper output, TestProxyFixture fixture, LiveServerFixture liveServerFixture) : RecordedCommandTestsBase(output, fixture, liveServerFixture) { /// /// AZSDK3493 = $..name diff --git a/tools/Azure.Mcp.Tools.Storage/tests/Azure.Mcp.Tools.Storage.LiveTests/StorageCommandTests.cs b/tools/Azure.Mcp.Tools.Storage/tests/Azure.Mcp.Tools.Storage.LiveTests/StorageCommandTests.cs index 0ebd81e5b4..19ddc0104f 100644 --- a/tools/Azure.Mcp.Tools.Storage/tests/Azure.Mcp.Tools.Storage.LiveTests/StorageCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Storage/tests/Azure.Mcp.Tools.Storage.LiveTests/StorageCommandTests.cs @@ -10,7 +10,8 @@ namespace Azure.Mcp.Tools.Storage.LiveTests { - public class StorageCommandTests(ITestOutputHelper output, TestProxyFixture fixture) : RecordedCommandTestsBase(output, fixture) + [Collection("LiveServer")] + public class StorageCommandTests(ITestOutputHelper output, TestProxyFixture fixture, LiveServerFixture liveServerFixture) : RecordedCommandTestsBase(output, fixture, liveServerFixture) { public override List BodyKeySanitizers => [ diff --git a/tools/Azure.Mcp.Tools.StorageSync/tests/Azure.Mcp.Tools.StorageSync.LiveTests/StorageSyncCommandTests.cs b/tools/Azure.Mcp.Tools.StorageSync/tests/Azure.Mcp.Tools.StorageSync.LiveTests/StorageSyncCommandTests.cs index f6f5d1201e..e7af6d73bf 100644 --- a/tools/Azure.Mcp.Tools.StorageSync/tests/Azure.Mcp.Tools.StorageSync.LiveTests/StorageSyncCommandTests.cs +++ b/tools/Azure.Mcp.Tools.StorageSync/tests/Azure.Mcp.Tools.StorageSync.LiveTests/StorageSyncCommandTests.cs @@ -11,7 +11,8 @@ namespace Azure.Mcp.Tools.StorageSync.LiveTests; -public class StorageSyncCommandTests(ITestOutputHelper output, TestProxyFixture fixture) : RecordedCommandTestsBase(output, fixture) +[Collection("LiveServer")] +public class StorageSyncCommandTests(ITestOutputHelper output, TestProxyFixture fixture, LiveServerFixture liveServerFixture) : RecordedCommandTestsBase(output, fixture, liveServerFixture) { public override List UriRegexSanitizers => new[] { diff --git a/tools/Azure.Mcp.Tools.VirtualDesktop/tests/Azure.Mcp.Tools.VirtualDesktop.LiveTests/VirtualDesktopCommandTests.cs b/tools/Azure.Mcp.Tools.VirtualDesktop/tests/Azure.Mcp.Tools.VirtualDesktop.LiveTests/VirtualDesktopCommandTests.cs index 76996437fe..f046513925 100644 --- a/tools/Azure.Mcp.Tools.VirtualDesktop/tests/Azure.Mcp.Tools.VirtualDesktop.LiveTests/VirtualDesktopCommandTests.cs +++ b/tools/Azure.Mcp.Tools.VirtualDesktop/tests/Azure.Mcp.Tools.VirtualDesktop.LiveTests/VirtualDesktopCommandTests.cs @@ -10,7 +10,8 @@ namespace Azure.Mcp.Tools.VirtualDesktop.LiveTests; -public class VirtualDesktopCommandTests(ITestOutputHelper output, TestProxyFixture fixture) : RecordedCommandTestsBase(output, fixture) +[Collection("LiveServer")] +public class VirtualDesktopCommandTests(ITestOutputHelper output, TestProxyFixture fixture, LiveServerFixture liveServerFixture) : RecordedCommandTestsBase(output, fixture, liveServerFixture) { public override List BodyRegexSanitizers => new() { diff --git a/tools/Azure.Mcp.Tools.Workbooks/tests/Azure.Mcp.Tools.Workbooks.LiveTests/WorkbooksCommandTests.cs b/tools/Azure.Mcp.Tools.Workbooks/tests/Azure.Mcp.Tools.Workbooks.LiveTests/WorkbooksCommandTests.cs index f698b900d3..c24cc1dc3f 100644 --- a/tools/Azure.Mcp.Tools.Workbooks/tests/Azure.Mcp.Tools.Workbooks.LiveTests/WorkbooksCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Workbooks/tests/Azure.Mcp.Tools.Workbooks.LiveTests/WorkbooksCommandTests.cs @@ -11,7 +11,8 @@ namespace Azure.Mcp.Tools.Workbooks.LiveTests; -public class WorkbooksCommandTests(ITestOutputHelper output, TestProxyFixture fixture) : RecordedCommandTestsBase(output, fixture) +[Collection("LiveServer")] +public class WorkbooksCommandTests(ITestOutputHelper output, TestProxyFixture fixture, LiveServerFixture liveServerFixture) : RecordedCommandTestsBase(output, fixture, liveServerFixture) { private const string EmptyGuid = "00000000-0000-0000-0000-000000000000"; public override List UriRegexSanitizers => new List