Skip to content

Preserve MTP report diagnostics and document agent usage - #12282

Merged
Amaury Levé (Evangelink) merged 4 commits into
mainfrom
evangelink-json-report-assessment
Nov 9, 2026
Merged

Amaury Levé (Evangelink) merged 4 commits into
mainfrom
evangelink-json-report-assessment

Conversation

@Evangelink

@Evangelink Amaury Levé (Evangelink) commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Pull request

Summary

Existing CTRF, HTML and JUnit reports can omit an exception's inner cause when a framework supplies an exception without a flattened explanation. Preserve those diagnostics in the existing reports instead of introducing another JSON format, and consolidate version-aware MTP guidance for agents and CI tools.

  • Retain the full exception representation in the diagnostic trace only when inner exceptions exist, including aggregate branches. Preserve explicit framework explanations, outer exception identity, ordinary stack traces and existing size limits.
  • Add a packed-consumer regression checking five distinguishable results and their associated identities, names, outcomes and diagnostics in each report.
  • Add a discoverable agent/CI guide and a repository-instructions pointer outside the managed AGENTS.md block. No runner defaults, report schemas or public APIs change.

Fixes #12274
Fixes #12275

Relates to #8824. The separate failure-index evaluation in #8827 is not implemented by this PR.

Design and decision record

This is a focused correctness fix and documentation follow-up, not a new feature requiring a separate design document. The maintained rationale is in the RFC decision record, report-fidelity evidence, and guidance scope.

A new format cannot recover diagnostics discarded during capture. Using the standard exception representation for nested cases avoids a second exception-tree formatter, while leaving ordinary exceptions unchanged. Inner causes belong in the trace; the existing message field continues to prefer the framework's explanation. The guidance distinguishes shipped MTP 2.x behavior from upcoming 3.0 changes, and OTel observability from a complete persisted results ledger. The earlier pilot is limited triage evidence, not proof of model-cost or energy savings.

Demonstration

Opened the actual self-contained HTML generated by the packed net11.0 DiagnosticFramework consumer and expanded NestedFailure in the browser at a 1280 x 721 CSS-pixel viewport. Its inner cause rendered as literal text, including <401>, & and quotes, under the correct result. The disclosure was reachable and the diagnostic block readable. No layout code changed; constrained viewports were not exercised.

Sanitized transcript of the inspected result:

NestedFailure
Error message: Invocation failed.
Stack trace:
System.InvalidOperationException: Invocation failed.
 ---> System.ArgumentException: [INNER_CAUSE] Service rejected <401> & "credential".
   --- End of inner exception stack trace ---

The same original-source consumer omitted this diagnostic trace. A text transcript communicates this data-preservation change better than a screenshot containing machine/user metadata. Screenshots and raw logs remain local; no media was uploaded. No hosted CI or IDE UI behavior is being claimed.

Validation and regression proof

Original tested production commit: d8ae1ef788e7a72fc767ccfca29e58b186ddfa4c. Initial tested head e8eef67cd9d53fce18bd42fee436d720114d55b0 adds only the validated guide/index/pointer. Guide-review commit 7c5d3099bbd76426a58327e38ab3d426c50a7559 corrects native SDK renderer controls. Current head d6a5ebfb69de10299cc2a3cca0c32602c04abf38 merges main at 19bfd517ba336e27bbeed4967fc5629e956ccc23, retaining both JUnit graduation/compatibility guidance and the nested-diagnostic paragraph. The report helper and both regression-test files remain byte-identical to the pre-merge head.

Historical paired regression proof

Counterfactual: original production source b3f3c980c480c5d97976d658ac367b1e246502be with identical final regression-test bytes in a separate task-owned checkout. Windows; Release; repository SDK 12.0.100-alpha.1.26509.101. Unit hosts: net10.0 and net472. Outer acceptance host: net12.0; generated consumer: net11.0. $evidence and $results denote isolated local result directories; commands ran from each variant's repository root.

Build/pack: .\build.cmd -c Release -pack -bl passed with exit 0 in both production states. The default desktop-MSBuild path is required for the repository's UAP assets.

Unit commands:

