Skip to content

Preserve assertion comparisons in CTRF 0.3 reports - #12313

Merged
Amaury Levé (Evangelink) merged 4 commits into
mainfrom
evangelink-ctrf-assertion-metadata
Nov 26, 2026
Merged

Amaury Levé (Evangelink) merged 4 commits into
mainfrom
evangelink-ctrf-assertion-metadata

Conversation

@Evangelink

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

Copy link
Copy Markdown
Member

Agent assessment

Self-reported assessment, not an independent review.

Assessed revision: b91c798be09ce6c92cdf860b08237f26e6470646

Dimension Assessment Rationale
Change confidence 8/10 ↑ Released-schema alignment has red/green unit and packed-consumer evidence.
↑ The five flagged joins now use Path.Join; Release pack and the packed-merger acceptance test passed (1/1).
↓ Cross-platform execution, downstream dashboards, and CI for this head remain unverified.

Pull request

Summary

Preserve structured expected/actual comparisons in CTRF reports by adopting the released 0.3.0 format for the next major package version.

  • Capture the authoritative MTP assertion property, with string-only legacy fallback; preserve missing versus empty values and bound comparison text.
  • Persist comparisons through crash recovery and keep them on their owning final/retry attempt.
  • Preserve foreign assertion collections when merging and promote compatible older reports to 0.3.0 without changing existing 0.2.0 merge identities.
  • Preserve released 0.3 run errors and retry-attempt thread IDs; reject malformed 0.3 error arrays rather than silently dropping infrastructure errors.
  • Keep multiple-comparison suppression unchanged; no new public API or CLI option.

Relates to ctrf-io/ctrf#67. Upstream v0.3.0 is tagged at 6cafa1ebdf4d5286f6e208124d313269aa357411; GitHub does not have a separate Release entry for the tag. This does not change the stable 2.x format contract.

Design and decision record

Research, compatibility decisions, exact commands, requirement mapping and paired evidence.

The next-major boundary permits a default-format change without another opt-in. The released schema also adds optional root provenance, run-level errors and retry-attempt thread IDs beyond the reviewed draft. The merger preserves the latter two; it does not invent standardized provenance.

Demonstration

A packed MSTest FailingTest report includes:

{
  "name": "FailingTest",
  "status": "failed",
  "assertionFailures": [{ "expected": "1", "actual": "2" }]
}

The separately packed behavior-removal comparison omits the array. Both retain enclosing failure diagnostics. A passing final retry has no assertion array; its earlier failed attempt retains the comparison.

This is a nonvisual JSON interchange change, so the transcript is more useful than screenshots. Dashboard rendering/downstream adoption was not validated. Shipping consumers used CTRF/MTP/Retry 3.0.0-dev and MSTest 5.0.0-dev; package and DLL provenance is recorded in the decision record.

Validation and regression proof

Rebased validation (2026-11-26): tested code df4a665a5f9d5054a208e939f19eab8dd839f1e8 on base 88543d4bc3d066319ab059a2f99c39e6a59bbf72; the assessed head adds only the decision-record evidence. Windows used repo-pinned SDK 12.0.100-alpha.1.26570.125, Release, net12.0 outer acceptance hosts and packed Release net11.0/net462 consumers where selected.

Review follow-up (b91c798be09ce6c92cdf860b08237f26e6470646): replaced the five Path.Combine calls flagged in CtrfReportTests.cs with Path.Join. The full Release build/pack succeeded with zero warnings/errors; discovery selected the targeted test and the packed-merger acceptance case passed 1/1, exit 0, no skips. TRX: artifacts\TestResults\Release\review-comments-a8549fd8bb554ffd83a893493eca7c4f\review-comments.trx (local workspace artifact).

The full pack passed, exit 0:

.\eng\build.ps1 -restore -build -pack -c Release -msbuildEngine vs -verbosity quiet '/p:EnableCodeCoverage=false' '/p:FastAcceptanceTest=true' '/warnnotaserror:NU1510' '/bl:{}'

After packing, the following commands executed the selected tests; unit, broad and focused are fresh task-owned results directories. The decision record contains the setup, cache provenance, discovery commands and results.

$unitFilter = 'FullyQualifiedName~Ctrf&FullyQualifiedName!~MergeToFileAsync_WhenOutputDiffersByCaseOnly_IsAllowedOnCaseSensitiveFilesystem'
$mtpFilter = 'FullyQualifiedName~Microsoft.Testing.Platform.Acceptance.IntegrationTests.CtrfReportTests|FullyQualifiedName~RetryFailedTestsTests.RetryFailedTests_CtrfReports_UseLogicalRunIdentityAndRecordLineage'
$mstestFilter = 'FullyQualifiedName~MSTest.Acceptance.IntegrationTests.CtrfReportTests|FullyQualifiedName~MSTest.Acceptance.IntegrationTests.CtrfReportRetryAttributeTests'
$sdkFilter = 'FullyQualifiedName~CtrfReport_UsesPlatformVersion_WhenOptedIn'

