Skip to content

Update Library.Template and enable xUnit NativeAOT tests - #1710

Merged
Andrew Arnott (AArnott) merged 75 commits into
mainfrom
dev/andarno/libtemplateUpdate
Oct 15, 2026
Merged

Andrew Arnott (AArnott) merged 75 commits into
mainfrom
dev/andarno/libtemplateUpdate

Conversation

@AArnott

Copy link
Copy Markdown
Member

Why

Bring in the latest Library.Template microbuild updates and NativeAOT coverage without replacing this repository's xUnit test framework or dropping its older managed test targets.

Approach

  • Merge Library.Template microbuild commit b050e25685b1d3a0fb997e6037f68f7bd37b97ff, including build, CI, tooling, documentation authentication, and testing guidance updates while preserving repository-specific configuration.
  • Add .NET 10 to the threading tests and conditionally select xunit.v3.aot.mtp-v2 for that target. Older targets retain the reflection-based runner; analyzer tests remain managed-only.
  • Replace reflection-only combinatorial data with explicit InlineData, and shared STA/UI discoverers with thread helpers that preserve apartment state, synchronization context, and thread affinity. Keep framework-only STA tests on their existing extension.
  • Wire native test discovery, publishing, and execution into traversal builds and CI. Preserve both .NET 10 compatibility probes and static-graph restore.

Validation

Validated on Windows x64:

  • Managed cloud run: 6,303 passed, 63 existing skips, no failures.
  • Published NativeAOT run: 1,087 passed, nine existing skips, no failures.
  • Final traversal restore and publish with warnings treated as errors succeeded; native discovery selects exactly one unit-test variant, net10.0.
  • Follow-up STA/helper checks passed on all four managed targets and the native executable. Attribute formatting preserves every theory data case.

Cross-platform runtime execution has not been validated locally.

renovate Bot and others added 30 commits September 10, 2026 20:27
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…2 (567)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
… (568)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This is so that if xunit.v3.mtp-v2 wants an older version of it, we use the later version that's consistent with the MTP extension packages
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This is so that if xunit.v3.mtp-v2 wants an older version of it, we use the later version that's consistent with the MTP extension packages
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
… (575)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Avoid re-installing .NET SDK or runtimes
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Re-running a failed docs deployment failed because the prior attempt's
github-pages artifact remained, making deploy-pages find two artifacts.
Use a per-attempt artifact name, and allow workflow_dispatch.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Andrew Arnott (AArnott) and others added 16 commits October 7, 2026 07:17
…lls (593)

Machine-wide installs checked for already-installed SDKs and runtimes under the
native Program Files dotnet directory regardless of the process architecture.
In x86 PowerShell on x64 Windows, or x64 PowerShell on ARM64 Windows, that is
the wrong root, so missing components could be skipped. Select the root where
each architecture's installer actually puts them.
CFSClean2 is included by default (at least for some pipelines) but CFSClean is *not* and we're getting compliance issues filed because nuget.org is reached.
Adding CFSClean explicitly solves it.
Pass the tree-node filter as a single option argument for managed and NativeAOT test runs to avoid platform-specific argument parsing failures.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Pass the tree-node filter as a single option argument for managed and NativeAOT test runs to avoid platform-specific argument parsing failures.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Resolve conflicts by keeping README and repository-specific project/test conventions, applying xUnit-compatible test filtering, and removing template-only files.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Select AOT and reflection runners per target framework while preserving older managed targets. Replace reflection-only theory data and shared STA/UI discoverers with explicit data and thread helpers, retaining framework-only STA tests.

Wire native test discovery and publishing into traversal builds, preserve compatibility probes on both .NET 10 targets, and fix static-graph restore and native output path handling. Document the retained xUnit workflow.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI commented Oct 14, 2026

Copy link
Copy Markdown

One or more custom setup steps configured for this repository failed during this Copilot code review run:

⚙ Install prerequisites

Setup steps run before each review. If the review above is missing context, or no review was posted at all, the failing step above may be the cause. See the workflow run for failure details, fix your setup steps configuration, and re-request a review.

