Skip to content

[rel/4.5] Fix existing MTP summary verdicts - #12031

Merged
Amaury Levé (Evangelink) merged 1 commit into
rel/4.5from
dev/amauryleve/4-5-summary-corrections
Oct 20, 2026
Merged

Amaury Levé (Evangelink) merged 1 commit into
rel/4.5from
dev/amauryleve/4-5-summary-corrections

Conversation

@Evangelink

Copy link
Copy Markdown
Member

Selective servicing adaptation of the existing MTP summary-correctness fixes only from #11960, source merge 6968acca2a1933175d4c9bf84b5863861f42a8e1. This is not a whole cherry-pick.

There is exactly one new commit above rel/4.5: 1fb21269baf6b6f661e7805311d282dafca1bc44, validated on release base 2eeb80e3dd7e6e71c11cd2375d06185032697d1a. No other unmerged backport is stacked.

Scope

  • Honor ExitCodeIgnorePolicy for exit 8 when coloring zero-test summaries, including environment-over-command-line precedence and empty-environment fallback. Expected empty runs remain Zero tests ran, in neutral color, rather than becoming invented passing tests.
  • Exclude skipped tests from explicit minimum-test counts and the corresponding summary wording.
  • Read framework-session failure state at summary time, after output-device construction/initialization, so failed session creation or closure remains Failed! even without individually failed test nodes.

The existing result service remains the owner of actual process-exit calculation. Failed tests, cancellation, handshake/process failures, counters, default all-skipped behavior, and explicitly ignored process exit codes retain their existing semantics. Only the corresponding summary implementation, internal API tracking, and regressions change.

Deliberately excluded from #11960

No AssemblyRunNotSelected / No affected tests selected notification, new resources or localizations, SDK caller/source port, affected-test documentation expansion, or unrelated hosting-test output suppression. The SDK companion is not shipped and is not required by this PR. No new public API or notification protocol is introduced.

Executed validation

Windows, unchanged pinned SDK 12.0.100-alpha.1.26480.103, at most 2 MSBuild workers per build. Final package: Microsoft.Testing.Platform 2.5.2-dev, including its normal net8.0/net9.0/netstandard2.0 payload. The real consumer targets net10.0. The net11.0 acceptance harness uses process-local DOTNET_ROLL_FORWARD=Major to launch on the pinned SDK runtime; the SDK pin is unchanged.

Check Outcome
Complete Windows build/pack, including UAP payload and package metadata/layout verification, before the release-base refresh Passed, exit 0, 0 warnings/errors
Final-head MTP restore/build/repack and package verification Passed, exit 0, 0 warnings/errors
Final-head unit and acceptance harness builds Passed, exit 0, 0 warnings/errors
Focused units on net8.0 / net9.0 / net462 295 / 295 passed on each, exit 0
Fresh, package-consuming process matrix 28 / 28 passed, exit 0
Retained-test semantic reversion on the current release base 14 expected failures, 281 passes, exit 2; restored fixes and reran all green checks afterward
Clean working tree, whitespace, required UTF-8 BOMs, independent one-commit diff, and excluded-file scope Passed (static checks)

The 28 consumer cases execute the built test application against a newly repacked release package, with an asset-local NuGet cache so sibling builds cannot supply a different 2.5.2-dev package. They assert actual process exits 0/2/8/9/10, rendered verdict/color, and exact counter blocks across empty runs, ignore-policy precedence, strict/default skipping, mixed pass/skip minima, real failed tests, and failed framework session creation/closure with zero or passing test nodes. Cancellation, handshake/process errors and multi-assembly aggregation are additionally covered by the focused unit suites; this is not a claim of SDK companion end-to-end validation.

The final consumer's Microsoft.Testing.Platform.dll was SHA-256 compared with lib/net9.0/Microsoft.Testing.Platform.dll inside the final shipping nupkg: exact match.

Nupkg SHA-256: 3A6369D3266F52A2924A5A8743ECAF024D7DC26F08A01045209CE5DE95907A90
Consumer/shipping DLL SHA-256: B20D00432DBD2E65064D95C4CA1239874AF702CCD7CD526D1B724D7FE040BCDC