.\.dotnet\dotnet.exe exec artifacts\bin\Microsoft.Testing.Extensions.UnitTests\Release\net10.0\Microsoft.Testing.Extensions.UnitTests.dll --filter $unitFilter --report-trx --report-trx-filename broad.trx --results-directory $unitResults
.\.dotnet\dotnet.exe exec artifacts\bin\Microsoft.Testing.Platform.Acceptance.IntegrationTests\Release\net12.0\Microsoft.Testing.Platform.Acceptance.IntegrationTests.dll --filter $mtpFilter --report-trx --report-trx-filename mtp.trx --results-directory $broadResults
.\.dotnet\dotnet.exe exec artifacts\bin\MSTest.Acceptance.IntegrationTests\Release\net12.0\MSTest.Acceptance.IntegrationTests.dll --filter $mstestFilter --report-trx --report-trx-filename mstest.trx --results-directory $broadResults
.\.dotnet\dotnet.exe exec artifacts\bin\MSTest.Acceptance.IntegrationTests\Release\net12.0\MSTest.Acceptance.IntegrationTests.dll --filter $sdkFilter --report-trx --report-trx-filename sdk.trx --results-directory $focusedResults

Respectively: 296, 27, 3 and 2 passed, all exits 0 and no skips. Discovery and fresh TRX identities were reconciled. The focused packed-merger case passed separately. The Windows-inapplicable case-sensitive-filesystem unit case was excluded. The initial no-restore pack failed because earlier single-target restores left incomplete assets/imports; the full restore and pack above succeeded.

The final Microsoft.Testing.Extensions.CtrfReport.3.0.0-dev.nupkg SHA-256 is A44E9D47DCC09A975A1B310BD7BAF37FE22C3EA3A3E09D0CEB1F76B3C1CC489A; four consumer assets files matched its package hash and four net11.0 consumer DLLs matched the packed payload. Five generated documents passed the immutable released 0.3.0 schema, SHA-256 D8765D80A8CF2E9E81611F5DB97497599F56949938255AE2BF4ACA84E234DD21. The merger-specific case uses an acceptance-only reflection entry point to load the packed DLL, not a shipping CLI; broader retry tests exercise the packaged platform path.

Requirement Evidence
Comparison values, precedence, null/empty semantics and caps TestResultCapture_ExplicitComparison_RoundTripsOnlyKnownSides, TestResultCapture_ExplicitComparison_TakesPrecedenceOverLegacyData, TestResultCapture_LegacyComparison_UsesOnlyStringValues, TestResultCapture_ComparisonLimits_PreserveBoundaryAndSurrogates; full mapping in the decision record
Recovery and attempt ownership ControllerChild_AssertionComparisonsSurviveJournalRoundTripAsync, Ctrf_WhenTestHostCrashes_RecoversCompletedResultsAndMarksReportIncomplete, CtrfReport_WithMSTestRetryAttribute_MarksRetriedTestAsFlaky, RetryFailedTests_CtrfReports_UseLogicalRunIdentityAndRecordLineage
Real MSTest comparisons and unchanged multiple-comparison suppression CtrfReport_WhenTestsArePassingAndFailing_CtrfFileIsGeneratedWithBothOutcomes on net11.0/net462
Mixed versions, foreign arrays, run errors, retry threads and identity Merge_CompatibleSpecVersions_UsesVersion03, Merge_CollapseRetryAttempts_PreservesOrderedAssertionFailuresAndNestedHistory, Merge_Version03_ReleasedProjectionDoesNotReuseDraftReportId, Ctrf_MergingLegacyAndCurrentReports_PreservesVersionAndAttemptIdentities, Ctrf_MergingReleasedVersion_PreservesRunErrorsAndAttemptThreads

Earlier feature validation (2026-11-10, pre-rebase): code/test patch E1CFF3A03467ADBA174C0B269448E7B177F5F965E221019972ACD5E43FEC73EE on baseline 32a6ed6e1511ae9b61c9ce307e22ed5594b239cc, SDK 12.0.100-alpha.1.26556.115, Debug. The original 281 net10.0 and 281 net11.0 unit cases, 278 net462 and 278 net472 unit cases, 25 packed MTP cases and three packed MSTest cases passed with no skips. Sixty-two reports passed their then-reviewed versioned schemas; 42 resolved package references and 60 consumer DLLs matched packed payloads. The linked decision record preserves the exact commands, package hashes, selections and results.

No full repository, cross-platform, NativeAOT execution or final-head CI result is claimed. Raw logs remain local; the linked record preserves source/package hashes, commands, results and failure excerpts.

Test-value evidence

The release-alignment comparisons retained the same regression tests on earlier rebase d19e16fe4c1bb04919cf7aee42c26e4db5f8b5cb before the final base advance; the corrected tests were rerun on the rebased code above.

