Skip to content

[DO NOT MERGE] Test live tests 2#1931

Draft
g2vinay wants to merge 27 commits intomicrosoft:mainfrom
g2vinay:test-live-tests-2
Draft

[DO NOT MERGE] Test live tests 2#1931
g2vinay wants to merge 27 commits intomicrosoft:mainfrom
g2vinay:test-live-tests-2

Conversation

@g2vinay
Copy link
Contributor

@g2vinay g2vinay commented Mar 4, 2026

No description provided.

- CustomChainedCredential: add forceBrowserFallback param, suppressed when
  AZURE_TOKEN_CREDENTIALS=prod; enables InteractiveBrowserCredential fallback
  only in user-identity modes (SingleIdentityTokenCredentialProvider)
- SafeTokenCredential: add normalizeScopes=true for all 8 non-MSAL credentials
  (EnvironmentCredential, WorkloadIdentity, ManagedIdentity, VisualStudio,
  VisualStudioCode, AzureCli, AzurePowerShell, AzureDeveloperCli)
  Converts https://mcp.ai.azure.com/Foundry.Mcp.Tools to
  https://mcp.ai.azure.com/.default so resource-based credential types
  receive the correct scope format; InteractiveBrowserCredential is unwrapped
  and receives the verbatim MSAL permission scope
- Microsoft.Mcp.slnx and Azure.Mcp.Server.slnx: remove deleted
  Azure.Mcp.Tools.Foundry project references
…changes

- CustomChainedCredentialTests: update reflection-based constructor lookup
  from 2-param to 3-param to match new forceBrowserFallback parameter
  added in commit 9b7c48b

- VisualStudioToolNameTests: remove outer TestContext.Current.CancellationToken
  from the linked CTS for I/O operations; add independent 2-minute timeout
  and Fact(Timeout=180000). In --mode all the server eagerly connects to all
  external MCP registry servers (incl. mcp.ai.azure.com) before responding
  to initialize, which can take 15-60+ seconds.
…tness

- RegistryDiscoveryStrategyTests.cs: remove trailing whitespace on blank lines
  (WHITESPACE errors at lines 474/475 and 496/497 in CI)

- VisualStudioToolNameTests.cs: add ReadJsonLineAsync helper to skip non-JSON
  lines in stdout (e.g. azd subprocess diagnostics) before deserializing
  JSON-RPC responses, fixing JsonException when a non-JSON line appears first
…s to prevent registry pollution in playback recordings
… (recorded/playback tests)

RecordingRedirectHandler redirects all outgoing HTTP from the server subprocess
through the test proxy. When --mode all is used, RegistryToolLoader tries to
connect to external registry servers (e.g. mcp.ai.azure.com from registry.json).
Those connection attempts hit the test proxy during an active recording/playback
session, producing unrecorded traffic in playback mode or polluting the recording
sequence in record mode.

Guard in RegistryToolLoader.InitializeAsync: if TEST_PROXY_URL is set (injected
by CommandTestsBase.GetEnvironmentVariables only when a TestProxyFixture is
present), skip discovery and mark as initialized with no clients. This fixes
ALL recorded test classes automatically without per-class overrides.

Also removes the redundant InitializeAsync override from FoundryExtensionsCommandTests
that was added as a per-class workaround for the same root cause.
- Add FoundryExtensionsSetup to Program.cs RegisterAreas()
- Add FoundryExtensions projects to Microsoft.Mcp.slnx
- Exclude temp_test folder from Azure.Mcp.Core.UnitTests build
The foundry_agents_create tool no longer exists after the foundry ->
foundryextensions namespace migration. Having it in the mappedToolList
for create_foundry_agent_resources caused the server to crash when
starting in consolidated mode (--mode consolidated) because:

1. foundryextensions_threads_create is now registered (via FoundryExtensionsSetup in Program.cs)
2. This made matchingCommands non-empty for create_foundry_agent_resources
3. The DEBUG validation check then threw InvalidOperationException when
   foundry_agents_create was not found in filteredCommands

Fix: Remove foundry_agents_create from the mappedToolList, leaving only
foundryextensions_threads_create which is the current replacement.

Fixes ConsolidatedMode_Should_List_Tools_Successfully test failure.
…ions tests individually to fix playback failures
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tools-Foundry Azure AI Foundry

Projects

Status: Untriaged

Development

Successfully merging this pull request may close these issues.

1 participant