.\.dotnet\dotnet.exe run --project test\UnitTests\Microsoft.Testing.Extensions.UnitTests\Microsoft.Testing.Extensions.UnitTests.csproj -f net10.0 -c Release --no-build -- --filter 'FullyQualifiedName~TestResultCaptureHelperTests' --report-trx --report-trx-filename green.trx --results-directory "$evidence\unit-green"
.\.dotnet\dotnet.exe run --project test\UnitTests\Microsoft.Testing.Extensions.UnitTests\Microsoft.Testing.Extensions.UnitTests.csproj -f net472 -c Release --no-build -- --filter 'FullyQualifiedName~TestResultCaptureHelperTests' --report-trx --report-trx-filename framework-green.trx --results-directory "$evidence\unit-framework-green"
.\.dotnet\dotnet.exe run --project test\UnitTests\Microsoft.Testing.Extensions.UnitTests\Microsoft.Testing.Extensions.UnitTests.csproj -f net10.0 -c Release --no-build -- --filter 'FullyQualifiedName~TestResultCaptureHelperTests' --report-trx --report-trx-filename original.trx --results-directory "$evidence\unit-original"

Correct implementation: 29 executed/passed per TFM, 0 failed/skipped, exit 0. Original-source net10.0 run: 29 executed, 22 passed, 7 failed at missing diagnostic-trace assertions, 0 skipped, runner exit 2. Existing baseline before the new tests: 21 passed, 0 failed/skipped.

Packed acceptance commands:

$project = 'test\IntegrationTests\Microsoft.Testing.Platform.Acceptance.IntegrationTests\Microsoft.Testing.Platform.Acceptance.IntegrationTests.csproj'
$filter = 'FullyQualifiedName~ReportExceptionDiagnosticsTests.Reports_NestedExceptions_PreserveAssociatedCausesAndExplanations'
.\.dotnet\dotnet.exe test --project $project -c Release --no-build -p:UsingDotNetTest=true -p:TestingPlatformCommandLineArguments= -p:TestRunnerAdditionalArguments= "-bl:$results\discovery.binlog" --list-tests text -- --filter $filter
.\.dotnet\dotnet.exe test --project $project -c Release --no-build -p:UsingDotNetTest=true -p:TestingPlatformCommandLineArguments= -p:TestRunnerAdditionalArguments= "-bl:$results\execution.binlog" --results-directory $results -- --filter $filter --report-trx --report-trx-filename acceptance.trx --show-test-results all

Discovery passed and selected the one source-declared case. Correct implementation: 1 executed/passed, 0 failed/skipped, outer exit 0; the intentionally failing child exits 2 after publishing five results. Original packages: the same case executed and failed at CTRF result 'nested' must retain its nested exception trace., outer exit 2. Fresh TRX execution verification passed for the final green run.

Both variants were repacked and restored with separate acceptance caches. Consumer runtime DLL SHA-256 values matched their respective historical package payloads: MTP/CTRF/HTML 3.0.0-dev and JUnit 1.0.0-dev. Package/cache provenance summaries, paired reports, TRX, logs and available binlogs are retained locally, not publicly hosted; the linked issue evidence contains compact results and limitations. The owned comparison checkout and build-node processes were cleaned up.

Post-merge validation

Main updates the pinned SDK to 12.0.100-alpha.1.26556.115 and graduates JUnit to the platform-aligned version. After resolving the README conflict, the merged tree was rebuilt and repacked using that declared SDK. No build configuration, CI infrastructure or dependency policy was changed by the conflict resolution.

  • .\build.cmd -c Release -pack -bl: passed, exit 0, no warnings/errors.
  • The same unit selector above: 29 passed on net10.0 and 29 passed on net472, 0 failed/skipped, exit 0. Post-merge runs used unit-net10.trx / unit-net472.trx in separate result directories.
  • The same packed acceptance selector above: independently discovered 1 case, executed/passed 1, 0 failed/skipped, outer exit 0; fresh TRX execution verification passed.
  • The generated net11.0 consumer resolved MTP, CTRF, HTML and JUnit all at 3.0.0-dev; each staged runtime DLL hash matched its freshly packed payload. The earlier task-owned JUnit 1.0 artifact was archived rather than mixed into this feed. Shared package caches were not cleared.

This is fresh green validation of the merged toolchain/package state. The earlier red/green runs remain labeled at their original revisions; a new paired red run was not performed with the updated SDK. The PR's own executable behavior and regression assertions are unchanged.

Guide validation

The native SDK command correction was checked against official SDK documentation. All guide PowerShell blocks parsed successfully and git diff --check passed. The retained packed module also exercised SDK-owned renderer switches using:

