Repository navigation
Fix native dotnet test routing for packaged applications - #11804
Amaury Levé (Evangelink) merged 2 commits into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🔵 Needs a closer look
The process-launch and SDK IPC changes require human review given the unvalidated architectures, SDK versions, and end-to-end cancellation path.
0 open findings
What changed in this PR
Routes native .NET 10 test and run commands for packaged full-trust applications through the packaged-app sidecar.
Changes:
- Adds versioned controller argument and native SDK pipe routing.
- Handles informational launches, cancellation, retries, and AppContainer rejection.
- Adds comprehensive unit/acceptance coverage, localization, and documentation.
| File | Description |
|---|---|
test/UnitTests/Microsoft.Testing.Extensions.UnitTests/PackagedAppNativeInformationalLaunchTests.cs |
Tests informational launch lifecycle. |
test/UnitTests/Microsoft.Testing.Extensions.UnitTests/PackagedAppControllerArgumentsTests.cs |
Tests bootstrap and transport parsing. |
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/PackagedAppNativeDotnetTestTests.cs |
Exercises native packaged test scenarios. |
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/PackagedAppIntegrationTests.cs |
Tests computed run contracts and overrides. |
src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/ExtensionResources.resx |
Adds controller errors. |
src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.cs.xlf |
Updates Czech catalog. |
src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.de.xlf |
Updates German catalog. |
src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.es.xlf |
Updates Spanish catalog. |
src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.fr.xlf |
Updates French catalog. |
src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.it.xlf |
Updates Italian catalog. |
src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.ja.xlf |
Updates Japanese catalog. |
src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.ko.xlf |
Updates Korean catalog. |
src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.pl.xlf |
Updates Polish catalog. |
src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.pt-BR.xlf |
Updates Portuguese catalog. |
src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.ru.xlf |
Updates Russian catalog. |
src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.tr.xlf |
Updates Turkish catalog. |
src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.zh-Hans.xlf |
Updates Simplified Chinese catalog. |
src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.zh-Hant.xlf |
Updates Traditional Chinese catalog. |
src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppTestHostLauncher.PackagedLaunch.cs |
Rejects native AppContainer launches. |
src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppTestHostLauncher.LooseLayout.cs |
Prevents stale native transport inheritance. |
src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppTestHostLauncher.cs |
Forwards native transport to the host. |
src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppNativeInformationalLaunch.cs |
Implements help/discovery host lifecycle. |
src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppControllerArguments.cs |
Implements the startup protocol. |
src/Platform/Microsoft.Testing.Extensions.PackagedApp/InternalAPI/InternalAPI.Unshipped.txt |
Tracks new internal APIs. |
src/Platform/Microsoft.Testing.Extensions.PackagedApp.MSBuild/PACKAGE.md |
Documents native routing behavior. |
src/Platform/Microsoft.Testing.Extensions.PackagedApp.MSBuild/buildTransitive/Microsoft.Testing.Extensions.PackagedApp.MSBuild.targets |
Rewrites computed launch properties. |
src/Platform/Microsoft.Testing.Extensions.PackagedApp.Controller/Program.cs |
Integrates routing into the controller. |
docs/winui-testing.md |
Documents WinUI behavior and limitations. |
🧠 Review effort: Balanced
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.
This comment has been minimized.
This comment has been minimized.
Amaury Levé (Evangelink)
left a comment
There was a problem hiding this comment.
Note
Automated review by GitHub Copilot. To request a follow-up action, reply by tagging @copilot directly.
Review outcome: Two reproduced P2 regressions in the newly routed dotnet run path need correction before I can recommend approval. Both were confirmed with SDK 10.0.401, freshly packed 4.6.0-dev / 2.6.0-dev components, and an actual full-trust package whose module initializer requires Package.Current.
Reviewer actions: Preserve launch-profile argument handling, and activate the selected host for informational dotnet run requests. Add acceptance cases for profile-only arguments, explicit-argument precedence, and dotnet run -- --list-tests / --help. The inline comments contain the reproductions and expected outcomes.
Confidence at a glance
🟡 MSBuild and SDK launch integration — launch-profile arguments are lost
Reviewed fresh ComputeRunArguments evaluation, clean/no-build execution, staged executable selection, explicit overrides, and .NET 10 SDK argument precedence. A profile requiring three tests silently exits 0 with only one test; the identical explicit argument tail exits 9. See the inline finding on the bootstrap argument assignment.
🟡 Controller, transport and lifecycle — non-native discovery crashes
Traced transport stripping/reinjection, execution identity, retries, activation handoff, controller/discovery roles, and cancellation cleanup. Packaged dotnet run -- --list-tests exits -532462766 without activating the host; native dotnet test --list-tests --no-launch-profile on that same package discovers the test and exits 0. See the inline finding on the no-transport return.
🟢 Existing regression coverage and compatibility — baseline checks passed
The scoped extension build and both sidecar TFMs compiled without warnings/errors. All 160 runnable PackagedApp unit cases passed (two existing OS-conditioned skips), and all 79 PackagedApp native/MSBuild acceptance cases passed using newly packed components. Reviewed changed assertions, isolation, resource/XLF parity, internal API tracking, package layout, and documentation alignment. These passing cases do not exercise the two reproduced dotnet run failures.
The focused pack produced the required consumer packages, but its final whole-package audit failed on deliberately excluded UAP files and the omitted UIAutomation project; this is not a full-pack success. End-to-end Ctrl+C, ARM64/x86 execution, and other native SDK versions were not rerun. Keep the already documented filter-registration dependency on #11805; it is not counted as a new finding here.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: df96a46c-5877-4d2e-abec-187268e68740
There was a problem hiding this comment.
🔵 Needs a closer look
It introduces cross-package process-launch and IPC behavior, depends on #11805, and lacks ARM64/x86 and broader SDK validation.
0 open findings
🧠 Review effort: Balanced
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.
|
Final test-triage resolution — Azure Pipelines build 1627746 Analysis for the Summary: Out of 107,712 normalized test records, the only non-passing result is Root cause: This is not a regression or flake. The test's source ( Historical correlation: All 12 available historical builds in the last 30 days show the identical pattern — attempt 1 Conclusion: No action needed. No issue is being created — this does not meet the durable-defect, flaky-recovery, or regression thresholds (the fail-then-pass pattern is expected and consistent, not anomalous). No matching open/closed issue search was needed since this is expected behavior, not a candidate signature. No other actionable test, crash/hang, or duration-regression signals were found in this build's evidence (
|
|
/backport to rel/4.5 |
cac4b5c
into
microsoft:main
|
Started backporting to rel/4.5: https://github.com/microsoft/testfx/actions/runs/37768965920 |
Native .NET 10
dotnet testreadsRunCommand/RunArgumentsfrom a freshComputeRunArgumentsevaluation, not the executable/environment items used byInvokeTestingPlatform. Route packaged full-trust .NET applications through the existing sidecar in that path, including clean builds and--no-build, using a versioned startup prefix that preserves the selected executable, enabled extensions, and argument tail.Only the activated test host connects to the SDK pipe, so it reports its real runtime/architecture rather than conflicting with the external controller's identity. Preserve the execution-ID handoff, retry transport, selected-host results, failure exit codes and on-disk TRX reports. Native help/discovery activate the actual host instead of describing the dummy framework. Preserve explicit executable/run-command overrides and unpackaged execution; document the corresponding packaged
dotnet runbehavior and explicit native AppContainer rejection (use the working MSBuild path).Scope: framework-specific option registration, including MSTest's
--filter, is implemented in the dependent #11805. Routing and that registration fix should ship together. The filter branch is based on this PR's pushed commit; both PRs target upstreammainas requested because the parent branch exists only in the fork, so #11805's diff is cumulative until this PR merges. Controller-generated reports are written on disk, not advertised as artifacts to the native SDK. SDK 10's help/startup limitations and informational-host teardown limitations are documented.Validation (Windows x64; source packages
4.6.0-dev/2.6.0-dev; generated assets explicitly pin SDK 10.0.401):powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\eng\build.ps1 -restore -build -bl -msbuildEngine dotnet -projects artifacts\tmp\RoutingValidation\RoutingValidation.slnx /p:SkipUapTargetFramework=true.\.dotnet\dotnet.exe artifacts\bin\Microsoft.Testing.Extensions.UnitTests\Debug\net8.0\Microsoft.Testing.Extensions.UnitTests.dll --filter 'FullyQualifiedName~PackagedApp' --progress off& "$root\.dotnet\dotnet.exe" "$root\artifacts\bin\MSTest.Acceptance.IntegrationTests\Debug\net11.0\MSTest.Acceptance.IntegrationTests.dll" --filter 'FullyQualifiedName~PackagedAppNativeDotnetTestTests|FullyQualifiedName~PackagedAppIntegrationTests' --progress off$rootwas a temporary short-path alias of this same worktree to avoid the existing long package-cache path limit..\.dotnet\dotnet.exe msbuild src\Platform\Microsoft.Testing.Extensions.PackagedApp\Microsoft.Testing.Extensions.PackagedApp.csproj -t:UpdateXlf -bl:artifacts\log\Debug\Routing-UpdateXlf2.binlog -v:minimal.\build.cmd -pack -bl -msbuildEngine dotnet -projects artifacts\tmp\RoutingValidation\RoutingValidation.slnx /p:SkipUapTargetFramework=true(and equivalenteng\build.ps1 -restore -build -pack -blrepack)The lightweight packaged fixture requires
Package.Currentin a module initializer and needs no WinUI/Visual Studio workload. It verifies--projectand positional invocations, clean/no-build, .NET 8/.NET 10 hosts, actual package/execution identity, pass/fail results, exact TRX test outcomes, retries, actual help/discovery, disabled/AppContainer rejection, anddotnet run. Disabling routing reproduces the original identity-required startup failure with zero tests.ARM64/x86 execution, other native SDK versions, end-to-end Ctrl+C, and full UAP package validation were not run. No GitHub issue was supplied with the reproduction handoffs.