Selection Without the relevant behavior Correct implementation
Eight net10.0 run-error, retry-thread and report-ID cases Seven intended assertion failures; one legacy case passed; exit 2 Eight passed; exit 0
Four malformed-run-error cases against the intermediate merger Three expected-exception assertions failed; one legacy case passed; exit 2 Four passed; exit 0
Ctrf_MergingReleasedVersion_PreservesRunErrorsAndAttemptThreads Packed consumer ran; missing nested-thread assertion failed; exit 2 Same test passed; exit 0

A separate packed reflection harness showed malformed errors replacing an existing sentinel with the intermediate merger; the final merger rejected the input and preserved the sentinel. This is not a standard CLI exit-code claim.

The earlier feature behavior-removal comparison retained the same tests and DTO/header support while removing capture/writer/merger behavior. Both variants were independently packed and consumed. The same 281 net10.0 units produced 54 intended failures and 227 passes versus 281 passes; 25 packed MTP cases produced 12 intended failures and 13 passes versus 25 passes; and three packed MSTest cases failed on missing comparisons versus three passes. Red exits were 2 and green exits were 0. These are behavioral assertion failures, not compilation, restore, launch, zero-test or skip failures. Exact selectors, source states, failure details and patch hashes are in the linked record.

Copilot AI balanced review requested due to automatic review settings November 10, 2026 13:33
@github-actions github-actions Bot added the state/needs-review Awaiting review from the team. label Nov 10, 2026
@Evangelink
Amaury Levé (Evangelink) marked this pull request as draft November 10, 2026 13:35
auto-merge was automatically disabled November 10, 2026 13:35

Pull request was converted to draft

@github-actions github-actions Bot removed the state/needs-review Awaiting review from the team. label Nov 10, 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 #12313

Compared merge base 32a6ed6e1511ae9b61c9ce307e22ed5594b239cc with head c883bced4944a0a5ef117bfd1a3fc77c4a4088f2. Evidence applies to this head, not every intermediate commit.

Test-value evidence

Static analysis only. I did not run or build PR code. The author-reported red/green runs in the PR description are unverified here, and I found no accessible execution records that match this head.

Contract Scenario and independent expectation Test and decisive assertion Counterfactual Result
Capture and write assertionFailures for failed tests (explicit property, string-only legacy fallback, null vs empty) A failed node with AssertionFailureProperty (or exception Data) must produce assertionFailures[0] with only the known sides. TestResultCapture_ExplicitComparison_RoundTripsOnlyKnownSides (6 data rows), ..._TakesPrecedenceOverLegacyData, ..._LegacyComparison_UsesOnlyStringValues, via AssertComparison (exact field-name sequence plus values) Dropping WriteAssertionFailure or the capture mapping leaves the array missing, so IsTrue(TryGetProperty) fails. Static prediction: detected
Only failed carries comparisons Passed, skipped, errored and timedOut states with an explicit property must omit the array. TestResultCapture_NonFailedStates_OmitComparisonMetadata, AssertComparison(test, null, null) Removing the Status != "failed" guard writes the array, so IsFalse fails. Static prediction: detected
Truncation and surrogate boundaries Values over MaxMessageLength are truncated with a suffix. A surrogate pair crossing the boundary is not split. TestResultCapture_ComparisonLimits_PreserveBoundaryAndSurrogates (8 rows), exact string equality Skipping Truncate produces the full text, which fails equality. Static prediction: detected. The expected-value computation inside the test is intricate and mirrors production rules.
Retry attempts keep their own comparison Each superseded attempt keeps its own expected/actual. A final pass has no array. TestResultCapture_InProcessRetries_KeepComparisonsWithOwningAttempt, with per-attempt AssertComparison Omitting WriteAssertionFailure in WriteRetryAttempt fails the previous[n] assertions. Static prediction: detected
Merger 0.3.0 promotion, distinct report id, assertionFailures retained in the retry-collapse list A 0.3.0 input promotes older compatible inputs. The id differs from the 0.2.0 id. Merge_CompatibleSpecVersions_UsesVersion03, Merge_Version03_UsesDistinctDeterministicFormatIdentity, Merge_CollapseRetryAttempts_PreservesOrderedAssertionFailuresAndNestedHistory Reverting useVersion02 logic or the discriminator makes the version or id assertions fail. Static prediction: detected. I only skimmed the merger test bodies.
Crash-recovery journal and real packed MSTest/MTP/retry consumers Comparisons survive the journal round trip and reach the packed consumer output. ControllerChild_AssertionComparisonsSurviveJournalRoundTripAsync, the acceptance CtrfReportTests, and RetryFailedTestsTests Not statically re-derived. Unverified (the author reports executed evidence; not independently confirmed)
docs/, PACKAGE.md, InternalAPI.Unshipped.txt, spec-version constant Documentation, API tracking, or covered by the tests above — — Not applicable

Unassessed: I did not trace the acceptance tests or the merger test bodies line by line.

Existing-thread check: no prior reviews or threads were found, so there was nothing to duplicate.

🧵 Parallel safety

STATUS: CLEAN. Counts: Critical 0, High 0, Warning 0, Info 0.

Test assembly Scope Workers
MSTest.Acceptance.IntegrationTests Assembly default, plus class-level [DoNotParallelize] on CtrfReportTests (added by this PR) Not detected
Microsoft.Testing.Platform.Acceptance.IntegrationTests Assembly default. CtrfReportTests already carried [DoNotParallelize]; RetryFailedTestsTests is not serialized. Not detected
Microsoft.Testing.Extensions.UnitTests MSTest, assembly default Not detected

The new CTRF_ASSERTION_FAILURE variable is set only in a per-process environment dictionary for the child test host. The PR adds no process-wide mutation, shared static state or filesystem collision. The specialist did not verify whether the new class-level [DoNotParallelize] is necessary.

Per-test assessment

I graded the new unit tests I read in full. Acceptance and merger test methods were not individually graded; they are Uncertain for that reason, not for any defect found. Pseudo-mutation notes above are static predictions, not executed mutation results.

Result Quality Test Notes How to improve
Uncertain — mod CtrfReportMergerTests (new/changed merge methods) Bodies were only skimmed, not fully graded. Grade each method body against the merger's version and id branches.
Uncertain — mod CtrfReportGeneratorLifecycleTests.ControllerChild_AssertionComparisonsSurviveJournalRoundTripAsync Not individually read. Review the journal round-trip assertions on the null vs empty sides.
Uncertain — mod acceptance CtrfReportTests / RetryFailedTestsTests Process-level tests were not individually graded. Grade each acceptance method's assertions on the final report.
Pass A (90–100) new CtrfReportEngineTests.TestResultCapture_ExplicitComparison_RoundTripsOnlyKnownSides Exact per-side assertions cover null vs empty. None
Pass A (90–100) new CtrfReportEngineTests.TestResultCapture_ExplicitComparison_TakesPrecedenceOverLegacyData Explicit property wins over exception Data. None
Pass A (90–100) new CtrfReportEngineTests.TestResultCapture_LegacyComparison_UsesOnlyStringValues String-only fallback is checked, including non-string data. None
Pass A (90–100) new CtrfReportEngineTests.TestResultCapture_NonFailedStates_OmitComparisonMetadata Each non-failed state is checked against the omission rule. None
Pass A (90–100) new CtrfReportEngineTests.TestResultCapture_ComparisonText_PreservesEscapedMultilineValues Exact round-trip of escaped and multiline text. None
Pass B (80–89) new CtrfReportEngineTests.TestResultCapture_ComparisonLimits_PreserveBoundaryAndSurrogates Strong boundary cases, but the expected value re-derives production rules. None
Pass A (90–100) new CtrfReportEngineTests.TestResultCapture_InProcessRetries_KeepComparisonsWithOwningAttempt Per-attempt ownership is asserted for both final outcomes. None

No inline comments were published: no verified, actionable defect passed the publication gate.

<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 · ~61 AIC · ⌖ ~1 AIC · ⊞ 8.3K

@microsoft-github-policy-service microsoft-github-policy-service Bot added the state/needs-review Awaiting review from the team. label Nov 10, 2026
@github-actions github-actions Bot removed the state/needs-review Awaiting review from the team. label Nov 10, 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.

Note

🤖 Automated review by GitHub Copilot. Generated by the Expert Code Review workflow. To request a follow-up action, reply by tagging @copilot directly.

Scope: I reviewed the production changes under src/Platform/Microsoft.Testing.Extensions.CtrfReport in full, plus PACKAGE.md, the glossary and the decision record. I did not read the test diffs line by line. I did not build or run anything, so I have no executed evidence of my own. I did not work from the full PR diff file, so I diffed the checked-out PR commit against its parent.

No line-level defects found.

  • Capture: TestResultCapture takes the comparison only from failed states. An explicit AssertionFailureProperty is authoritative, and the legacy Exception.Data strings are used only when that property is absent. An empty string survives and an unavailable side is omitted. Both sides are truncated independently.

  • Writer: WriteAssertionFailure is shared by the final result and the retry-attempt writers. Both guard on Status == "failed", so a later passing result cannot inherit an earlier failure's comparison.

  • Merger:

    • assertionFailures is added to the retry-collapsing field whitelist, so nested attempts keep it.
    • The 0.3.0 promotion is independent of input order, and unreviewed versions are still rejected.
    • Existing 0.2.0 reportId discriminators are unchanged. The 0.3.0 output gets its own.
  • API: The new init accessors are on an internal type and are declared in InternalAPI.Unshipped.txt. This is not a public API change.

Non-blocking observations

  1. Unreleased upstream schema. The package now declares specVersion: 0.3.0, but ctrf-io/ctrf#87 is still an open proposal and upstream still identifies 0.2.0. The decision record and PACKAGE.md say this openly and list final upstream alignment as a release dependency. Please keep that gate tracked, ideally as a linked issue, so a changed upstream schema is not shipped as "0.3.0".
  2. Decision record. docs/decisions/ctrf-03-assertion-failures.md embeds local-only artifacts (patch SHA-256s, retained session artifacts, a borrowed-toolchain junction) that reviewers cannot reproduce. The reproduction commands and the named test cases are the useful part. Consider trimming the rest so the record stays maintainable.
  3. Evidence. The test-value evidence table is the author's own claim, not verified by this review. CI results on the PR checks are the independent confirmation.
  4. Stray deletion. .mcp.json shows as deleted in my local checkout's working tree. I assume this is an environment artifact and not part of the PR. Please confirm it is not in the PR's file list.

@microsoft-github-policy-service microsoft-github-policy-service Bot added the state/needs-review Awaiting review from the team. label Nov 10, 2026
@github-actions github-actions Bot removed the state/needs-review Awaiting review from the team. label Nov 10, 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 CTRF assertion-comparison changes.

No open issues 🎉

What changed in this PR

This PR preserves structured assertion comparisons in Microsoft.Testing.Platform’s CTRF reports by adopting the reviewed 0.3.0 draft for the next major package version. Stable 2.x semantics remain unchanged; final upstream schema alignment remains a release dependency.

Changes:

  • Capture bounded expected/actual values, preserve missing versus empty strings, and retain comparisons through crash recovery and retries.
  • Preserve foreign assertion collections during merges, promote compatible reports to 0.3.0, and retain existing 0.2.0 merge identities.
  • Add unit and package-consuming acceptance coverage, plus compatibility documentation and a decision record.

Test-value evidence: For revision c883bced4944a0a5ef117bfd1a3fc77c4a4088f2, the PR records 281 unit, 25 MTP acceptance, and 3 MSTest acceptance cases passing, with intended failures in the corresponding behavior-removal comparison. These results were not independently executed here; raw logs remain local.

Confidence at a glance

🟡 CTRF capture, serialization, recovery, and merging

The supplied changes cover comparison ownership, version handling, and regression tests. Execution evidence is documented by the author; cross-platform execution, live CI, and downstream dashboard support are not established.

File Description
test/​UnitTests/​Microsoft.Testing.Extensions.UnitTests/​CtrfReportMergerTests.cs Tests version negotiation, identities, and foreign assertion preservation.
test/​UnitTests/​Microsoft.Testing.Extensions.UnitTests/​CtrfReportGeneratorLifecycleTests.cs Tests comparison recovery through the journal.
test/​UnitTests/​Microsoft.Testing.Extensions.UnitTests/​CtrfReportEngineTests.cs Tests precedence, missing/empty values, limits, and retry ownership.
test/​IntegrationTests/​MSTest.Acceptance.IntegrationTests/​CtrfReportTests.cs Tests real MSTest comparisons, suppression, and retries; isolates shared assets.
test/​IntegrationTests/​Microsoft.Testing.Platform.Acceptance.IntegrationTests/​RetryFailedTestsTests.cs Verifies comparisons across physical attempts and consolidated retries.
test/​IntegrationTests/​Microsoft.Testing.Platform.Acceptance.IntegrationTests/​CtrfReportTests.cs Verifies packaged output, crash recovery, and mixed-version merges.
src/​Platform/​Microsoft.Testing.Extensions.CtrfReport/​TestResultCapture.cs Captures authoritative comparisons with string-only legacy fallback.
src/​Platform/​Microsoft.Testing.Extensions.CtrfReport/​PACKAGE.md Documents draft adoption, comparison semantics, and compatibility.
src/​Platform/​Microsoft.Testing.Extensions.CtrfReport/​InternalAPI/​InternalAPI.Unshipped.txt Tracks the new internal comparison properties.
src/​Platform/​Microsoft.Testing.Extensions.CtrfReport/​CtrfReportMerger.RetryCollapsing.cs Preserves assertion collections in retry projections.
src/​Platform/​Microsoft.Testing.Extensions.CtrfReport/​CtrfReportMerger.JsonHelpers.cs Adds a format-specific deterministic identity discriminator.
src/​Platform/​Microsoft.Testing.Extensions.CtrfReport/​CtrfReportMerger.cs Negotiates compatible versions and selects output identities.
src/​Platform/​Microsoft.Testing.Extensions.CtrfReport/​CtrfReportEngine.JsonTestWriter.cs Writes comparisons on their owning failed attempts.
src/​Platform/​Microsoft.Testing.Extensions.CtrfReport/​CtrfReportEngine.cs Changes generated reports to declare 0.3.0.
src/​Platform/​Microsoft.Testing.Extensions.CtrfReport/​CapturedTestResult.cs Adds expected/actual fields to captured results.
docs/​glossary.md Updates the CTRF description and major-version compatibility boundary.
docs/​decisions/​ctrf-03-assertion-failures.md Records design choices, validation evidence, and release dependencies.

Review effort: Balanced

@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown
Contributor

Final test-triage resolution — Azure Pipelines build 1672911

Result: one deterministic test failure, likely caused by this PR. High confidence. No issue created.

  • Failing leg: the "Test affected changes" step (Linux Release). Exit code 2.
  • Test: MSTest.Acceptance.IntegrationTests.SdkTests.CtrfReport_UsesPlatformVersion_WhenOptedIn, in both parameterizations (False) and (True), on net12.0. It failed on attempt 1 and again on attempt 2, so it was not a fail-then-pass flake.
  • Signature: Assert.AreEqual("0.2.0", report.RootElement.GetProperty("specVersion").GetString()) at SdkTests.cs:182. The actual value was "0.3.0".
  • Likely cause: this PR ("Preserve assertion comparisons in CTRF 0.3 reports") makes the report emit CTRF spec 0.3.0, but SdkTests.cs still expects 0.2.0. I did not find SdkTests.cs among the PR's changed files.
  • Next step: update the expectation in SdkTests.CtrfReport_UsesPlatformVersion_WhenOptedIn to 0.3.0. Confirm that the CTRF version it asserts is the intended one for the PlatformVersion opt-in. Rerun the MSTest acceptance tests after -pack.

Not actionable:

  • The Windows App Model diagnostics results contain failures (RetryFailsFirstAttempt, NativeTests.Outcome, RetryTestMethod_PassesOnSecondAppContainerHost). Their messages say they are probes that deliberately fail, such as "expected host failure" and "deliberately fails the first retry attempt". I treat them as intentional.
  • 856 tests were skipped, almost all of them Windows-only tests on Linux. 110,911 tests passed.
  • No crash or hang diagnostics were collected. The 28 slow-test candidates showed no regressions.

Evidence limits: the evidence is incomplete. One artifact download failed. History collection was also incomplete (artifact-download-failed, download-budget-exhausted) and covered 5 builds. I therefore make no claim about prior occurrences of this failure. The conclusion above rests on the current build alone.

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

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>
@Evangelink
Amaury Levé (Evangelink) force-pushed the evangelink-ctrf-assertion-metadata branch from c883bce to ebc2e40 Compare November 26, 2026 12:02
@Evangelink
Amaury Levé (Evangelink) marked this pull request as ready for review November 26, 2026 12:05
Copilot AI balanced review requested due to automatic review settings November 26, 2026 12:05
@github-actions github-actions Bot added the state/needs-review Awaiting review from the team. label Nov 26, 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.

Note

🤖 Automated review by GitHub Copilot. Generated by the Expert Code Review workflow. To request a follow-up action, reply by tagging @copilot directly.

Scope reviewed: CtrfReport source (TestResultCapture, JsonTestWriter, merger, retry collapsing, internal API file), acceptance and unit test changes, and the docs. I skipped the generated *.xlf and *.lock.yml files. I read the patches through the GitHub file listing and did not execute any PR code.

No confirmed defects. I checked these points:

  • assert.expected and assert.actual are the same Exception.Data keys that Assert.cs, the MSBuild consumer and the server-mode serializers already use. AssertionFailureProperty is applied first, as in MSBuildConsumer. That precedence is consistent.
  • Expected and Actual use init accessors, but only on an internal type. The "no init on public API" rule does not apply. InternalAPI.Unshipped.txt is updated.
  • assertionFailures is emitted only for failed status. It is also added to RetryAttemptFields, so retry history keeps it. Merged output is always promoted to 0.3.0 when any input is 0.3.0, so the field is never written into an older-schema document.
  • The new reportId discriminator for 0.3.0 is distinct from the pre-existing ones, so merged IDs from earlier versions stay stable.
  • Malformed results.errors is rejected only for 0.3.0 output. I did not see an unintended break for older inputs.
  • Truncation uses MaxMessageLength, and the Scope case (multiple failures, no single pair) is covered by the acceptance test. I found no gaps in the tests.

Residual notes (non-blocking):

  • threadId is carried into retry attempts only for 0.3.0 output. I did not find a unit test that merges a 0.2.0 input with a 0.3.0 input and checks that threadId is dropped from the older rows. If that is not already covered in CtrfReportMergerTests, it would be worth adding.
  • The change moves the default spec version to 0.3.0, which consumers of 2.x reports will see. The decision record docs/decisions/ctrf-03-assertion-failures.md presents it as a user-directed next-major change. Please make sure the PR title and description mention that it is breaking, and link the red/green test-value evidence for the exact revision.
  • I did not run or rebuild any tests in this review.

@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 26, 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 26, 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 #12313

Compared merge base 88543d4bc3d066319ab059a2f99c39e6a59bbf72 with head ebc2e4090df3f75572d8e70fd33c96ea642b5527. Evidence applies to this head, not every intermediate commit.

Test-value evidence

Static analysis only. I did not run or build PR code. The red/green runs in the PR description are author-reported. I found no accessible execution records for this exact head, so they count as unverified. The PR says the tested code was df4a665a5f9d5054a208e939f19eab8dd839f1e8, and the head adds only the decision record.

Contract Test and decisive assertion Counterfactual Result
Explicit and legacy comparison capture; null vs empty; non-string legacy data ignored TestResultCapture_ExplicitComparison_RoundTripsOnlyKnownSides (6 rows), ..._TakesPrecedenceOverLegacyData (3 rows), ..._LegacyComparison_UsesOnlyStringValues (5 rows). Each asserts the exact property names and values. Dropping capture or writing empty sides as missing fails the exact-field assertions. Static prediction: detected
Comparisons only on failed results; limits and surrogate boundaries; retry-attempt ownership ..._NonFailedStates_OmitComparisonMetadata, ..._ComparisonLimits_PreserveBoundaryAndSurrogates, ..._InProcessRetries_KeepComparisonsWithOwningAttempt Removing the status guard, truncation or attempt ownership fails the assertions. Static prediction: detected
Crash-recovery journal round trip ControllerChild_AssertionComparisonsSurviveJournalRoundTripAsync. It asserts the order, messages, exact field-name sequence and values, and keeps empty actual distinct from missing. Losing either side across journal serialization fails the property-name sequence assertions. Static prediction: detected
Merger: 0.3.0 promotion, run errors, retry thread IDs, assertion-failure preservation, identity CtrfReportMergerTests additions and the packed Ctrf_Merging* acceptance cases Not traced line by line Unverified
Packed MSTest/MTP/retry consumers Acceptance CtrfReportTests, RetryFailedTestsTests Not re-derived Unverified
Docs, PACKAGE.md, InternalAPI — — Not applicable

Unassessed: I did not trace the merger or acceptance test bodies in full, so those groups are unverified rather than clean.

Existing-thread check: earlier reviews on this PR were for head c883bced... and left no inline threads. I found nothing to duplicate.

🧵 Parallel safety

STATUS: NOT RUN. I did not run the specialist for this head, so parallel-safety coverage is partial and not an all-clear. The previous review at c883bced... reported CLEAN with no changed parallelization configuration. This PR adds class-level [DoNotParallelize] to the MSTest CtrfReportTests.

Per-test assessment

Pseudo-mutation evidence is a static prediction, not an executed mutation result.

Result Quality Test Notes Follow-up
Pass A (90–100) new CtrfReportGeneratorLifecycleTests.ControllerChild_AssertionComparisonsSurviveJournalRoundTripAsync Journal round trip asserts exact fields, order and null vs empty. None
Pass A (90–100) new CtrfReportEngineTests.TestResultCapture_ExplicitComparison_RoundTripsOnlyKnownSides Exact per-side assertions cover null and empty. None
Pass A (90–100) new CtrfReportEngineTests.TestResultCapture_ExplicitComparison_TakesPrecedenceOverLegacyData The explicit property wins over legacy data. None
Pass A (90–100) new CtrfReportEngineTests.TestResultCapture_LegacyComparison_UsesOnlyStringValues String-only fallback is checked, including non-string data. None
Pass A (90–100) new CtrfReportEngineTests.TestResultCapture_NonFailedStates_OmitComparisonMetadata Every non-failed state is checked against the omission rule. None
Pass A (90–100) new CtrfReportEngineTests.TestResultCapture_InProcessRetries_KeepComparisonsWithOwningAttempt Per-attempt ownership is asserted for both final outcomes. None
Pass B (80–89) new CtrfReportEngineTests.TestResultCapture_ComparisonLimits_PreserveBoundaryAndSurrogates Strong boundary cases, but the expected value re-derives the truncation rule. No change justified: the boundary data rows protect the contract, and a literal rewrite would add churn.
Uncertain — mod CtrfReportMergerTests (new and changed merge methods) Method bodies were not individually graded in this run. @copilot Grade each new merge test against the 0.3.0 promotion, identity and run-error branches. Settled when each test asserts a concrete version, ID or error value that fails without that branch.
Uncertain — mod acceptance CtrfReportTests, RetryFailedTestsTests Process-level methods were not individually graded in this run. @copilot Confirm that each packed test asserts final report identities, counts and per-attempt comparisons. Settled when none relies on text containment alone.

No inline comments were published: no verified, actionable defect passed the publication gate.

<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 (Claude Sonnet 5.5) · ~34 AIC · ⌖ ~2 AIC · ⊞ 8.7K

@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 26, 2026
@microsoft-github-policy-service microsoft-github-policy-service Bot added the state/needs-review Awaiting review from the team. label Nov 26, 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 block the CTRF 0.3.0 reporting and compatibility changes.

No open issues 🎉

Review effort: Balanced

@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 26, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 26, 2026 13:59
@github-actions github-actions Bot added state/approved Proposal approved; ready for implementation. and removed state/approved Proposal approved; ready for implementation. labels Nov 26, 2026
@microsoft-github-policy-service microsoft-github-policy-service Bot added state/needs-review Awaiting review from the team. labels Nov 26, 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 26, 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 #12313

Compared merge base 88543d4bc3d066319ab059a2f99c39e6a59bbf72 with head b91c798be09ce6c92cdf860b08237f26e6470646. Evidence applies to this head, not every intermediate commit.

