Skip to content

Aggregate CI test run summaries - #10530

Merged
Amaury Levé (Evangelink) merged 3 commits into
mainfrom
dev/amauryleve/aggregate-ci-run-summaries
Aug 11, 2026
Merged

Amaury Levé (Evangelink) merged 3 commits into
mainfrom
dev/amauryleve/aggregate-ci-run-summaries

Conversation

@Evangelink

Copy link
Copy Markdown
Member

Summary

  • Aggregate GitHub Actions and Azure DevOps Markdown summaries across all modules in a dotnet test invocation while retaining deterministic per-assembly details.
  • Share a typed, provenance-aware aggregation model while keeping CI-specific rendering and workflow commands in each extension.
  • Add capability-gated singleton artifact post-processing and authoritative SDK run context for total/passed/failed/skipped counts, outer duration, exit verdict, and module count.
  • Preserve existing direct per-assembly behavior with older SDKs; never present reconstructed duration or exit data as authoritative.
  • Keep Azure DevOps Tests-tab/live publishing unchanged.

The GitHub summary is atomically and idempotently upserted into GITHUB_STEP_SUMMARY. Azure DevOps emits one idempotent task.uploadsummary command. Truncated runs are explicitly marked partial, malformed fragments fail closed, and internal fragments are collapsed from the final artifact list after successful processing.

SDK integration

A coordinated additive dotnet/sdk change is required before hosts defer direct output: consume handshake properties 18/19, retain required-kind singleton groups, return RequiredPostProcessingSupported=true, and populate the manifest runSummary. Until then, current reporting behavior is preserved.

Validation

  • Microsoft.Testing.Extensions.UnitTests: 1019 total, 1013 passed, 6 skipped
  • Microsoft.Testing.Platform.UnitTests: 2150 passed
  • Microsoft.Testing.Platform.DotnetTestProtocolContract.UnitTests: 23 passed
  • .NET Framework 4.6.2 atomic upsert/long-path regressions passed
  • Dotnet-test pipe artifact post-processing acceptance test passed
  • Final repository pack succeeded with a binlog
  • Three independent review rounds completed; all findings were fixed and regression-tested

Fixes #9003

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: df54ad63-598f-4a55-806d-dd25697b1161
Copilot AI balanced review requested due to automatic review settings August 9, 2026 19:45

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.

Pull request overview

Adds capability-gated aggregation of GitHub Actions and Azure DevOps CI summaries across dotnet test modules while preserving legacy per-assembly behavior.

Changes:

  • Adds required post-processing negotiation and authoritative run-summary metadata.
  • Introduces shared, provenance-validated aggregation and CI-specific rendering.
  • Adds unit, protocol-contract, and acceptance coverage plus documentation updates.
Show a summary per file
File Description
test/UnitTests/Microsoft.Testing.Platform.UnitTests/IPC/ProtocolTests.cs Verifies new handshake IDs.
test/UnitTests/Microsoft.Testing.Platform.UnitTests/Extensions/ArtifactPostProcessing/ArtifactPostProcessingTests.cs Tests required kinds and run summaries.
test/UnitTests/Microsoft.Testing.Platform.DotnetTestProtocolContract.UnitTests/DotnetTestProtocolContractTests.cs Locks protocol constants.
test/UnitTests/Microsoft.Testing.Extensions.UnitTests/GitHubActionsSummaryReporterTests.cs Tests aggregate rendering and upsert behavior.
test/UnitTests/Microsoft.Testing.Extensions.UnitTests/CiRunSummaryAggregationTests.cs Covers aggregation and post-processors.
test/UnitTests/Microsoft.Testing.Extensions.UnitTests/AzureDevOpsSummaryReporterTests.cs Tests aggregate Azure rendering.
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/DotnetTestPipe/DotnetTestPipeProtocol.cs Adds protocol IDs to test infrastructure.
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/DotnetTestPipe/DotnetTestPipeArtifactPostProcessingTests.cs Exercises required processing and run summaries.
src/Platform/SharedExtensionHelpers/CiRunSummaryAggregation.cs Implements shared fragment aggregation.
src/Platform/Microsoft.Testing.Platform/ServerMode/DotnetTest/IPC/Constants.cs Defines new handshake properties.
src/Platform/Microsoft.Testing.Platform/ServerMode/DotnetTest/DotnetTestConnection.cs Consumes SDK capability response.
src/Platform/Microsoft.Testing.Platform/PublicAPI/PublicAPI.Unshipped.txt Tracks new public APIs.
src/Platform/Microsoft.Testing.Platform/InternalAPI/InternalAPI.Unshipped.txt Tracks new internal APIs.
src/Platform/Microsoft.Testing.Platform/Extensions/ArtifactPostProcessing/IArtifactPostProcessor.cs Adds required-processing and run-summary contracts.
src/Platform/Microsoft.Testing.Platform/Extensions/ArtifactPostProcessing/ArtifactPostProcessingManifest.cs Parses authoritative run summaries.
src/Platform/Microsoft.Testing.Platform/Extensions/ArtifactPostProcessing/ArtifactPostProcessingHandshakeProperties.cs Advertises required artifact kinds.
src/Platform/Microsoft.Testing.Extensions.GitHubActionsReport/PACKAGE.md Documents aggregate summaries.
src/Platform/Microsoft.Testing.Extensions.GitHubActionsReport/Microsoft.Testing.Extensions.GitHubActionsReport.csproj Links shared aggregation dependencies.
src/Platform/Microsoft.Testing.Extensions.GitHubActionsReport/InternalAPI/InternalAPI.Unshipped.txt Updates tracked internal surface.
src/Platform/Microsoft.Testing.Extensions.GitHubActionsReport/GitHubActionsSummaryReporter.cs Produces fragments and renders aggregates.
src/Platform/Microsoft.Testing.Extensions.GitHubActionsReport/GitHubActionsSummaryArtifactPostProcessor.cs Writes and upserts final GitHub summaries.
src/Platform/Microsoft.Testing.Extensions.GitHubActionsReport/GitHubActionsExtensions.cs Registers aggregation components.
src/Platform/Microsoft.Testing.Extensions.AzureDevOpsReport/PACKAGE.md Documents aggregate Azure summaries.
src/Platform/Microsoft.Testing.Extensions.AzureDevOpsReport/Microsoft.Testing.Extensions.AzureDevOpsReport.csproj Links shared aggregation dependencies.
src/Platform/Microsoft.Testing.Extensions.AzureDevOpsReport/InternalAPI/InternalAPI.Unshipped.txt Updates tracked internal surface.
src/Platform/Microsoft.Testing.Extensions.AzureDevOpsReport/AzureDevOpsSummaryReporter.cs Produces fragments and renders aggregates.
src/Platform/Microsoft.Testing.Extensions.AzureDevOpsReport/AzureDevOpsSummaryArtifactPostProcessor.cs Produces and uploads final Azure summaries.
src/Platform/Microsoft.Testing.Extensions.AzureDevOpsReport/AzureDevOpsExtensions.cs Registers aggregation components.
docs/RFCs/018-Artifact-Post-Processing.md Extends the artifact-processing design.
docs/mstest-runner-protocol/004-protocol-dotnet-test-pipe.md Documents handshake properties.
docs/glossary.md Describes CI summary aggregation.

Review details

Tip

Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 31/31 changed files
  • Comments generated: 5
  • Review effort level: Balanced

@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

🧪 Expert test review — PR #10530

11 new/modified test methods reviewed across 7 test files (integration test files with non-test-body-only changes and pure-deletion files were excluded).

GradeTestMutationNotesHow to improve
B (80–89) new ArtifactPostProcessingTests.
RunSummary_
OverflowingCounts_
ThrowsArgumentOutOfRangeException
1/1 killed Name implies overflow, but passedTests > totalTests is the guard actually hit; no overflow path exercised. Rename to match the guard hit, or use values that genuinely overflow the checked subtraction.
B (80–89) new CiRunSummaryAggregationTests.
ProvidersUseDistinctFragmentKinds
1/1 killed Single equality assertion on two static kind strings; minimal but correct scope. Add a case asserting each kind is non-empty/stable to guard against accidental blanking.
A (90–100) mod DotnetTestPipeArtifactPostProcessingTests.
Dispatcher_
TruncatedRunInvokesOnlySupportingProcessor
4/4 killed Asserts exact serialized run-summary string, processor kind, and absence of the merged directory for truncated runs. —
A (90–100) mod DotnetTestProtocolContractTests.
HandshakeMessagePropertyNames_
AreStable
2/2 killed New wire-protocol byte IDs asserted by both value and dictionary lookup, consistent with existing entries. —
A (90–100) mod ProtocolTests.
HandshakeMessagePropertyNames_
ValuesAreStable
2/2 killed Mirrors the contract test; new property IDs added to both the dictionary and the by-index assertions. —
A (90–100) mod ArtifactPostProcessingTests.
Manifest_
WithRunSummary_
LoadsAuthoritativeContext
7/7 killed Every run-summary field (counts, duration, exit code, module count) is deserialized and asserted individually. —
A (90–100) mod AzureDevOpsSummaryReporterTests.
BuildAggregateMarkdown_
HtmlEncodesModuleSummaryLabel
2/2 killed Asserts both the encoded output and the absence of the raw unencoded tag, closing off a false-positive escape. —
A (90–100) mod GitHubActionsSummaryReporterTests.
BuildAggregateMarkdown_
HtmlEncodesModuleSummaryLabel
2/2 killed Same encode/does-not-contain pair as the Azure DevOps counterpart; consistent contract across CI providers. —
A (90–100) new GitHubActionsSummaryReporterTests.
BuildAggregateMarkdown_
PartialFailureUsesFailureIconAndDisambiguatesAttempts
5/5 killed Verifies failure icon, per-attempt disambiguation text for both modules, and the partial-run banner together. —
A (90–100) new CiRunSummaryAggregationTests.
ReadAndAggregate_
UsesAuthoritativeSummaryAndSortsModulesAsync
6/6 killed Confirms authoritative-summary precedence, module sort order, and pass-through of duration/exit code. —
A (90–100) new CiRunSummaryAggregationTests.
ReadAndAggregate_
WithoutRunSummary_
UsesObservedCountsAsync
5/5 killed Asserts the fallback path independently recomputes totals and leaves duration/exit code null. —
Remaining 6 tests (grade A, mutation fully killed — omitted for brevity)

CiRunSummaryAggregationTests.ReadAndAggregate_MalformedFragment_ThrowsFormatException,
CiRunSummaryAggregationTests.ReadAndAggregate_DuplicateFragmentIdentity_ThrowsFormatExceptionAsync,
CiRunSummaryAggregationTests.AzureDevOpsPostProcessor_WritesAggregateAndUploadsOnceAsync,
CiRunSummaryAggregationTests.AzureDevOpsPostProcessor_IsEnabledForDispatcherRelaunchAsync,
CiRunSummaryAggregationTests.AzureDevOpsPostProcessor_ConflictingOutputPaths_UsesCanonicalOutputAsync,
CiRunSummaryAggregationTests.WriteFragmentAsync_BoundsLongFileNameAsync

— all assert exact contracts (exception type, idempotent single upload command, canonical output selection, filename length bound) with no observable weaknesses.

This advisory comment was generated automatically. Grades are heuristic
and informational — they do not block merging. Suggestions on the Files
changed tab can be applied with one click. Re-run with
/review-tests.

🤖 Automated content by GitHub Copilot. Generated by the Test Reviewer on PR (on open / sync) workflow. · auto · 210.1 AIC · ⌖ 3.65 AIC · ⊞ 16.9K · [◷]( · ◷)

@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.

🤖 Automated content by GitHub Copilot. Generated by the Test Reviewer on PR (on open / sync) workflow. · auto · 210.1 AIC · ⌖ 3.65 AIC · ⊞ 16.9K · ◷

@Evangelink Amaury Levé (Evangelink) added the state/needs-review Awaiting review from the team. label Aug 10, 2026
@Evangelink
Amaury Levé (Evangelink) enabled auto-merge (squash) August 10, 2026 09:16
Co-authored-by: Copilot App <[email protected]>

Copilot-Session: df54ad63-598f-4a55-806d-dd25697b1161
Copilot AI review requested due to automatic review settings August 10, 2026 09:23

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.

Review details

Suppressed comments (3)

src/Platform/Microsoft.Testing.Extensions.GitHubActionsReport/GitHubActionsSummaryReporter.cs:608

  • The module name is HTML-encoded in the <summary> label but emitted raw again in this nested heading. With the test value <h1>A&B</h1>, the generated report still contains a live <h1> tag and the module can alter the summary markup. Apply the existing Markdown normalization and then HTML-encode the heading text.
            .Append(EscapeInlineCode(module.AssemblyName)).Append("\n\n");

src/Platform/Microsoft.Testing.Extensions.AzureDevOpsReport/AzureDevOpsSummaryReporter.cs:503

  • The module name is encoded in the <summary> label but emitted as raw HTML in this nested heading. The added test value <h1>A&B</h1> therefore still injects a live heading into the generated Azure DevOps Markdown. Preserve the Markdown escaping and HTML-encode the value before appending it.
        builder.Append("## ").Append(EscapeCell(module.AssemblyName)).Append("\n\n");

