Repository navigation
Migrate tests from Helix and XHarness to native dotnet test - #39918
mattleibow wants to merge 136 commits into
Conversation
Migrate xUnit suites and native device hosts to xUnit v3 and Microsoft.Testing.Platform, retain NUnit Appium integration, and run tests directly in CI with real TRX reporting. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Preserve the complete default platform matrix while allowing focused secondary-pipeline validation. Add the technical terms introduced by the migration documentation to the spelling dictionary. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Add an explicit native Windows validation mode without review automation or automatic triggers. Keep the recursive trusted-asset workflow regression aligned with the new launcher sources. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Parse entry text with the culture used to format it. Keep the existing decimal-value assertions intact and verify both French and English runner cultures. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
PR Test Gate
🧪 Gate analysis — click to expand⚠ Inconclusive. Setup, build, or execution did not produce a conclusive result. This does not prove the fix is incorrect. No interpretable test-group summary was produced. No additional test execution is inferred. Setup did not capture a verified PR head; no commit is claimed as tested. No immutable without-fix baseline was prepared. |
There was a problem hiding this comment.
Expert Review — 2 findings
Reviewed commit 0489243.
Source assessment incomplete (10/17 dimensions); finding count is partial.
See inline comments for details.
|
|
||
| function Trust-WindowsTestCertificate { | ||
| param($Certificate) | ||
| $store = [Security.Cryptography.X509Certificates.X509Store]::new('TrustedPeople', 'CurrentUser') |
There was a problem hiding this comment.
[moderate] Windows Platform Specifics - Every packaged run generates a fresh self-signed certificate, but this helper trusts it only in CurrentUser\TrustedPeople. MSIX deployment requires a machine-trusted signing chain, so Add-AppxPackage rejects this signer with 0x800B0109 before activation or test execution. The local packaged runner and all five default packaged CI suites use this path without an accepted-signer alternative. Provide an authorized signing/provisioning path without bypassing deployment validation. The installation tests mock Add-AppxPackage and cannot detect this failure. This previously reported finding remains present.
|
|
||
| Assert.True(DotnetInternal.Build(projectFile, config, target: "Install", framework: $"{framework}-android", properties: BuildProps, output: _output), | ||
| Assert.True(DotnetInternal.Build(projectFile, config, target: "Install", framework: $"{framework}-android", properties: buildProps, output: _output), |
There was a problem hiding this comment.
[moderate] Trimming and AOT Compatibility - Forwarding buildProps now applies TrimMode=full to the unconditional maui-blazor/net11.0/Release/full theory row. The template's Components/Routes.razor assigns Router.NotFoundPage, whose reflected setter access conflicts with its DynamicallyAccessedMembers requirements under full trimming (IL2111), as documented beside the disabled equivalent in AppleTemplateTests.cs. BaseBuildTest sets TreatWarningsAsErrors=true, and TemplateTestExtraTargets does not guard this path, so the selected RunOnAndroid case fails during Install before AppLaunch executes. This previously reported case remains present: establish an explicit supported full-trim coverage contract or an upstream fix rather than discarding TrimMode or suppressing the diagnostic.
|
Closed in favour of #40661 |
[!NOTE]
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
Description of Change
Move repository testing from Helix/XHarness to plain
dotnet testwith Microsoft.Testing.Platform. Draft: native Windows failures, signed-package provisioning, the Blazor full-trimming coverage decision and complete current-head CI verification remain outstanding. Overall CI success and coverage equivalence are not claimed.buildOnly,testOnly,testandbuildAndTestnow delegate to the existing owned native runner. Explicit project path, TFM, packaging and filter are retained; legacy XML/category-index discovery and direct activation loops are removed. Other native applications, including the device-test sample, can useProjectPathinstead of a known alias.-dloption was forwarded to the NUnit host and caused all UI shards to fail the command-line handshake. Build diagnostics, test binlogs, NUnit XML and TRX remain enabled.Coverage and provisioning differences:
0x800B0109: Add-AppxPackage rejects the temporary signer despite CurrentUser\TrustedPeople trust. An authorized owner must provide an accepted signer/image or explicitly approved provisioning. No machine trust or deployment-validation bypass was made. Both packaging modes remain in the default matrix.MAUI-DNCENGpool. Native xUnit requires an on-disk entry assembly, so test hosts setEmbedAssembliesIntoApk=falseandPublishReadyToRun=false, including Release. Release optimization and Mono AOT remain; bundled-assembly/ReadyToRun loading are not covered._DisableCheckForUnsupportedMonoMobileRuntime=truecompatibility opt-in. The SDK otherwise rejects that runtime combination. This preserves legacy test coverage; it is not a claim that Mono is a supported .NET 11 product configuration. Local Mono validation uses the same opt-in, without modifying SDK files.Verified evidence:
-dlwith exit 5, then discovers 3,270 tests without it. The remaining actual run options parse correctly and retain a deliberate empty selection as exit 8, producing genuine TRX rather than success. This is parser/discovery evidence, not a device-backed UI test pass.Windows resource evidence and still-unresolved native behavior:
Device run 1667516 produced a genuine 13 MB native fail-fast dump through temporary PID-scoped ProcDump. Exception
0xC0000409carriesE_OUTOFMEMORY(0x8007000E). Exact Microsoft symbols resolve the fault toCTitleBar::InitializeCompositionin Microsoft.UI.Windowing.Core.dll. The dump contains 18,951 kernel handles, including 8,027 sections and 7,978 DX composition objects.The attachment fixture also had a real scope-lifetime defect: disconnecting Window.Handler before Window.Destroying lost the context needed to dispose the child service scope. Cleanup now retains that actual context and disposes it in finally. That correction did not resolve the native termination: uninstrumented device run 1668198 still exited 57005 / 0xDEAD while
SingleShellSectionWithMultipleChildrenwas active, after 496 recovered rows. The remaining native-resource ownership/root cause is unresolved. No forced GC, disabled title bar, increased resource limit, skip or weakened assertion was added.The same Windows run reports the ScrollView reload focus assertion and a CarouselView native-scroll assertion. These remain unmatched; they are not called flakes. All temporary ProcDump preparation, monitor and generic-template hooks are removed, so validation is uninstrumented. Permanent MTP diagnostics and owned-PID event collection remain.
Main CI coverage blocker: main run 1667491 passed 32/33 jobs. RunOnAndroid passed ten cases and failed Blazor/net11/Release/full installation with IL2111 on Router.NotFoundPage.set. Correct buildProps forwarding now honors TrimMode=full, which baseline accidentally discarded, exposing unsupported Blazor full trimming rather than a native-launch failure. No analyzer suppression, dropped case or silent restoration of ignored properties was made. A coverage decision or upstream support is required.
UI CI handshake correction: UI run 1668195 failed all 123 shards before test execution with MTP invalid-arguments exit 5. The shared Cake test caller forwarded the MSBuild-only distributed logger. The current correction removes that invalid test-host argument while retaining build logging, test binlogs and report reconciliation. Fresh device-backed UI confirmation is required.
Remaining native Windows ownership/focus behavior, accepted signed-package provisioning, the Blazor full-trim contract, full current-head native/integration matrices, device-backed Appium and installed-workload template coverage prevent merge readiness.
Apple's proxy does not accept host
--report-trxor automatically publish native results. The app produces genuine TRX; callers copy it instead of synthesizing stdout results. Reporting polish is separate.Native CI uses
maui-pr-devicetests; Appium usesmaui-pr-uitests. The Copilot pipeline is unchanged.Issues Fixed
No product issue is being closed. The separate Apple reporting limitation is described in dotnet/macios#27251 and is not fixed by this PR.