.\.dotnet\dotnet.exe test --test-modules 'ReportExceptionDiagnostics.dll' --root-directory $moduleDirectory --no-ansi --no-progress --results-directory $results -- --no-banner --show-stdout failed --show-stderr failed

Here $moduleDirectory is the retained net11.0 consumer output directory. Five results executed (1 passed, 4 intentionally failed, 0 skipped), the expected runner exit was 2, and captured output contained no ANSI escapes. This validates the SDK switches, not a new product behavior.

The managed AGENTS.md block matches the merged upstream block; the repository pointer remains outside it. Other operating systems, release-branch/backport validation and constrained-viewport checks were not run. Local results are not a claim that CI has passed on the current head.

Test-value evidence

Contract / test case Original behavior Correct implementation
TryCaptureCore_NestedException_PreservesInnerDiagnosticTrace (failed/error/timeout/cancelled), TryCaptureCore_AggregateException_PreservesAllInnerDiagnostics, TryCaptureCore_ExplanationWithNestedException_PreservesExplanationAndTrace Historical executed proof: detected the omitted diagnostic trace. Passed on net10.0 and net472, including fresh post-merge runs.
TryCaptureCore_SimpleThrownException_PreservesOriginalStackTrace Historical executed proof: passed, as expected for preserved behavior. Passed; ordinary stack trace unchanged.
TryCapture_NestedException_KeepsDiagnosticTraceBounded Historical executed proof: detected the missing trace. Passed with the existing truncation bound/suffix.
Reports_NestedExceptions_PreserveAssociatedCausesAndExplanations Historical executed proof: detected missing trace in the actual packed CTRF result. Passed, including fresh post-merge packages; checks nested/aggregate/explained/simple/passing results and associations separately in CTRF, HTML and JUnit.
Agent guide/index and unmanaged instructions pointer, including native SDK output controls Not applicable: documentation-only change. Syntax, links and managed-block preservation checked; native renderer options exercised against the retained packed module.

Addresses #12275 with version-aware runner, output, reporting and telemetry guidance.

Co-authored-by: Copilot App <[email protected]>
Copilot AI balanced review requested due to automatic review settings November 9, 2026 12:49
@github-actions github-actions Bot added the state/needs-review Awaiting review from the team. label Nov 9, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧪 Test quality review — PR #12282

Compared merge base b3f3c980c480c5d97976d658ac367b1e246502be with head e8eef67cd9d53fce18bd42fee436d720114d55b0. Evidence applies to this head, not every intermediate commit.

Test-value evidence

All entries are static predictions; no paired execution records were available (this workflow does not run tests).

Contract Scenario / expected outcome Test and decisive assertion Counterfactual (old exception.StackTrace) Correct implementation Evidence
Nested exceptions keep inner causes in captured trace Exception with inner exception; trace contains the inner type and message TryCaptureCore_NestedException_PreservesInnerDiagnosticTrace (4 data rows), Assert.Contains("System.ArgumentException: [INNER_CAUSE]...", trace) Unthrown exception: StackTrace is null, so Assert.IsNotNull(trace) fails Pass Static prediction: killed
AggregateException branches preserved Both inner branches appear TryCaptureCore_AggregateException_PreservesAllInnerDiagnostics, two Assert.Contains Null trace, fails Pass Static prediction: killed
Explanation message plus trace The explanation stays as the message and the trace has the inner cause TryCaptureCore_ExplanationWithNestedException_PreservesExplanationAndTrace Null trace, fails Pass Static prediction: killed
Exception without inner keeps the original stack trace Trace equals exception.StackTrace TryCaptureCore_SimpleThrownException_PreservesOriginalStackTrace, Assert.AreEqual Passes before and after (behavior-preserving guard) Pass Static prediction: passes on both revisions
HTML capture truncates the longer trace Truncated at 32 KiB with a length suffix TryCapture_NestedException_KeepsDiagnosticTraceBounded, exact equality Fails: the old trace is null Pass Static prediction: killed
End-to-end CTRF/HTML/JUnit reports carry the causes Causes present in all three reports, none for the simple case Reports_NestedExceptions_PreserveAssociatedCausesAndExplanations, per-report Assert.Contains and absence checks Old behavior loses the causes, fails Pass Static prediction: killed
AGENTS.md, docs, PACKAGE.md Documentation only n/a n/a n/a Not applicable

🧵 Parallel safety

STATUS: CLEAN. No findings (Critical=0, High=0, Warning=0, Info=0).

Test assembly Scope Workers Analyzer coverage
Microsoft.Testing.Platform.Acceptance.IntegrationTests New ReportExceptionDiagnosticsTests (one method, per-test TempDirectory) Not determined; no configuration changes Manual review only
Microsoft.Testing.Extensions.UnitTests TestResultCaptureHelperTests.cs 210-318 (local objects only) Not determined; no configuration changes Manual review only

The specialist did not read the helper source for static state. Only the changed test ranges were checked.

Per-test assessment

Pseudo-mutation evidence below consists of static predictions, not executed mutation results.

Result Quality Test Notes How to improve
Pass A (90–100) new ReportExceptionDiagnosticsTests.Reports_NestedExceptions_PreserveAssociatedCausesAndExplanations Asserts identities, outcomes, messages and causes across all three report formats. None
Pass A (90–100) new TestResultCaptureHelperTests.TryCapture_NestedException_KeepsDiagnosticTraceBounded Exact equality on the truncated trace. None
Pass B (80–89) new TestResultCaptureHelperTests.TryCaptureCore_NestedException_PreservesInnerDiagnosticTrace Covers four states, with the inner cause asserted. None
Pass B (80–89) new TestResultCaptureHelperTests.TryCaptureCore_AggregateException_PreservesAllInnerDiagnostics Both aggregate branches are asserted. None
Pass B (80–89) new TestResultCaptureHelperTests.TryCaptureCore_ExplanationWithNestedException_PreservesExplanationAndTrace Explanation and inner cause both asserted. None
Pass B (80–89) new TestResultCaptureHelperTests.TryCaptureCore_SimpleThrownException_PreservesOriginalStackTrace Exact stack trace equality guards the no-inner path. None

No inline findings. The production change and tests were checked statically only.

<sub>This advisory review is heuristic and non-blocking.

Re-run the combined review with /review-tests, or only the parallel-safety specialist with /parallel-audit.</sub>

🤖 Automated content by GitHub Copilot. Generated by the Test Quality Review on PR (on open / sync) workflow. · copilot · auto · ~52 AIC · ⌖ ~1 AIC · ⊞ 8K

@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 Nov 9, 2026
@github-actions github-actions Bot added state/needs-review Awaiting review from the team. and removed state/needs-review Awaiting review from the team. labels Nov 9, 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 Nov 9, 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 Nov 9, 2026
@microsoft-github-policy-service microsoft-github-policy-service Bot added the state/needs-review Awaiting review from the team. label Nov 9, 2026
@github-actions github-actions Bot added state/approved Proposal approved; ready for implementation. and removed state/needs-review Awaiting review from the team. state/approved Proposal approved; ready for implementation. labels Nov 9, 2026
@microsoft-github-policy-service microsoft-github-policy-service Bot added the state/needs-review Awaiting review from the team. label Nov 9, 2026
@github-actions github-actions Bot added state/approved Proposal approved; ready for implementation. and removed state/needs-review Awaiting review from the team. state/approved Proposal approved; ready for implementation. labels Nov 9, 2026
@microsoft-github-policy-service microsoft-github-policy-service Bot added state/needs-review Awaiting review from the team. labels Nov 9, 2026
@github-actions github-actions Bot added state/approved Proposal approved; ready for implementation. and removed state/needs-review Awaiting review from the team. state/approved Proposal approved; ready for implementation. labels Nov 9, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The documented native MTP command forwards flags to the child that do not disable SDK-rendered ANSI output or progress, so it needs SDK-level --no-ansi --no-progress options before the separator.

1 open issue
What changed in this PR

Preserves nested exception diagnostics in MTP’s existing reports and adds version-aware guidance for agents and CI tools, without changing report schemas or public APIs.

Changes:

  • Retains nested and aggregate exception details while preserving framework explanations and ordinary stack traces.
  • Adds unit regressions and a packed-consumer test covering five distinct results across CTRF, HTML and JUnit.
  • Documents runner modes, diagnostic retrieval and telemetry limits, with discoverable guidance links.

Test-value evidence: The PR reports paired failing/passing runs for production revision d8ae1ef against original source b3f3c9, followed by documentation-only head e8eef67. Execution artifacts remain local and were not independently verified here.

File Description
test/​UnitTests/​Microsoft.Testing.Extensions.UnitTests/​TestResultCaptureHelperTests.cs Covers nested causes, aggregate branches, explanations and truncation.
test/​IntegrationTests/​Microsoft.Testing.Platform.Acceptance.IntegrationTests/​ReportExceptionDiagnosticsTests.cs Checks associated results and diagnostics across three packaged reporters.
src/​Platform/​SharedExtensionHelpers/​TestResultCaptureHelper.cs Captures full exception text when inner exceptions exist.
src/​Platform/​Microsoft.Testing.Extensions.JUnitReport/​PACKAGE.md Documents preserved failure diagnostics.
src/​Platform/​Microsoft.Testing.Extensions.HtmlReport/​PACKAGE.md Documents nested diagnostic traces.
src/​Platform/​Microsoft.Testing.Extensions.CtrfReport/​PACKAGE.md Explains trace preservation and message precedence.
docs/​README.md Adds the agent/CI guide to the index.
docs/​mtp-for-agents.md Adds runner, output, reporting and telemetry guidance.
AGENTS.md Links contribution instructions and consumer guidance outside the managed block.

Review effort: Balanced

Comment thread docs/mtp-for-agents.md Resolved
@microsoft-github-policy-service microsoft-github-policy-service Bot added the state/needs-review Awaiting review from the team. label Nov 9, 2026
@github-actions github-actions Bot added state/approved Proposal approved; ready for implementation. and removed state/needs-review Awaiting review from the team. state/approved Proposal approved; ready for implementation. labels Nov 9, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧪 Test quality review — PR #12282

Compared merge base b3f3c980c480c5d97976d658ac367b1e246502be with head 7c5d3099bbd76426a58327e38ab3d426c50a7559. Evidence applies to this head, not every intermediate commit. Since the previously reviewed head e8eef67, only docs/mtp-for-agents.md changed, so the earlier test analysis still applies.

Test-value evidence

All entries are static predictions. No paired execution records were accessible.

Contract Scenario / expected outcome Test and decisive assertion Counterfactual (old exception.StackTrace) Correct implementation Evidence
Nested exceptions keep inner causes in the captured trace Inner exception cause appears in the trace for failed, error, timeout and cancelled states TryCaptureCore_NestedException_PreservesInnerDiagnosticTrace (4 data rows), Assert.Contains on the inner cause The exception was never thrown, so StackTrace is null and Assert.IsNotNull(trace) fails Pass Static prediction: killed
AggregateException branches preserved Both branches appear in the trace TryCaptureCore_AggregateException_PreservesAllInnerDiagnostics, two Assert.Contains Null trace fails Pass Static prediction: killed
Explanation message kept, trace carries the cause Message is the explanation; trace has the inner cause TryCaptureCore_ExplanationWithNestedException_PreservesExplanationAndTrace Null trace fails Pass Static prediction: killed
Exception without an inner exception keeps its original stack trace Trace equals exception.StackTrace TryCaptureCore_SimpleThrownException_PreservesOriginalStackTrace, Assert.AreEqual Passes before and after Pass Static prediction: passes on both revisions
HTML capture bounds the longer trace Truncated at 32 KiB with a length suffix TryCapture_NestedException_KeepsDiagnosticTraceBounded, exact equality Null trace fails Pass Static prediction: killed
CTRF, HTML and JUnit reports carry causes per result Each result has its own message, type, outcome and causes; the simple case has no trace Reports_NestedExceptions_PreserveAssociatedCausesAndExplanations, per-report assertions Causes are lost, so the assertions fail Pass Static prediction: killed
AGENTS.md, docs, PACKAGE.md Documentation only n/a n/a n/a Not applicable

🧵 Parallel safety

STATUS: CLEAN, with limited coverage (Critical=0, High=0, Warning=0, Info=0). No parallelization configuration changed.

Test assembly Scope Workers Analyzer coverage
Microsoft.Testing.Platform.Acceptance.IntegrationTests New ReportExceptionDiagnosticsTests, one method with a per-test TempDirectory Not determined; no configuration changes Manual review only
Microsoft.Testing.Extensions.UnitTests TestResultCaptureHelperTests.cs 210-318, local objects only Not determined; no configuration changes Manual review only

Per-test assessment

Pseudo-mutation evidence below consists of static predictions, not executed mutation results.