Note

You can configure setup steps for Copilot code review separately from Copilot cloud agent with a copilot-code-review.yml file. Read the docs for details.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Build-graph and repository-wide OIDC changes warrant human review, with cross-platform validation incomplete and tooling regressions unresolved.

2 open findings
What changed in this PR

Updates Library.Template infrastructure and adds .NET 10 NativeAOT coverage while preserving xUnit, older managed targets, and managed-only analyzer tests.

Changes:

  • Adds native test discovery, publishing, and CI execution.
  • Replaces reflection-dependent test data and STA/UI discoverers.
  • Refreshes tooling, documentation authentication, and contributor guidance.
File Description
tools/​tests/​DocsFeedCredentials.Tests.ps1 Tests feed credential configuration.
tools/​tests/​Configure-GitHubOidc.Tests.ps1 Tests OIDC setup and failure handling.
tools/​Install-DotNetSdk.ps1 Adds installed-component detection.
tools/​Get-NativeAOTTestProjects.ps1 Discovers native test executables.
tools/​dotnet-test-cloud.ps1 Adds native test execution and reporting.
tools/​dirs.proj Includes samples in traversal builds.
tools/​Configure-GitHubOidc.ps1 Configures immutable subjects and federated credentials.
test/​NativeAOTCompatibility.Test/​NativeAOTCompatibility.Test.csproj Moves AOT import after framework selection.
test/​Microsoft.VisualStudio.Threading.Tests/​ValidityTests.cs Limits GAC checks to .NET Framework.
test/​Microsoft.VisualStudio.Threading.Tests/​TplExtensionsTests.cs Uses explicit theory data.
test/​Microsoft.VisualStudio.Threading.Tests/​ThreadingToolsTests.cs Uses explicit UI-thread helpers.
test/​Microsoft.VisualStudio.Threading.Tests/​TestUtilitiesTests.cs Tests thread helpers and exception propagation.
test/​Microsoft.VisualStudio.Threading.Tests/​TestUtilities.cs Adds STA/UI-thread execution helpers.
test/​Microsoft.VisualStudio.Threading.Tests/​TestBaseTests.cs Uses explicit STA execution.
test/​Microsoft.VisualStudio.Threading.Tests/​ProgressWithCompletionTests.cs Uses explicit theory data.
test/​Microsoft.VisualStudio.Threading.Tests/​Microsoft.VisualStudio.Threading.Tests.csproj Adds .NET 10 and conditional AOT runner.
test/​Microsoft.VisualStudio.Threading.Tests/​JoinableTaskTokenTests.cs Uses explicit theory data.
test/​Microsoft.VisualStudio.Threading.Tests/​JoinableTaskTests.cs Adapts STA execution and trimming annotations.
test/​Microsoft.VisualStudio.Threading.Tests/​JoinableTaskTestBase.cs Annotates intentional hang-report trimming warnings.
test/​Microsoft.VisualStudio.Threading.Tests/​JoinableTaskContextTests.cs Annotates hang-report tests for trimming.
test/​Microsoft.VisualStudio.Threading.Tests/​JoinableTaskAndAsyncReaderWriterLockTests.cs Initializes test contexts on STA threads.
test/​Microsoft.VisualStudio.Threading.Tests/​CancellationTokenExtensionsTests.cs Uses explicit theory data.
test/​Microsoft.VisualStudio.Threading.Tests/​AwaitExtensionsTests.cs Updates theory data and helper-executable lookup.
test/​Microsoft.VisualStudio.Threading.Tests/​AsyncReaderWriterLockTests.cs Adapts STA tests and trimming annotations.
test/​Microsoft.VisualStudio.Threading.Tests/​AsyncLazyTests.cs Uses explicit theory data.
test/​Microsoft.VisualStudio.Threading.Tests/​AsyncLazyInitializerTests.cs Uses explicit theory data.
test/​Microsoft.VisualStudio.Threading.Analyzers.Tests/​Microsoft.VisualStudio.Threading.Analyzers.Tests.csproj Keeps analyzer tests managed with app hosts.
test/​dirs.proj Publishes native tests and compatibility probes.
test/​Directory.Build.targets Adds native discovery and output-path evaluation.
test/​Directory.Build.props Defines shared test and native-build defaults.
test/​AOT.props Separates managed and native runtime features.
init.ps1 Restores through the tools traversal.
global.json Normalizes indentation only.
Directory.Packages.props Updates testing packages and adds AOT runner.
Directory.Build.props Adjusts publishing properties on project references.
CONTRIBUTING.md Documents native testing and feed authentication.
azure-pipelines/​vs-validation.yml Updates network isolation policy.
azure-pipelines/​vs-insertion.yml Updates network isolation policy.
azure-pipelines/​unofficial.yml Updates network isolation policy.
azure-pipelines/​release.yml Updates network isolation policy.
azure-pipelines/​official.yml Updates network isolation policy.
azure-pipelines/​libtemplate-update.yml Updates network isolation policy.
azure-pipelines/​dotnet.yml Publishes and runs native tests when enabled.
azure-pipelines/​build.yml Updates Linux runner image.
azure-pipelines/​archive-sourcecode.yml Updates network isolation policy.
AGENTS.md Clarifies XML documentation scope.
.github/​workflows/​libtemplate-update.yml Pins Ubuntu runner image.
.github/​workflows/​docs.yml Adds manual runs and attempt-specific artifacts.
.github/​workflows/​docs_validate.yml Adds OIDC-backed feed authentication.
.github/​workflows/​copilot-setup-steps.yml Pins Ubuntu runner image.
.github/​renovate.json Adds dependency grouping and filtering.
.github/​actions/​publish-artifacts/​action.yaml Updates artifact upload action.
.config/​dotnet-tools.json Updates coverage, documentation, and symbol tools.
.agents/​skills/​update-library-template/​template-release-notes.md Documents template migration and NativeAOT options.
.agents/​skills/​update-library-template/​SKILL.md Expands repository-specific merge guidance.
.agents/​skills/​testing/​SKILL.md Adds xUnit/MTP testing guidance.

