Repository navigation
Enable build-free dotnet test in Native AOT - #55971
Merged
Merged
Conversation
Handle explicit Microsoft.Testing.Platform --test-modules invocations in the Native AOT CLI while preserving managed fallback for build-dependent and unsupported shapes. Co-authored-by: Copilot App <[email protected]> Copilot-Session: fd4b45f2-a70d-42bd-b6b1-cfdc9f729a08
|
Azure Pipelines: Successfully started running 2 pipeline(s). 1 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the Native AOT dotnet CLI to handle a constrained, build-free dotnet test --test-modules (Microsoft.Testing.Platform) execution path in native code, while preserving managed fallback for MSBuild- and VSTest-dependent shapes.
Changes:
- Adds an AOT-only
AotTestCommandeligibility gate and wires it into the AOT command tree. - Refactors
dotnet testMTP build-option parsing into a sharedTestCommandOptionshelper with#if CLI_AOTbehavior differences. - Adds AOT parser/integration tests plus runner scripts that supply a managed test module for end-to-end validation.
Show a summary per file
| File | Description |
|---|---|
| test/dotnet-aot.Tests/run-aot-tests.sh | Exports a managed test module path for AOT integration validation. |
| test/dotnet-aot.Tests/run-aot-tests.ps1 | Locates and exports a managed test module path for AOT integration validation. |
| test/dotnet-aot.Tests/AotParserTests.cs | Adds AOT parser coverage for supported/unsupported test --test-modules shapes. |
| test/dotnet-aot.Tests/AotIntegrationTests.cs | Adds end-to-end execution test for AOT test --test-modules driving a managed module. |
| src/Cli/dotnet/Parser.cs | Wires AotTestCommand into AOT action configuration for dotnet test. |
| src/Cli/dotnet/Commands/Test/MTP/TestCommandOptions.cs | New shared helper for extracting build/options from MTP ParseResult (AOT-aware). |
| src/Cli/dotnet/Commands/Test/MTP/MSBuildUtility.cs | Delegates build-options extraction to the new TestCommandOptions helper. |
| src/Cli/dotnet/Commands/Test/MTP/MicrosoftTestingPlatformTestCommand.cs | Adds #if CLI_AOT path for test-module handler and avoids MSBuild-only logic in AOT. |
| src/Cli/dotnet/Commands/Test/AotTestCommand.cs | New AOT-only command action that allowlists options and triggers fallback otherwise. |
| src/Cli/dotnet-aot/DESIGN.md | Documents the new build-free test-modules orchestration behavior in AOT. |
| src/Cli/dotnet-aot/AotSourceFiles.props | Links the required dotnet test MTP orchestration sources into the AOT closure. |
| src/Cli/dotnet-aot/AotDependencies.props | Adds dependencies needed by the AOT test-module orchestration closure. |
Review details
- Files reviewed: 12/12 changed files
- Comments generated: 1
- Review effort level: Lite
Evangelink
enabled auto-merge
August 27, 2026 17:37
Assert that the extension option is preserved without rejecting the environment-driven --no-banner argument. Co-authored-by: Copilot App <[email protected]> Copilot-Session: fd4b45f2-a70d-42bd-b6b1-cfdc9f729a08
29 tasks
drognanar
approved these changes
Aug 28, 2026
Evangelink
had a problem deploying
to
copilot-pat-pool
August 28, 2026 14:21 — with
GitHub Actions
Failure
This branch had an error being deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
dotnet test --test-modulesinvocations in the Native AOT CLIValidation
build.cmddnand the built SDKAotRun_NoBuildSyntheticCache_LaunchesAndConservativelyFallsBack,Version_WithAotDisabled_StillWorks, andInfo_WithAotDisabled_ShowsFullInfo, all failing while loading hostfxr withAccess is deniedNative size
Release
dotnet-aot.dll: 18,500,096 -> 19,572,224 bytes (+1,072,128 bytes, +5.8%).