Result Quality Test Notes How to improve
Pass A (90–100) new ReportExceptionDiagnosticsTests.Reports_NestedExceptions_PreserveAssociatedCausesAndExplanations Asserts identities, outcomes, messages and causes across all three reports. None
Pass A (90–100) new TestResultCaptureHelperTests.TryCapture_NestedException_KeepsDiagnosticTraceBounded Exact equality on the truncated trace. None
Pass B (80–89) new TestResultCaptureHelperTests.TryCaptureCore_NestedException_PreservesInnerDiagnosticTrace Four states, each with the inner cause asserted. None
Pass B (80–89) new TestResultCaptureHelperTests.TryCaptureCore_AggregateException_PreservesAllInnerDiagnostics Both aggregate branches asserted. None
Pass B (80–89) new TestResultCaptureHelperTests.TryCaptureCore_ExplanationWithNestedException_PreservesExplanationAndTrace Explanation and inner cause both asserted. None
Pass B (80–89) new TestResultCaptureHelperTests.TryCaptureCore_SimpleThrownException_PreservesOriginalStackTrace Exact stack trace equality guards the no-inner path. None

No inline findings. The production change and tests were checked statically only.

<sub>This advisory review is heuristic and non-blocking.

Re-run the combined review with /review-tests, or only the parallel-safety specialist with /parallel-audit.</sub>

🤖 Automated content by GitHub Copilot. Generated by the Test Quality Review on PR (on open / sync) workflow. · copilot · auto · ~33 AIC · ⌖ ~1 AIC · ⊞ 8K

@microsoft-github-policy-service microsoft-github-policy-service Bot added the state/needs-review Awaiting review from the team. label Nov 9, 2026
@github-actions github-actions Bot added state/approved Proposal approved; ready for implementation. and removed state/needs-review Awaiting review from the team. state/approved Proposal approved; ready for implementation. labels Nov 9, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain for the changes preserving nested-exception diagnostics and clarifying agent/CI guidance.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@github-actions

This comment has been minimized.

Retain the upstream JUnit graduation, opt-in and compatibility documentation together with the nested-exception diagnostic contract. Revalidated with the updated pinned SDK and aligned 3.0 packages.

Co-authored-by: Copilot App <[email protected]>
Copilot AI balanced review requested due to automatic review settings November 9, 2026 15:37
@github-actions github-actions Bot added state/approved Proposal approved; ready for implementation. and removed state/approved Proposal approved; ready for implementation. labels Nov 9, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧪 Test quality review — PR #12282

Compared merge base 19bfd517ba336e27bbeed4967fc5629e956ccc23 with head d6a5ebfb69de10299cc2a3cca0c32602c04abf38. Evidence applies to this head only.

Test-value evidence

Contract Scenario / expected Test and decisive assertion Counterfactual Evidence
Captured stack trace includes inner exceptions (ToString() when InnerException is set) Nested, aggregate and explained exceptions keep every cause text in the trace TryCaptureCore_NestedException_PreservesInnerDiagnosticTrace (4 data rows), ..._AggregateException_..., ..._ExplanationWithNestedException_...: Assert.Contains("[..._CAUSE]", trace). Acceptance test Reports_NestedExceptions_... checks the same in CTRF, HTML and JUnit. Old code used exception.StackTrace, which is null for an unthrown exception, so Assert.IsNotNull(trace) fails. Static prediction: would fail before the change and pass after. Not executed.
Exceptions without an inner exception are unchanged Thrown simple exception keeps its original StackTrace TryCaptureCore_SimpleThrownException_PreservesOriginalStackTrace: Assert.AreEqual(exception.StackTrace, ...) Always using ToString() would add the type and message and fail the equality check. Static prediction: passes before and after.
HTML capture truncates the longer trace 40k-character inner message is cut to 32 KiB plus a marker TryCapture_NestedException_KeepsDiagnosticTraceBounded: exact equality with the expected truncated string Without truncation the exact comparison fails. Static prediction.
Docs, AGENTS.md and PACKAGE.md changes Not executable None None Not applicable

No paired execution records were available, so none of the above is executed evidence.

🧵 Parallel safety

STATUS: PARTIAL. The specialist subtask was not run in this session. Manual inspection found no shared mutable state: the new acceptance test generates its own TempDirectory and asset, and the unit tests use only local data. This is not a substitute for the specialist analysis.

Per-test assessment

Pseudo-mutation evidence below consists of static predictions, not executed mutation results.

Result Quality Test Notes How to improve
Pass A (90–100) new ReportExceptionDiagnosticsTests.Reports_NestedExceptions_PreserveAssociatedCausesAndExplanations Checks per-test identity, outcome, message, type and causes in all three reports. None
Pass A (90–100) new TestResultCaptureHelperTests.TryCaptureCore_NestedException_PreservesInnerDiagnosticTrace Covers four failure states and asserts the inner cause is in the trace. None
Pass A (90–100) new TestResultCaptureHelperTests.TryCaptureCore_AggregateException_PreservesAllInnerDiagnostics Asserts both aggregate branches appear in the trace. None
Pass A (90–100) new TestResultCaptureHelperTests.TryCaptureCore_ExplanationWithNestedException_PreservesExplanationAndTrace Asserts the explanation message and the inner cause together. None
Pass A (90–100) new TestResultCaptureHelperTests.TryCaptureCore_SimpleThrownException_PreservesOriginalStackTrace Exact equality guards the unchanged no-inner path. None
Pass A (90–100) new TestResultCaptureHelperTests.TryCapture_NestedException_KeepsDiagnosticTraceBounded Exact expected truncated string including marker and length. None

No inline findings.

<sub>This advisory review is heuristic and non-blocking.

Re-run the combined review with /review-tests, or only the parallel-safety specialist with /parallel-audit.</sub>

🤖 Automated content by GitHub Copilot. Generated by the Test Quality Review on PR (on open / sync) workflow. · copilot · auto · ~29 AIC · ⌖ ~1 AIC · ⊞ 8.1K

@microsoft-github-policy-service microsoft-github-policy-service Bot added the state/needs-review Awaiting review from the team. label Nov 9, 2026
@github-actions github-actions Bot added state/approved Proposal approved; ready for implementation. and removed state/needs-review Awaiting review from the team. state/approved Proposal approved; ready for implementation. labels Nov 9, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues were identified for the nested-exception reporting and agent-guidance changes.

No open issues 🎉

Review effort: Balanced

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Final test-triage resolution — Azure Pipelines build 1671122

Result: inconclusive (evidence incomplete); no issue created.

The microsoft.testfx check failed in the Windows Debug leg, task Test (unit tests only). Four MSTest.Analyzers.UnitTests tests failed on net472:

Test Assertion
AnalyzerWaitForRunningProcess / CodeFixWaitForRunningProcess Assert.IsFalse(waiting.IsCompleted) was true (AnalyzerProcessCompatibilityTests.cs:41)
AnalyzerWaitCancellation / CodeFixWaitCancellation Expected OperationCanceledException but none was thrown (AnalyzerCompatibilityTests.cs:277)
  • The failures are stable assertions, not runner loss, crash or hang. No crash dumps were produced and there are no retry or fail-then-pass records.
  • Every failure is in the process-wait and cancellation helper tests, on one TFM and one leg. This points to a timing- or process-state-dependent defect, or to a real behavior regression in these helpers.
  • The collector could not complete historical evidence (artifact-download-failed, download-budget-exhausted), and one artifact download failed. I therefore cannot say whether these tests failed on main, and I make no claim that the tests are clean.
  • The PR title ("Preserve MTP report diagnostics and document agent usage") suggests it is unrelated to analyzer process helpers, but I could not retrieve its changed-file list. This is not confirmed.
  • No open issue matches these tests.
  • Confidence: medium that the failure is real and reproducible, low on root cause.

Next step: re-run the Windows Debug leg. If the same four tests fail again, check whether main shows the same failures, then inspect the wait/cancellation helpers around AnalyzerProcessCompatibilityTests.cs:41 and AnalyzerCompatibilityTests.cs:277. If they pass on re-run, treat the failure as a one-off timing flake. Open a flaky-test issue only if it recurs across builds.

🤖 Automated content by GitHub Copilot. Generated by the Pipeline Test Triage workflow. · copilot · auto · ~32 AIC · ⌖ ~1 AIC · ⊞ 10K

@Evangelink
Amaury Levé (Evangelink) merged commit 17ea6d5 into main Nov 9, 2026
29 of 31 checks passed
@Evangelink
Amaury Levé (Evangelink) deleted the evangelink-json-report-assessment branch November 9, 2026 18:40
@github-actions github-actions Bot removed the state/approved Proposal approved; ready for implementation. label Nov 9, 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.

Consolidate version-aware MTP guidance for agents and CI tools Preserve nested exception diagnostics in MTP JSON, HTML and JUnit reports

3 participants