Skip to content

Restrict MCP template tests to the current RID - #69906

Merged
wtgodbe merged 1 commit into
dotnet:mainfrom
wtgodbe:wtgodbe/restrict-mcp-template-test-rids
Oct 16, 2026
Merged

wtgodbe merged 1 commit into
dotnet:mainfrom
wtgodbe:wtgodbe/restrict-mcp-template-test-rids

Conversation

@wtgodbe

@wtgodbe wtgodbe commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Restrict MCP template tests to the current RID

Restore MCP template tests for only the host RID

Description

Adds an optional restore argument to the shared template-test helper and uses it for self-contained MCP scenarios. Restore, publish, and build now receive both the current RuntimeIdentifier and a single-value RuntimeIdentifiers, matching the existing Run-McpServer-Locally.ps1 behavior.

Framework-dependent MCP scenarios remain unchanged.

Validation:

  • source activate.sh && dotnet build src/ProjectTemplates/test/Templates.Tests/Templates.Tests.csproj -v:minimal — passed after preparing the documented template-test prerequisites.
  • Restoring a generated MCP project without the new arguments requested six ASP.NET Core runtime packs: linux-arm64, linux-musl-x64, linux-x64, osx-arm64, win-arm64, and win-x64.
  • Restoring the same project with the new arguments requested only the current osx-arm64 runtime pack.
  • source activate.sh && dotnet test src/ProjectTemplates/test/Templates.Tests/Templates.Tests.csproj --no-build --no-restore --filter "FullyQualifiedName~McpServerTemplateTest" — reached the generated-project restores, then was blocked by the incomplete local package graph (NU1102/NU1603). The restore output confirmed that each self-contained scenario was restricted to one RID.

Related to internal CI build 3107295; no public issue.

Copilot AI balanced review requested due to automatic review settings October 16, 2026 21:57
@github-actions github-actions Bot added the area-commandlinetools Includes: Command line tools, dotnet-dev-certs, dotnet-user-jwts, and OpenAPI label Oct 16, 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.

🔵 Needs a closer look

Review evidence is incomplete, and generated-project publish, build, and execution remain unverified.

No open issues 🎉

What changed in this PR

Restricts self-contained MCP template tests to the host runtime identifier (RID), avoiding unnecessary runtime-pack restores.

Changes:

  • Adds optional restore arguments to the shared template helper.
  • Applies host-RID arguments to self-contained restore, publish, and build operations.
  • Leaves framework-dependent scenarios unchanged.
File Description
src/​ProjectTemplates/​test/​Templates.Tests/​McpServerTemplateTest.cs Restricts self-contained scenarios to the current RID.
src/​ProjectTemplates/​Shared/​Project.cs Accepts optional arguments for template-project restore.

Review effort: Balanced

@wtgodbe
wtgodbe merged commit 030e846 into dotnet:main Oct 16, 2026
30 checks passed
@wtgodbe
wtgodbe temporarily deployed to copilot-pat-pool October 16, 2026 23:33 — with GitHub Actions Inactive
@wtgodbe
wtgodbe temporarily deployed to copilot-pat-pool October 16, 2026 23:33 — with GitHub Actions Inactive
@wtgodbe
wtgodbe temporarily deployed to copilot-pat-pool October 16, 2026 23:34 — with GitHub Actions Inactive
@wtgodbe
wtgodbe temporarily deployed to copilot-pat-pool October 16, 2026 23:36 — with GitHub Actions Inactive
@wtgodbe
wtgodbe temporarily deployed to copilot-pat-pool October 16, 2026 23:37 — with GitHub Actions Inactive
@wtgodbe
wtgodbe temporarily deployed to copilot-pat-pool October 16, 2026 23:37 — with GitHub Actions Inactive
@github-actions

Copy link
Copy Markdown
Contributor

✅ No documentation PR was created.

Confidence that documentation is needed: 3%

No docs needed: the PR is test infrastructure only (restricting MCP template tests to the host RID).

Documentation surfaces considered

  • Conceptual article: Not required — Only template test helper and MCP template tests changed; no user-visible behavior.
  • Migration guidance: Not required — No upgrade action for users.
  • Breaking change: Not required — No API or behavior change; test-only.

This branch was previously deployed

1 inactive deployment
copilot-pat-pool — 33c97537 Deployed Oct 16, 2026 by wtgodbe via conclusion #64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-commandlinetools Includes: Command line tools, dotnet-dev-certs, dotnet-user-jwts, and OpenAPI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants