Clean up a few test designs to reduce testing times - #3219
Open
Alan Zimmer (alzimmermsft) wants to merge 5 commits into
Open
Clean up a few test designs to reduce testing times#3219Alan Zimmer (alzimmermsft) wants to merge 5 commits into
Alan Zimmer (alzimmermsft) wants to merge 5 commits into
Conversation
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
Alan Zimmer (alzimmermsft)
marked this pull request as ready for review
August 5, 2026 17:52
Alan Zimmer (alzimmermsft)
requested review from
Connie Yau (conniey),
Vinay Gera (g2vinay),
Jair Myree (jairmyree),
msalaman,
Sandeep Sen (sandeep-sen),
Tom Meschter (tmeschter) and
Jeff Fisher (xirzec)
and
a lite review from Copilot
and removed request for
Copilot
August 5, 2026 17:52
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR reduces overall test runtime by consolidating MCP server-starting live tests (so they can share a single server instance when startup logic is identical) and by tightening authentication behavior in a concurrency-focused credential test.
Changes:
- Enabled xUnit parallel execution settings for
Microsoft.Mcp.Testsvia runner config updates. - Refactored
CustomChainedCredentialto expose its lazy-initialized inner credential for test validation and performed small cleanup/refactors. - Merged/adjusted Azure MCP server start live tests and added additional assertions (e.g., uniqueness checks in all-mode).
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| core/Microsoft.Mcp.Core/tests/Microsoft.Mcp.Tests/xunit.runner.json | Updates local xUnit runner settings to enable parallelization. |
| core/Microsoft.Mcp.Core/tests/Microsoft.Mcp.Tests/xunit.runner.ci.json | Updates CI xUnit runner settings to enable parallelization. |
| core/Microsoft.Mcp.Core/src/Services/Azure/Authentication/CustomChainedCredential.cs | Exposes the lazy credential for tests and renames token cache field; minor refactors. |
| core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Services/Azure/Authentication/CustomChainedCredentialTests.cs | Simplifies tests by removing reflection and forcing playback mode for the concurrency test. |
| core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/ServerStartCommandTests.cs | Merges server-starting live tests and adds stronger assertions (including uniqueness checks in all-mode). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Merges together tests starting an MCP server instance to share that instance when start logic is the same by adding additional assertions into the shared test.
Force usage of
PlaybackCredentialin test that doesn't care if real authentication is called.Improves CI times by a few minutes per job when running all tests (modifications to shared code / infrastructure, which is quite common).
GitHub issue number?
[Link to the GitHub issue this PR addresses]Pre-merge Checklist
servers/Azure.Mcp.Server/README.mdand/orservers/Fabric.Mcp.Server/README.mddocumentationREADME.mdchanges running the script./eng/scripts/Process-PackageReadMe.ps1. See Package READMEToolDescriptionEvaluatorand obtained a score of0.4or more and a top 3 ranking for all related test promptsconsolidated-tools.jsonbreaking-changelabelservers/Azure.Mcp.Server/docs/azmcp-commands.md./eng/scripts/Update-AzCommandsMetadata.ps1to update tool metadata inazmcp-commands.md(required for CI)servers/Azure.Mcp.Server/docs/e2eTestPrompts.mdcrypto mining, spam, data exfiltration, etc.)/azp run mcp - pullrequest - liveto run Live Test Pipeline