🧠 Review effort: Balanced


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

Comment thread tools/Install-DotNetSdk.ps1
Comment thread tools/dotnet-test-cloud.ps1 Outdated
Retain the approved-feed dotnet-symbol version, forward prerequisite upgrade requests to runtime detection, and enable native hang diagnostics under Windows PowerShell. Add regression checks for both PowerShell editions and avoid redundant Unsafe package references on modern test targets.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Queue frame shutdown through its synchronization context so completion cannot race PushFrame owner assignment. Cover synchronous UI actions and bound native test runs on every platform with a five-minute timeout.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@AArnott
Andrew Arnott (AArnott) marked this pull request as ready for review October 14, 2026 22:16
Copilot AI balanced review requested due to automatic review settings October 14, 2026 22:16

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Cross-platform NativeAOT execution remains unvalidated, and repository-wide authentication and build changes warrant final human verification.

0 open findings

2 resolved since last review
Previously missed (2)

In code that hasn't changed since last review

Low severity Scope test command to the threading test project

.agents/​skills/​testing/​SKILL.md:22

This repeats the all-tests command. From the repository root it runs the solution's test projects, rather than one project as advertised. Add --project with the threading test project path to scope this example correctly.

Low severity Specify the threading project for dotnet run

.agents/​skills/​testing/​SKILL.md:52

Unlike dotnet test, dotnet run does not select a project from the solution. This command fails from the repository root, which has no runnable project, and the example does not instruct readers to change directories. Specify the threading test project explicitly.

🧠 Review effort: Balanced

@AArnott
Andrew Arnott (AArnott) merged commit 19d31e2 into main Oct 15, 2026
11 checks passed
@AArnott
Andrew Arnott (AArnott) deleted the dev/andarno/libtemplateUpdate branch October 15, 2026 12:19
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.

3 participants