Skip to content

Restore green MCP SDK 2.x test suite - #532

Merged
jongalloway merged 2 commits into
mainfrom
jongalloway-fix-tests-for-sdk-2-0
Nov 1, 2026
Merged

jongalloway merged 2 commits into
mainfrom
jongalloway-fix-tests-for-sdk-2-0

Conversation

@jongalloway

Copy link
Copy Markdown
Owner

Why

The MCP 2.x migration is already present, but the full suite still had 35 failures and tool command tests could modify the checked-in tool manifest or the user's global installations. This restores a green suite while retaining the existing MCP SDK 2.3.0 packages and native/legacy protocol contracts.

Approach

  • Align Microsoft.Build.Utilities.Core with Microsoft.Build 18.9.6 so .NET 10 runtime assemblies are available, and explicitly supply the NuGet.Frameworks version required by MSBuild property functions.
  • Correct fixtures that assumed SDK-defaulted properties were unset. Separately cover missing-framework validation for non-SDK projects and evaluation errors for SDK projects.
  • Serialize workspace snapshot tests through the existing process-wide-state collection.
  • Add an internal, per-instance executor override so tool command tests record commands instead of changing real installations. Strengthen install/update/uninstall argument assertions and cover interception for both local and global operations. Other commands and production execution remain unchanged.
  • Document test isolation and runtime dependency requirements. The source-controlled tool manifest has no diff.

Verification

  • Release server build: passed with zero warnings or errors.
  • Full Release suite: 1,615 passed, 46 expected skips, zero failures (baseline: 1,573 passed, 35 failed, 46 skipped).
  • Focused repaired tests and SDK compatibility matrix: 607 passed, two interactive skips.
  • Real-stdio scenario suite: all 14 passed.
  • Isolated local-tool manifest/install/restore/list release scenario: passed.

Fixes: #488

jongalloway and others added 2 commits October 31, 2026 17:46
Align MSBuild runtime dependencies, correct SDK-sensitive fixtures, and isolate tool command tests from real installations.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 1, 2026 00:46

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.

🟢 Approval recommended

No active review issues are identified for the fixture repairs and tool-command test isolation changes.

No open issues 🎉

What changed in this PR

This PR addresses #488 by repairing test fixtures and isolating tool-command tests while retaining MCP SDK 2.3.0 and the existing native and legacy protocol contracts.

Changes:

  • Align MSBuild runtime dependencies and correct project-analysis fixtures for SDK-evaluated properties.
  • Record tool commands through a per-instance executor override, with stronger argument assertions and local/global interception coverage.
  • Serialize workspace snapshot tests and document test isolation and runtime requirements.
File Description
DotNetMcp/​Tools/​Cli/​DotNetCliTools.Core.cs Adds an internal executor override shared by normal and concurrency-controlled execution.
DotNetMcp/​DotNetMcp.csproj Aligns MSBuild packages and explicitly references NuGet.Frameworks.
DotNetMcp.Tests/​Tools/​EdgeCaseAndIntegrationTests.cs Enables tool-command recording to avoid real tool changes.
DotNetMcp.Tests/​Tools/​DotNetCliToolsTests.cs Records tool commands and strengthens argument assertions.
DotNetMcp.Tests/​Tools/​DotNetCliToolsConsolidatedToolTests.cs Adds local/global interception coverage and command assertions.
DotNetMcp.Tests/​SdkIntegration/​ProjectAnalysisHelperTests.cs Corrects unset-property fixtures and separates evaluation-error coverage from validation.
DotNetMcp.Tests/​Resources/​WorkspaceSnapshotResourceTests.cs Uses the nonparallel process-wide-state collection.
DotNetMcp.Tests/​Infrastructure/​MachineReadableCommandAssertions.cs Adds a recorder for tool commands while preserving execution of other commands.
doc/​testing.md Documents compatibility, isolation, and runtime dependency requirements.

Review effort: Balanced

@jongalloway
jongalloway merged commit 68f3e0e into main Nov 1, 2026
9 checks passed
@jongalloway
jongalloway deleted the jongalloway-fix-tests-for-sdk-2-0 branch November 1, 2026 00:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix tests for SDK 2.0

2 participants