Skip to content

Shard MVC template tests on Helix - #69898

Merged
wtgodbe merged 2 commits into
dotnet:mainfrom
wtgodbe:wtgodbe/shard-mvc-template-tests
Oct 16, 2026
Merged

wtgodbe merged 2 commits into
dotnet:mainfrom
wtgodbe:wtgodbe/shard-mvc-template-tests

Conversation

@wtgodbe

@wtgodbe wtgodbe commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Shard MVC template tests on Helix

Important

Estimated critical-path reduction: about 23 minutes per run. A recent 51.7-minute Windows MVC work item is expected to fall to roughly 29 minutes, saving approximately 25–28% of the template pipeline's typical 82–92 minute wall time, before queueing variance.

  • You've read the Contributor Guide and Code of Conduct.
  • You've included unit or integration tests for your change, where applicable.
  • You've included inline docs for your change, where applicable.
  • There's an open issue for the PR that you are making. If you'd like to propose a new feature or change, please open an issue to discuss the change or find an existing issue.

Shard MVC template tests on Helix

Description

Adds opt-in per-project Helix test filters and uses them to split Templates.Mvc.Tests into two work items on every existing queue:

  • Blazor + Web API: 79 tests and 23.0 test minutes in a recent Windows run.
  • MVC + Razor Pages: 65 tests and 23.9 test minutes.

Filtered work items are not batched with other assemblies. The shard filter is applied during discovery and execution, and execution combines the quarantine predicate with the union of the shard and the guaranteed AlwaysTestTests.SuccessfulTests class. Non-quarantined filtered runs also inspect the xUnit results and fail unless at least one non-guaranteed shard test ran, preventing stale selectors from silently dropping coverage. Projects without HelixTestShard items retain their existing single-work-item behavior.

The estimate assumes the slower 23.9-minute shard carries approximately the same fixed overhead as the existing 51.7-minute work item. Because the shards run in parallel, this reduces the dominant Windows work item to roughly 29 minutes; actual pipeline savings will vary with Helix queueing and other work items.

Validation:

  • HelixTestRunner and RepoTasks built successfully with zero warnings.
  • A focused MSBuild harness produced the unchanged default work item and two correctly named, filtered, non-batched shard work items.
  • Historical Windows test results assigned all 144 tests to exactly one shard.
  • A focused test assembly reproduced the prior successful zero-test quarantine run and fallback-only stale selector; the fixed filters ran the guaranteed quarantined test, while result validation distinguished a stale selector from a valid selector that ran six shard tests.
  • Windows command arguments are captured before enabling delayed expansion so exclusion filters retain !.
  • XML validation, shell syntax validation, YAML parsing, and git diff --check passed.

Copilot AI balanced review requested due to automatic review settings October 16, 2026 20:16
@wtgodbe
wtgodbe requested a review from a team as a code owner October 16, 2026 20:16
@github-actions github-actions Bot added area-commandlinetools Includes: Command line tools, dotnet-dev-certs, dotnet-user-jwts, and OpenAPI area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework labels Oct 16, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Hey @dotnet/aspnet-build, looks like this PR is something you want to take a look at.

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.

🟡 Changes recommended

Filter handling can select incorrect tests, exclude guaranteed quarantine tests, and silently accept empty shards.

3 open findings
What changed in this PR

Adds opt-in Helix sharding to split MVC template tests across two work items per existing queue.

Changes:

  • Defines Blazor/Web API and MVC/Razor Pages shards.
  • Propagates filters through work-item generation and platform runners.
  • Adds discovery checks and combines execution filters with quarantine filtering.
File Description
src/​ProjectTemplates/​test/​Templates.Mvc.Tests/​Templates.Mvc.Tests.csproj Defines two template-test shards.
eng/​tools/​RepoTasks/​BatchHelixWorkItems.cs Preserves filter metadata in batch commands.
eng/​tools/​HelixTestRunner/​TestRunner.cs Applies filters and expands discovery checks.
eng/​tools/​HelixTestRunner/​HelixTestRunnerOptions.cs Adds the filter option.
eng/​targets/​Helix.targets Creates separate, non-batched filtered work items.
eng/​helix/​content/​runtests.sh Forwards filters on Unix.
eng/​helix/​content/​runtests.cmd Forwards filters on Windows.

🧠 Review effort: Balanced


💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread eng/tools/HelixTestRunner/TestRunner.cs Resolved
Comment thread eng/tools/HelixTestRunner/TestRunner.cs Resolved
Comment thread eng/helix/content/runtests.cmd Resolved
@wtgodbe
wtgodbe merged commit 74c0be6 into dotnet:main Oct 16, 2026
29 of 31 checks passed
@wtgodbe
wtgodbe temporarily deployed to copilot-pat-pool October 16, 2026 22:24 — with GitHub Actions Inactive
@wtgodbe
wtgodbe temporarily deployed to copilot-pat-pool October 16, 2026 22:25 — with GitHub Actions Inactive
@wtgodbe
wtgodbe temporarily deployed to copilot-pat-pool October 16, 2026 22:25 — with GitHub Actions Inactive
@wtgodbe
wtgodbe temporarily deployed to copilot-pat-pool October 16, 2026 22:27 — with GitHub Actions Inactive
@wtgodbe
wtgodbe temporarily deployed to copilot-pat-pool October 16, 2026 22:28 — with GitHub Actions Inactive
@wtgodbe
wtgodbe temporarily deployed to copilot-pat-pool October 16, 2026 22:28 — with GitHub Actions Inactive
@github-actions

Copy link
Copy Markdown
Contributor

✅ No documentation PR was created.

Confidence that documentation is needed: 2%

No docs needed: CI/test infrastructure change (Helix test sharding). Signals showed no_signal and the file list is complete.

Documentation surfaces considered

  • Conceptual article: Not required — Only eng/ Helix CI scripts and a test project changed; no user-facing behavior.
  • Migration guidance: Not required — No upgrade impact for app developers.
  • Breaking change: Not required — No public API, default, or behavior change.

@wtgodbe
wtgodbe temporarily deployed to copilot-pat-pool October 16, 2026 22:29 — with GitHub Actions Inactive
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Oct 30, 2026
wtgodbe added a commit that referenced this pull request Nov 4, 2026
Backport to release/11.0, retaining existing project references.

(cherry picked from commit 74c0be6)

Co-authored-by: Copilot <[email protected]>

This branch was previously deployed

1 inactive deployment
copilot-pat-pool — fb48d20f Deployed Oct 16, 2026 by wtgodbe via conclusion #60
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 area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants