Skip to content

Add AzDO summary, progress and stack-frame filter options (#5951 item 4) - #8778

Merged
Amaury Levé (Evangelink) merged 2 commits into
microsoft:mainfrom
Evangelink:dev/amauryleve/azdo-summary-progress
Jun 3, 2026
Merged

Amaury Levé (Evangelink) merged 2 commits into
microsoft:mainfrom
Evangelink:dev/amauryleve/azdo-summary-progress

Conversation

@Evangelink

@Evangelink Amaury Levé (Evangelink) commented Jun 2, 2026 •

Copy link
Copy Markdown
Member

Implements item 4 of #5951 - rich AzDO build experience for --report-azdo consumers.

What

Adds three new options to the Microsoft.Testing.Extensions.AzureDevOpsReport extension. All require --report-azdo and TF_BUILD=true to take effect (a warning is emitted otherwise, mirroring the existing --report-azdo-upload gating).

1. --report-azdo-summary[=path]

  • Arity: ZeroOrOne. Default path: {testResultsDir}/azdo-summary-{tfm}.md.
  • Writes a markdown summary at the resolved absolute path.
  • Emits ##vso[task.uploadsummary]<absolutePath> so AzDO surfaces it on the build summary tab.
  • Content: totals (passed/failed/skipped/duration), slowest 10 tests, top 5 failing test classes.
  • Cell values that contain | are escaped for valid markdown table rendering.

2. --report-azdo-progress

  • Arity: Zero. Opt-in (off by default).
  • On session start, emits ##vso[task.logdetail id=<g>;name=<assembly>(<tfm>);type=Build;order=1;state=InProgress] to create a per-test-app timeline node.
  • On terminal TestNodeUpdateMessage updates (Passed/Failed/Skipped/Error/Timeout/Cancelled), increments completed/seen counters and re-emits progress=<n> only when the integer percentage changes (250ms minimum interval, monotonic, deduped by TestNode.Uid).
  • On session finish, emits state=Completed;result=Succeeded|Failed.

3. --report-azdo-stackframe-filter <regex> (repeatable)

  • Arity: OneOrMore (at least one regex required when the option is specified). Up to 16 patterns (MaxStackFrameFilterPatterns).
  • Compiled with RegexOptions.CultureInvariant | RegexOptions.Compiled and TimeSpan.FromMilliseconds(500) timeout (ReDoS guard).
  • Patterns are validated at parse time via ValidateOptionArgumentsAsync; invalid regex fails command-line validation.
  • Additive to the built-in MSTest assertion-implementation prefixes inside AzureDevOpsReporter.IsAssertionImplementationFrame - existing built-in filtering is preserved.
  • A regex that times out at match time is treated as not a match (frame is kept), not as a runtime error.

Tests

  • New unit tests:
    • AzureDevOpsSummaryReporterTests (7 tests) - markdown shape, escaping, percentage math, uploadsummary emission.
    • AzureDevOpsProgressReporterTests (8 tests) - logdetail lifecycle, monotonic progress, percentage clamping, throttling, terminal-state aggregation.
    • AzureDevOpsCommandLineProviderTests (6 new cases) - validation: requires --report-azdo, max-patterns, invalid-regex rejection.
  • All 104 Microsoft.Testing.Extensions.UnitTests AzDO tests pass.
  • Help baseline HelpInfoAllExtensionsTests updated with the 3 new options.

Notes

  • task.uploadsummary requires an absolute path - the reporter resolves it via Path.GetFullPath.
  • task.logdetail with progress is used rather than task.setprogress because setprogress only updates the parent task, not the custom timeline record.
  • Localized .xlf files were regenerated via dotnet msbuild .../UpdateXlf.

Out of scope

  • --report-azdo-summary html output is deferred until HTML logger porting #5754 ships - markdown only for now.
  • samples/xUnitPlayground/ (untracked locally, unrelated to this PR) is intentionally not included.

…#5951 item 4)

Adds three additive options to the Microsoft.Testing.Extensions.AzureDevOpsReport extension:

* --report-azdo-summary[=path] - writes a markdown summary (totals, slowest tests,
  top failing classes) and emits ##vso[task.uploadsummary] so it shows up on the
  AzDO build summary tab. Default path is {testResultsDir}/azdo-summary-{tfm}.md.

* --report-azdo-progress - emits ##vso[task.logdetail] timeline records so long
  MTP runs surface a per-assembly node in the AzDO log UI with a live progress
  percentage. Throttled to integer-percent changes and monotonic.

* --report-azdo-stackframe-filter <regex> (repeatable) - extra user-supplied
  regexes that are treated as assertion-implementation frames and skipped during
  failure reporting. Compiled once with a 500ms ReDoS-safety timeout, validated
  at parse time, and additive to the built-in MSTest prefixes.

All three require --report-azdo and TF_BUILD=true (warning emitted otherwise),
matching the existing extension's behavior.

Co-authored-by: Copilot <[email protected]>
Copilot AI review requested due to automatic review settings June 2, 2026 22: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 richer Azure DevOps (AzDO) build integration for --report-azdo consumers by introducing new reporters for job summaries and live timeline progress, plus user-configurable stack-frame filtering for call-site annotation.

Changes:

  • Add AzureDevOpsSummaryReporter to generate/upload a Markdown job summary via ##vso[task.uploadsummary].
  • Add AzureDevOpsProgressReporter to emit ##vso[task.logdetail ... progress=...] timeline updates during execution.
  • Add --report-azdo-stackframe-filter option (with validation) and wire it into AzureDevOpsReporter stack-frame skipping logic; update unit tests and help baselines accordingly.
Show a summary per file
File Description
test/UnitTests/Microsoft.Testing.Extensions.UnitTests/AzureDevOpsSummaryReporterTests.cs New unit tests covering Markdown summary shape, escaping, and uploadsummary emission gating.
test/UnitTests/Microsoft.Testing.Extensions.UnitTests/AzureDevOpsProgressReporterTests.cs New unit tests validating AzDO logdetail lifecycle, throttling, monotonic progress, and final result emission.
test/UnitTests/Microsoft.Testing.Extensions.UnitTests/AzureDevOpsCommandLineProviderTests.cs Adds validation coverage for new AzDO options (requires --report-azdo, max patterns, invalid regex).
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HelpInfoAllExtensionsTests.cs Updates help/info baselines to include the three new CLI options.
src/Platform/Microsoft.Testing.Extensions.AzureDevOpsReport/Resources/xlf/AzureDevOpsResources.*.xlf Adds localized resource entries for new options and validation/warning messages.
src/Platform/Microsoft.Testing.Extensions.AzureDevOpsReport/Resources/AzureDevOpsResources.resx Adds resource strings for new options + validation/warnings.
src/Platform/Microsoft.Testing.Extensions.AzureDevOpsReport/AzureDevOpsSummaryReporter.cs Implements summary file generation and task.uploadsummary emission.
src/Platform/Microsoft.Testing.Extensions.AzureDevOpsReport/AzureDevOpsReporter.cs Adds user-provided stack-frame filter support when selecting call-site frames.
src/Platform/Microsoft.Testing.Extensions.AzureDevOpsReport/AzureDevOpsProgressReporter.cs Implements live AzDO timeline progress emission via task.logdetail.
src/Platform/Microsoft.Testing.Extensions.AzureDevOpsReport/AzureDevOpsExtensions.cs Registers the new reporters as data consumers + session lifetime handlers.
src/Platform/Microsoft.Testing.Extensions.AzureDevOpsReport/AzureDevOpsCommandLineProvider.cs Defines new CLI options and adds validation for stack-frame filters and --report-azdo gating.
src/Platform/Microsoft.Testing.Extensions.AzureDevOpsReport/AzureDevOpsCommandLineOptions.cs Adds constants for the three new option names.

Copilot's findings

  • Files reviewed: 24/24 changed files
  • Comments generated: 3

@Evangelink
Amaury Levé (Evangelink) enabled auto-merge (squash) June 3, 2026 10:41
@Evangelink
Amaury Levé (Evangelink) merged commit 1110f2d into microsoft:main Jun 3, 2026
47 checks passed
@Evangelink
Amaury Levé (Evangelink) deleted the dev/amauryleve/azdo-summary-progress branch June 3, 2026 12:23
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