Exact commands and retained evidence

Logging pipes are omitted below; executable arguments are preserved. $evidence is the retained session artifact directory:

$evidence = 'C:\Users\amauryleve\.copilot\session-state\62f8933b-5dd0-45b1-9500-4b641f9a9f70\files'
$env:PATH = "$PWD\.dotnet;$env:SystemRoot\System32\WindowsPowerShell\v1.0;$env:SystemRoot\System32;$env:SystemRoot;C:\Program Files\Git\cmd;C:\Program Files\PowerShell\7"

# Complete Windows layout: passed, exit 0 (before base refresh).
& "$env:SystemRoot\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -ExecutionPolicy Bypass -File .\eng\build.ps1 -restore -build -pack -msbuildEngine vs /p:EnableCodeCoverage=false /m:2 "/bl:$evidence\release-summary-full-pack-{}.binlog"

# Final head: all three commands passed, exit 0.
& "$env:SystemRoot\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -ExecutionPolicy Bypass -File .\eng\build.ps1 -restore -build -pack -projects src\Platform\Microsoft.Testing.Platform\Microsoft.Testing.Platform.csproj -msbuildEngine dotnet /p:EnableCodeCoverage=false /m:2 "/bl:$evidence\summary-head-core-pack-{}.binlog"
& "$env:SystemRoot\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -ExecutionPolicy Bypass -File .\eng\build.ps1 -build -projects test\UnitTests\Microsoft.Testing.Platform.UnitTests\Microsoft.Testing.Platform.UnitTests.csproj -msbuildEngine dotnet /p:EnableCodeCoverage=false /m:2 "/bl:$evidence\summary-head-unit-build-{}.binlog"
& "$env:SystemRoot\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -ExecutionPolicy Bypass -File .\eng\build.ps1 -restore -build -projects test\IntegrationTests\Microsoft.Testing.Platform.Acceptance.IntegrationTests\Microsoft.Testing.Platform.Acceptance.IntegrationTests.csproj -msbuildEngine dotnet /p:EnableCodeCoverage=false /m:2 "/bl:$evidence\summary-head-consumer-build-{}.binlog"

$env:DOTNET_ROOT = "$PWD\.dotnet"
$filter = 'FullyQualifiedName~TestRunSummaryHelperTests|FullyQualifiedName~TerminalOutputDeviceTests|FullyQualifiedName~TerminalTestReporterTests|FullyQualifiedName~TestApplicationResultTests|FullyQualifiedName~TestHostTestFrameworkInvokerTests'

# Each passed 295 tests, exit 0.
& .\.dotnet\dotnet.exe .\artifacts\bin\Microsoft.Testing.Platform.UnitTests\Debug\net8.0\Microsoft.Testing.Platform.UnitTests.dll --filter $filter --minimum-expected-tests 1 --report-trx --report-trx-filename summary-unit-net8.trx --results-directory "$evidence\test-results" --no-ansi --progress off
& .\.dotnet\dotnet.exe .\artifacts\bin\Microsoft.Testing.Platform.UnitTests\Debug\net9.0\Microsoft.Testing.Platform.UnitTests.dll --filter $filter --minimum-expected-tests 1 --report-trx --report-trx-filename summary-unit-net9.trx --results-directory "$evidence\test-results" --no-ansi --progress off
& .\artifacts\bin\Microsoft.Testing.Platform.UnitTests\Debug\net462\Microsoft.Testing.Platform.UnitTests.exe --filter $filter --minimum-expected-tests 1 --report-trx --report-trx-filename summary-unit-net462.trx --results-directory "$evidence\test-results" --no-ansi --progress off

# Passed 28 real consumer cases, exit 0.
$env:DOTNET_ROLL_FORWARD = 'Major'
$env:Microsoft_Testing_TestInfrastructure_TempDirectory_Cleanup = '0'
& .\.dotnet\dotnet.exe .\artifacts\bin\Microsoft.Testing.Platform.Acceptance.IntegrationTests\Debug\net11.0\Microsoft.Testing.Platform.Acceptance.IntegrationTests.dll --filter 'FullyQualifiedName~TestRunSummaryTests' --minimum-expected-tests 1 --report-trx --report-trx-filename summary-consumer.trx --results-directory "$evidence\test-results" --no-ansi --progress off