src/Platform/SharedExtensionHelpers/CiRunSummaryAggregation.cs:296

  • The authoritative TestModuleCount is discarded here even though the PR promises SDK-provided module count. Consequently, the new test supplies testModuleCount: 12 for only two fragments yet the aggregate is marked complete, and neither renderer can report that ten module-detail sections are absent. Carry the module count into CiRunSummaryAggregate and render it and/or use it to flag incomplete module details.
  • Files reviewed: 46/46 changed files
  • Comments generated: 2
  • Review effort level: Balanced

@github-actions

Copy link
Copy Markdown
Contributor

🧵 Parallel-safety audit — PR #10530

Parallelization — assemblies touched by this PR's changed test files:

Test assembly Scope Workers Analyzer coverage
Microsoft.Testing.Extensions.UnitTests MethodLevel CPU count (Workers = 0) coverable once parallel-safety analyzers ship (attribute opt-in)
Microsoft.Testing.Platform.UnitTests MethodLevel CPU count (Workers = 0) coverable once parallel-safety analyzers ship (attribute opt-in)
Microsoft.Testing.Platform.DotnetTestProtocolContract.UnitTests MethodLevel CPU count (Workers = 0) coverable once parallel-safety analyzers ship (attribute opt-in)
Microsoft.Testing.Platform.Acceptance.IntegrationTests MethodLevel CPU count (Workers = 0) coverable once parallel-safety analyzers ship (attribute opt-in)

All four assemblies opt in via [assembly: Parallelize(Scope = ExecutionScope.MethodLevel, Workers = 0)] in their Program.cs, so every test method is its own concurrent chunk — intra-class and cross-class conflicts are both live.

Findings: A (global-state) 0 · B (paths) 0 · C (declaration) 0 · D (over-serialization) 0 — by severity: Critical 0 · High 0 · Warning 0 · Info 0.

Nothing unsafe found. Reviewed the full diff of every changed test file/region in this PR (new tests in CiRunSummaryAggregationTests.cs, and additions/renames in AzureDevOpsSummaryReporterTests.cs, GitHubActionsSummaryReporterTests.cs, DotnetTestProtocolContractTests.cs, ArtifactPostProcessingTests.cs, DotnetTestPipeArtifactPostProcessingTests.cs/DotnetTestPipeProtocol.cs):

  • No process-global state mutation (env vars, CWD, console, culture, static mutable fields) was added.
  • Every new temp path/directory is either a per-test Guid.NewGuid()-suffixed path (ci-summary-aggregation-{guid}, artifact-dispatcher-*-{guid}) or a fresh Path.GetTempFileName(), so no cross-test filesystem collisions.
  • No [ResourceLock] / [DoNotParallelize] / [Parallelize] declarations were added, removed, or modified anywhere in this PR (checked via diff for those tokens across test/), and no git diff deletion side hides a removed opt-out.
  • No [TestInitialize]/[ClassInitialize]/[AssemblyInitialize]/constructor/Dispose lifecycle members were touched.
  • The pre-existing shared static ResultsDirectory field in AzureDevOpsSummaryReporterTests.cs (used for read-only mock setup, not touched by this PR) is out of scope — context only, not introduced here.

No parallelization-state (.runsettings/testconfig.json/.csproj/Directory.Build.props) files were changed in this PR.

Advisory only — heuristic, non-blocking. Re-run with /parallel-audit. This audit answers "is it parallel-safe?"; for testability, smells, or flakiness see the detect-static-dependencies / test-smell-detection / test-anti-patterns analyses.

🤖 Automated content by GitHub Copilot. Generated by the Parallel-safety audit on PR (on open / sync) workflow. · auto · 69.7 AIC · ⌖ 3.03 AIC · ⊞ 24.8K · [◷]( · ◷)

@Evangelink
Amaury Levé (Evangelink) merged commit 4d5f2f2 into main Aug 11, 2026
103 checks passed
@Evangelink
Amaury Levé (Evangelink) deleted the dev/amauryleve/aggregate-ci-run-summaries branch August 11, 2026 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

state/needs-review Awaiting review from the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[RFC] Microsoft.Testing.Extensions.GitHubReport: publish test results to GitHub from MTP

3 participants