Skip to content

Merge together testing phases#2855

Open
alzimmermsft wants to merge 9 commits into
microsoft:mainfrom
alzimmermsft:MergeTogetherTestingPhases
Open

Merge together testing phases#2855
alzimmermsft wants to merge 9 commits into
microsoft:mainfrom
alzimmermsft:MergeTogetherTestingPhases

Conversation

@alzimmermsft

Copy link
Copy Markdown
Contributor

What does this PR do?

Merge together Run unit tests and Run recorded tests phases together as they're now a single project and should be ran together during CI. Additionally, updates New-BuildInfo.ps1 to run all unit and recorded tests when Core libraries, engineering setup, or shared build properties are modified.

Fixes an issue where Run unit tests were always running all unit tests in the repository. They are now scoped to build_info.json, meaning fewer unit tests should run when fewer libraries are modified.

GitHub issue number?

Fixes #1887
Fixes #2718

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 marked this pull request as ready for review June 11, 2026 14:42
@alzimmermsft alzimmermsft requested review from a team as code owners June 11, 2026 14:42
Copilot AI review requested due to automatic review settings June 11, 2026 14:42
@alzimmermsft alzimmermsft requested a review from a team as a code owner June 11, 2026 14:42

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

Note

Copilot was unable to run its full agentic suite in this review.

Updates CI/test scoping so a single “Run tests” pipeline step can execute both unit + recorded tests while narrowing execution to only impacted paths, and refactors live-only test gating into a shared base.

Changes:

  • Scope test project selection by build_info.json for all test types (not just recorded tests).
  • Update build-info path selection logic and simplify pipeline to one test task (-TestType 'All').
  • Centralize [LiveTestOnly] gating into CommandTestsBase and adjust recorded test initialization accordingly.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
eng/scripts/Test-Code.ps1 Applies BuildInfo-based path scoping earlier so it affects all test types.
eng/scripts/New-BuildInfo.ps1 Revises “paths to test” detection and simplifies matrix flags to a single test-run switch.
eng/pipelines/templates/jobs/build.yml Collapses unit + recorded test steps into one “Run tests” invocation.
core/Microsoft.Mcp.Core/tests/Microsoft.Mcp.Tests/Client/RecordedCommandTestsBase.cs Uses shared live-only gating and adjusts matcher application.
core/Microsoft.Mcp.Core/tests/Microsoft.Mcp.Tests/Client/CommandTestsBase.cs Introduces CheckLiveOnly() in the common base for [LiveTestOnly] behavior.
core/Azure.Mcp.Core/src/Services/Azure/BaseAzureService.cs Replaces SDK LRO wait call with a custom polling loop when a default poll interval is set.

Comment thread eng/scripts/Test-Code.ps1
Comment on lines +262 to +265
$coreChanged = ($changedFiles | Where-Object { $_ -match '^core/(Azure|Fabric|Microsoft).Mcp.Core/src/' }).Count -gt 0
$engChanged = ($changedFiles | Where-Object { $_ -match '^eng/' }).Count -gt 0
$sharedBuildChanged = ($changedFiles | Where-Object { $_ -match '^Directory.(Build|Packages).props' }).Count -gt 0
if ($coreChanged -or $engChanged -or $sharedBuildChanged) {
$engChanged = ($changedFiles | Where-Object { $_ -match '^eng/' }).Count -gt 0
$sharedBuildChanged = ($changedFiles | Where-Object { $_ -match '^Directory.(Build|Packages).props' }).Count -gt 0
if ($coreChanged -or $engChanged -or $sharedBuildChanged) {
Write-Host "Core, engineering, or shared build changes detected. Building everything." -ForegroundColor Yellow
Comment thread eng/scripts/New-BuildInfo.ps1
Comment thread core/Azure.Mcp.Core/src/Services/Azure/BaseAzureService.cs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Untriaged

2 participants