Skip to content

Use shared Test Proxy instance in CI#2795

Draft
alzimmermsft wants to merge 6 commits into
microsoft:mainfrom
alzimmermsft:UseSharedTestProxyInstance
Draft

Use shared Test Proxy instance in CI#2795
alzimmermsft wants to merge 6 commits into
microsoft:mainfrom
alzimmermsft:UseSharedTestProxyInstance

Conversation

@alzimmermsft

Copy link
Copy Markdown
Contributor

What does this PR do?

Migrates CI testing to use a shared Test Proxy instance instead of each RecordedCommandTestBase instance starting its own Test Proxy instance. Test Proxy scales well and is capable of handling many incoming requests at one time, removing the number of Test Proxy instances should significantly speed up CI testing times.

GitHub issue number?

[Link to the GitHub issue this PR addresses]

Pre-merge Checklist

  • Required for All PRs
    • Read contribution guidelines
    • PR title clearly describes the change
    • Commit history is clean with descriptive messages (cleanup guide)
    • Added comprehensive tests for new/modified functionality
    • Created a changelog entry if the change falls among the following: new feature, bug fix, UI/UX update, breaking change, or updated dependencies. Follow the changelog entry guide
  • For MCP tool changes:
    • One tool per PR: This PR adds or modifies only one MCP tool for faster review cycles
    • Updated servers/Azure.Mcp.Server/README.md and/or servers/Fabric.Mcp.Server/README.md documentation
    • Validate README.md changes running the script ./eng/scripts/Process-PackageReadMe.ps1. See Package README
    • For new or modified tool descriptions, ran ToolDescriptionEvaluator and obtained a score of 0.4 or more and a top 3 ranking for all related test prompts
    • For tools with new names, including new tools or renamed tools, update consolidated-tools.json
    • For renamed tools, follow the Tool Rename Checklist and tag the PR with the breaking-change label
    • For new tools associated with Azure services or publicly available tools/APIs/products, add URL to documentation in the PR description
  • Extra steps for Azure MCP Server tool changes:
    • Updated command list in servers/Azure.Mcp.Server/docs/azmcp-commands.md
    • Ran ./eng/scripts/Update-AzCommandsMetadata.ps1 to update tool metadata in azmcp-commands.md (required for CI)
    • Updated test prompts in servers/Azure.Mcp.Server/docs/e2eTestPrompts.md
    • 👉 For Community (non-Microsoft team member) PRs:
      • Security review: Reviewed code for security vulnerabilities, malicious code, or suspicious activities before running tests (crypto mining, spam, data exfiltration, etc.)
      • Manual tests run: added comment /azp run mcp - pullrequest - live to run Live Test Pipeline

@alzimmermsft alzimmermsft self-assigned this Jun 2, 2026
Copilot AI review requested due to automatic review settings June 2, 2026 14:48
@alzimmermsft alzimmermsft requested review from a team as code owners June 2, 2026 14:48
@alzimmermsft alzimmermsft added the Engineering Excellence Items required to be resolved before onboarding the "third wave" of azure RPs label Jun 2, 2026
@github-project-automation github-project-automation Bot moved this to Untriaged in Azure MCP Server Jun 2, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the CI recorded-test infrastructure to use a single shared Azure SDK Test Proxy instance per build job (instead of each RecordedCommandTestsBase/fixture starting its own proxy), aiming to reduce startup overhead and improve test throughput.

Changes:

  • Start a shared Test Proxy instance in the build job and add steps to shut it down and dump its logs.
  • Update the TestProxy test helper to skip starting a local proxy in CI and to assume the shared proxy is available on port 5000.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
eng/pipelines/templates/jobs/build.yml Starts a shared test-proxy for the job, then shuts it down and publishes proxy logs for diagnostics.
core/Microsoft.Mcp.Core/tests/Microsoft.Mcp.Tests/Client/TestProxy.cs Refactors proxy management to use a shared CI proxy (port 5000) and tightens internal state/output handling.

Comment thread eng/pipelines/templates/jobs/build.yml
Comment thread eng/pipelines/templates/jobs/build.yml
@alzimmermsft alzimmermsft marked this pull request as draft June 2, 2026 16:32
@alzimmermsft

Copy link
Copy Markdown
Contributor Author

This work will be put on to the backlog as there are larger changes needed to get this to work as the HTTP client that is redirected to Test Proxy lives within the MCP executable that is started on a per test class basis. Using a shared Test Proxy instance requires x-recording-id to be used on a per test basis, which would need to either be passed when starting the executable (doesn't work as that is too costly to start on a per test basis to make this work, unless startup time improvement are made) or a way to funnel the value through in the MCP tool call (such as through _meta, but that requires updates to get that information deeper into every MCP tool API).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Engineering Excellence Items required to be resolved before onboarding the "third wave" of azure RPs

Projects

Status: Untriaged

Development

Successfully merging this pull request may close these issues.

2 participants