Sensitivity check: retained all tests and internal signatures, temporarily forced AllowZeroTests=false, counted skipped tests toward minima again, and replaced the late session-failure provider with static () => false. Rebuilt with the same unit build command plus -restore and binlog summary-head-sensitivity-build-{}.binlog; ran the same net8.0 command with TRX filename summary-unit-reverted.trx. The expected failures split into 6 ignore-policy, 6 minimum-count, and 2 session-failure cases. All temporary reversions were removed before final repacking and the green reruns above.

Retained evidence: the five named TRX files, summary-package-evidence.json, build/test logs and unique binlogs under $evidence; final generated consumer under artifacts\tmp\Debug\testsuite\2N6Kv\TestRunSummary. A first dotnet-only pack that omitted UAP failed broader MSTest payload-count verification; the complete desktop pack resolved it without changing package expectations.

Remaining local blockers: none. GitHub CI is separate from these executed local checks; no merge or Agent merge is requested.

Selectively adapt the existing MTP summary-correctness fixes from #11960
(6968acc).

Honor the exit-code 8 ignore policy in zero-test summary coloring, exclude
skipped tests from explicit minima, and preserve framework-session failures
without changing actual process exit codes or introducing a notification
protocol. Add focused unit and packed-consumer regressions.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 62f8933b-5dd0-45b1-9500-4b641f9a9f70
@github-actions github-actions Bot added the state/needs-review Awaiting review from the team. label Oct 19, 2026
@microsoft-github-policy-service microsoft-github-policy-service Bot added state/needs-review Awaiting review from the team. and removed state/needs-review Awaiting review from the team. labels Oct 19, 2026
@github-actions github-actions Bot added state/approved Proposal approved; ready for implementation. and removed state/needs-review Awaiting review from the team. labels Oct 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Final test-triage resolution — Azure Pipelines build 1640977

Final analysis of the completed aggregate build (microsoft.testfx check, build succeeded overall).

Summary: No actionable test failures. All 6 raw "failed" records in the normalized evidence come from first-attempt executions of deliberate retry/probe test cases that are designed to fail once and then pass on a subsequent attempt — this is expected product behavior being validated, not a regression:

  • NativeTests.Outcome (4 occurrences) — message: "expected host failure" / Assert.IsFalse(fail). Each failing attempt has a sibling retry/subsequent run under the same NativeSidecar test-suite directory that passed.
  • PackagedWinUI.PackagedWinUITestCases.RetryTestMethod_PassesOnSecondAppContainerHost (1 occurrence) — message: "The first AppContainer host fails so Retry must activate a second host." Attempt 1 failed, attempt 2 and the final consolidated TRX both passed.
  • WinUIMtpPackagedApp.UnitTest1.RetryFailsFirstAttempt (1 occurrence) — message explicitly states: "This probe deliberately fails the first retry attempt and passes the next one." Attempt 1 failed, attempt 2 and the final consolidated TRX both passed.

For each of these, the same executionId/test-suite folder shows a fail-then-pass sequence across the numbered Retries/.../1, .../2, and final consolidated TRX files, consistent with intentional retry-mechanism probes rather than flaky or defective tests. metadata.json reports evidenceIncomplete: false, diagnosticCount: 0, and no timeline signals or slow regressions (slowRegressionCount: 0) across the 53 slow-duration candidates checked.

Conclusion: No issue is warranted — this is a clean build with only expected, by-design retry-probe churn. No further action needed.

🤖 Automated content by GitHub Copilot. Generated by the Pipeline Test Triage workflow. · copilot · auto · 39 AIC · ⌖ 9.55 AIC · ⊞ 9.7K

@Evangelink
Amaury Levé (Evangelink) merged commit 2a9c2e1 into rel/4.5 Oct 20, 2026
31 checks passed
@Evangelink
Amaury Levé (Evangelink) deleted the dev/amauryleve/4-5-summary-corrections branch October 20, 2026 11:43
@github-actions github-actions Bot removed the state/approved Proposal approved; ready for implementation. label Oct 20, 2026
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.

2 participants