Repository navigation
[rel/4.5] Fix MTP MSBuild reporting for controller-backed test runs - #12057
Merged
Amaury Levé (Evangelink) merged 1 commit intoOct 26, 2026
Merged
Amaury Levé (Evangelink) merged 1 commit into
Amaury Levé (Evangelink) merged 1 commit into
Conversation
Backport 00c2b84 (#12049), including the results-directory initialization from 780b5e3. Restrict callback suppression to actual AppContainer children and preserve the required MSBuild handshake and cooperative cancellation. Adapt only the regression fixtures missing from rel/4.5. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9a0577f6-c83e-4e2d-a0a6-e42063b3602d
Petr Pokorny (0101)
approved these changes
Oct 20, 2026
Contributor
|
Final test-triage resolution — Azure Pipelines build 1642575 Result: no actionable test failure (high confidence). The build succeeded, and evidence collection was complete (no fetch or artifact failures).
No issue is warranted and no follow-up is needed.
|
Amaury Levé (Evangelink)
deleted the
dev/amauryleve/4-5-msbuild-reporting-backport
branch
October 26, 2026 10:49
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
Backport only #12049, merge commit
00c2b84b751f9bf17e4f25366792c6415cb47fce, including its final results-directory repair from780b5e31fa605ff8d04be0075abc95270d746026.This services the MTP 2.5 / MSTest 4.5 regression reported in #12032:
TestandInvokeTestingPlatformlose module information and summaries when TRX, HangDump, or CrashDump starts an ordinary controller child. Suppress callbacks only for an actual Windows AppContainer, not every controller PID. Also create the first module's results directory inside the existing ownership lock before opening its log; restoring callbacks without that repair can terminate the build before cooperative cancellation completes.The required module/summary handshake, actual test exits, first-module ownership, cancellation-marker assertion, AppContainer child suppression, IPC format, and native-error visibility remain intact. No public API, dependency, CLI, resource, package-version, SDK-pin, or product-TFM change is included.
The release lacks the upstream hook fixture and task execution simulation helpers. Adapt only those related regressions, using the real filesystem for missing/existing directory and first-module ownership checks. The 16-row package-consuming controller test is unchanged from the source PR. Preserve the release's existing browser/OS guards rather than importing main-only WebAssembly changes. No unrelated implementation or new release design document is included; the original investigation and alternatives provide the rationale.
Release provenance and Test-value evidence
Tested/pushed head:
f47969ee3ffb2f5f90d604bc4e550ecfc7aa6cc6.Final release base:
bdb22d719848d19bba86a6e3dc2e63c98e7c03aa. Rebased and repacked after the intervening release product backports; the PR diff remains the five files from #12049 only.Windows x64; release-pinned SDK
12.0.100-alpha.1.26480.103; Release runners/packages; net8.0/net9.0 focused units; net10.0 ordinary generated consumers; net8.0-windows10.0.19041.0 real WinUI consumer. Packages are MSTest.Sdk/TestAdapter/TestFramework4.5.2-devand MTP/MSBuild/TRX/HangDump/CrashDump/PackagedApp2.5.2-dev. These are fresh release-branch results, not the source PR's main-branch evidence.InvokeTestingPlatform_Target_With_AutoRegistered_Extensions_Should_Report_Test_Results: both entry points, no option/TRX/HangDump/CrashDump, passing/failing testsExecute_ModuleInfoCreatesResultsDirectoryBeforeOpeningLogDirectoryNotFoundException; 2 existing-directory controls passed across net8/net9; exit 2AddExtensions_ControllerPidOptionAtAnyPosition_RegistersFullMSBuildIntegrationExplicitConsumer_ControllerTimeoutCancelsHostWithoutFalseSuccessDirectoryNotFoundExceptionand missing cancellation marker; exit 2Trueremain mandatory. Every restored shipping DLL matches the previously tested final package.PackagedAppContainerWinUI_RunsThroughMtpControllerAndPublishesTrxMain final batch: 229 executed checks, zero failures/skips, plus the separate passing cancellation rerun after the one-line counterfactual. Independent filtered discovery matched every native TRX identity; SDK-merged reports were reconciled without double-counting. Existing method-level scheduling remains enabled; every matrix row owns a fresh mutable asset/results path.
Baseline packages were built from
a223d46d5784d315e7bae2a04d85185b191dd2b3with the new tests retained. The red runs' checkout had advanced to851ffb1578b10fb7c79e6e96245a662481a43e56through three unrelated test-only file updates; the tested production and selected test sources were unchanged. The final-layout cancellation counterfactual above avoids relying on that older composition for the directory-repair proof.All 32 baseline/fixed ordinary consumers matched their variant's seven key shipping DLLs and aligned package versions. Effective consumer caches differed between variants. Every final package's repository commit was verified against the tested head. Build/restore/launch failures, zero-test discovery setup errors, and skips are not counted as red-phase proof.
Exact command arguments and artifacts
All environment changes were process-local. Build workers were bounded with
/m:2; test processes usedDOTNET_PROCESSOR_COUNT=2and at most two parallel test modules. The short PATH avoids this host's inherited cmd.exe PATH limitation. Windows PowerShell receives a single-quoted command so-nodeReuse:$falsebinds as a Boolean, and its native exit is propagated explicitly.Result: exit 0, zero warnings/errors. The baseline pack used the same build arguments with
baseline-pack-1.binlog, also exit 0, zero warnings/errors. The one-line cancellation counterfactual and restored package each used the same command with-projects src\Platform\Microsoft.Testing.Platform.MSBuild\Microsoft.Testing.Platform.MSBuild.csprojand distinctfinal-no-directory-pack.binlog/final-restored-pack.binlog; both builds exited 0, zero warnings/errors.The following expresses the recorded native discovery/execution argument vectors without repeating the common arguments.
$projectand$resultswere absolute paths. Each call used a distinct results directory; reporting defaults were cleared only for discovery, not execution.Every final discovery/execution above exited 0. The related-unit discovery/identity verifier required exactly 198 executed identities despite the invocation's generic minimum of one. The matrix/boundary/hook red runs used the same vectors and the selectors shown in the evidence table, with minima 16/4/6; their intended failing executions exited 2. The final-layout cancellation red run used
$cancel, minimum 1, directoryfinal-no-directory-cancellation, and exited 2; the restored run above exited 0.Raw build and consumer binlogs, native/merged TRX, independent plans, package hashes, and verification JSON remain under
artifacts\backport-12049andartifacts\tmp\Release\testsuitein the producing session. The real AppContainer report isartifacts\tmp\Release\testsuite\W9fud\PackagedWinUI\TestResults\appcontainer-winui.trx; its five executed identities were read back. A consolidatedbackport-12049-evidence.jsonin the session artifacts preserves the full commands, source SHAs, results, and provenance.Limits: Windows x64 only; Linux/macOS and the reporter's exact SDK 10.0.402/released-package setup were not run locally. No CI success or baseline AppContainer green/green pair is claimed. VS discovery returned no installations, but the real dotnet-based WinUI/AppContainer fixture nevertheless built and ran successfully; it is not an unexecuted/mock-only gap.