Test-value evidence

Static analysis only. I did not build or run PR code. The author-reported red/green runs in the PR description are unverified here, and I found no accessible execution records matching this head.

Contract Scenario / decisive assertion Counterfactual Status
Explicit expected/actual comparison round-trips with null vs empty preserved TestResultCapture_ExplicitComparison_RoundTripsOnlyKnownSides (6 data rows); AssertComparison checks field names and values Dropping capture or the writer omits assertionFailures and fails the assertion Static prediction: likely detected
Explicit comparison takes precedence over legacy Data ..._TakesPrecedenceOverLegacyData Reading legacy first would surface "legacy expected" Static prediction: likely detected
Legacy fallback accepts string values only ..._LegacyComparison_UsesOnlyStringValues Stringifying non-string data would emit 1/2 Static prediction: likely detected
Non-failed states omit comparisons ..._NonFailedStates_OmitComparisonMetadata Attaching the property for every state would add the array Static prediction: likely detected
Escaping and multiline text ..._PreservesEscapedMultilineValues A lossy serializer would alter the text Static prediction: likely detected
Length bounds and surrogate boundary ..._ComparisonLimits_PreserveBoundaryAndSurrogates (8 rows) An off-by-one or a split surrogate changes the text Static prediction: likely detected
Retry attempt ownership ..._InProcessRetries_KeepComparisonsWithOwningAttempt A comparison attached to the wrong attempt changes the sequence Static prediction: likely detected
0.3.0 spec version, merger promotion, foreign array and run-error preservation, crash recovery, packed acceptance Unit and acceptance tests updated in the merger, lifecycle, MTP and MSTest acceptance files Not individually traced in this static pass Unverified
Docs, glossary, PACKAGE.md Non-executable n/a Not applicable

No surviving wrong behavior was identified, so there are no inline findings.

🧵 Parallel safety

PARALLEL-SAFETY RESULT
STATUS: PARTIAL
NOTES: The specialist task was not run in this pass, so coverage is incomplete and is not reported as clean.
END PARALLEL-SAFETY RESULT

The changed engine unit tests use per-test MemoryFileStream instances, and no parallelization configuration changed. I found no shared-state hazards in the portion I read. The acceptance-test changes were not analyzed.

Per-test assessment

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

Result Quality Test Notes Follow-up
Pass A (90–100) new CtrfReportEngineTests.TestResultCapture_ExplicitComparison_RoundTripsOnlyKnownSides The assertions cover identity, status, message, trace absence, and exact sides. None
Pass A (90–100) new CtrfReportEngineTests.TestResultCapture_ExplicitComparison_TakesPrecedenceOverLegacyData The test checks both the message and trace and the precedence of explicit values. None
Pass A (90–100) new CtrfReportEngineTests.TestResultCapture_LegacyComparison_UsesOnlyStringValues Data rows cover string, empty, non-string and absent cases. None
Pass A (90–100) new CtrfReportEngineTests.TestResultCapture_NonFailedStates_OmitComparisonMetadata All four non-failed states assert status and no comparison. None
Pass A (90–100) new CtrfReportEngineTests.TestResultCapture_ComparisonText_PreservesEscapedMultilineValues Exact string equality over quotes, backslashes, an emoji, a tab and a NUL character. None
Pass B (80–89) new CtrfReportEngineTests.TestResultCapture_ComparisonLimits_PreserveBoundaryAndSurrogates The expected values are computed with branching arithmetic, which is harder to audit. No change justified: the boundary cases are explicit and exact.
Pass A (90–100) new CtrfReportEngineTests.TestResultCapture_InProcessRetries_KeepComparisonsWithOwningAttempt It asserts summary counts, attempt order, messages and per-attempt comparisons. None
Uncertain — mod CtrfReportMergerTests.* (changed ranges) These were not graded individually in this pass. @copilot grade the changed merger, lifecycle and acceptance methods and report any surviving wrong behavior.
Uncertain — mod CtrfReportGeneratorLifecycleTests.*, CtrfReportTests.* (MTP and MSTest acceptance), RetryFailedTestsTests.*, SdkTests.* These were not graded individually in this pass. Same request as above.

<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 (Claude Sonnet 5.5) · ~37 AIC · ⌖ ~2 AIC · ⊞ 8.5K

@microsoft-github-policy-service microsoft-github-policy-service Bot added the state/needs-review Awaiting review from the team. label Nov 26, 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 26, 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 are recorded for the CTRF 0.3.0 reporting and compatibility changes.

No open issues 🎉

Review effort: Balanced

@Evangelink
Amaury Levé (Evangelink) merged commit ea3238e into main Nov 26, 2026
55 of 58 checks passed
@Evangelink
Amaury Levé (Evangelink) deleted the evangelink-ctrf-assertion-metadata branch November 26, 2026 16:00
@github-actions github-actions Bot removed the state/approved Proposal approved; ready for implementation. label Nov 26, 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.

3 participants