Skip to content

Extend AzureDevOpsReport extension: log groups, failure annotations, raw-log progress mirror #9141

Closed

Description

Summary

Extend the existing Microsoft.Testing.Extensions.AzureDevOpsReport package to participate in the new IProgressEnricher surface (introduced by #9139) so AzDO CI users get a much richer raw-log + UI experience:

  1. Per-assembly log groups — wrap each test assembly in ##[group] / ##[endgroup] so the AzDO log view collapses them by default.
  2. Failure annotations — emit ##vso[task.issue type=error;sourcepath=…;linenumber=…] so failures appear in the AzDO Issues tab and the Files-changed gutter.
  3. Raw-log progress mirror — alongside each existing ##vso[task.logdetail …] command, emit a single plain-text line so the raw log file (downloaded ZIP, log-search tools, anywhere outside the AzDO UI) is also useful:
    [tests 37%] MSTest.UnitTests (net9.0): 312/845 completed (0 failed)

Motivation

Proposed behaviour

Log groups

On IProgressEnricher.OnAssemblyStart(asm):

##[group]Tests: {asm.Name} ({asm.TargetFramework})

On IProgressEnricher.OnAssemblyEnd(asm):

##[endgroup]

When --report-azdo-failures-expanded is set (default true), groups that contain at least one failure are auto-expanded by emitting ##[warning] markers (AzDO heuristic).

Failure annotations

On IProgressEnricher.OnFailure(testResult):

##vso[task.issue type=error;sourcepath={file};linenumber={line};columnnumber={col}]Test failed: {fqn} — {firstLineOfMessage}

Multiple failures emit multiple task.issue records; AzDO de-duplicates by file+line.

Raw-log mirror

Inside the existing AzureDevOpsProgressReporter (AzureDevOpsProgressReporter.cs:108-110, 195-198, 226-229), emit a plain-text companion line right after each ##vso[task.logdetail] command, gated by --report-azdo-raw-log-progress (default true).

Knobs

  • --report-azdo-groups — on/off, default on.
  • --report-azdo-failures-expanded — on/off, default on.
  • --report-azdo-raw-log-progress — on/off, default on.
  • --report-azdo-failure-annotations — on/off, default on.

All knobs auto-disable when --report-azdo-progress isn't already set, so this stays opt-in via the existing master switch.

Touchpoints

  • src/Platform/Microsoft.Testing.Extensions.AzureDevOpsReport/AzureDevOpsProgressReporter.cs — wire into new IProgressEnricher hook + add raw-log mirror.
  • src/Platform/Microsoft.Testing.Extensions.AzureDevOpsReport/AzureDevOpsReportCommandLineOptionsProvider.cs — add the four new options.
  • Resource strings + dotnet msbuild src/Platform/Microsoft.Testing.Extensions.AzureDevOpsReport/Microsoft.Testing.Extensions.AzureDevOpsReport.csproj /t:UpdateXlf.
  • Help/info acceptance test expectations (alphabetically sorted):
    • test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HelpInfoAllExtensionsTests.cs
    • test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/MSBuild.KnownExtensionRegistration.cs
  • Unit tests in test/UnitTests/Microsoft.Testing.Extensions.UnitTests/ — verify exact escape behaviour for AzDoEscaper on each new emission.

Out of scope

Related

Activity

  1. Evangelink commented on Jun 16, 2026

    @Evangelink
    MemberAuthor

    Re-scoping this after mapping the proposal against the current code (and the decision to drop the task.logdetail progress path because it doesn't render in the modern AzDO Pipelines UI). Splitting into a few focused PRs:

    1. Per-assembly log groups — #9177 (open). ##[group] / ##[endgroup] wrapping per test assembly, gated on --report-azdo + TF_BUILD. These format commands do render in the modern UI.

    2. Failure annotations — already shipped. AzureDevOpsReporter already emits ##vso[task.logissue type=…;sourcepath=…;linenumber=…] for failed/errored/timed-out tests, with a message-only fallback. Note: the issue text proposed ##vso[task.issue …], which is not a valid AzDO command — task.logissue is the correct one, and it's what we emit. Nothing to do here unless we want an explicit on/off knob (cheap follow-up).

    3. Raw-log progress mirror — dropped. This was specified as a plain-text companion to each ##vso[task.logdetail] line, but --report-azdo-progress / AzureDevOpsProgressReporter are being removed (logdetail records aren't rendered in the modern Pipelines UI; see #9154 follow-up). The CI-friendly raw-log progress signal is better served by the terminal heartbeat work in #9125 / #9139 (#9147), not by the AzDO extension.

    Net: of the four proposed knobs, only a possible --report-azdo-groups opt-out remains relevant, and groups default-on is fine for now. Closing the loop on 2 and 3 here so the issue tracks reality.

  2. Evangelink commented on Jul 1, 2026

    @Evangelink
    MemberAuthor

    Closing this out. After the re-scope, all remaining in-scope work has shipped:

    #9141 item Status
    1. Per-assembly log groups ✅ Shipped in #9177 (AzureDevOpsLogGroupReporter, ##[group]/##[endgroup], gated on --report-azdo + TF_BUILD)
    2. Failure annotations ✅ Already implemented via ##vso[task.logissue …] in AzureDevOpsReporter (the issue''s proposed task.issue was invalid AzDO syntax)
    3. Raw-log progress mirror ❌ Dropped — depended on AzureDevOpsProgressReporter/task.logdetail, which don''t render in the modern Pipelines UI and are being removed; CI-friendly progress is covered by the terminal heartbeat work (#9125/#9139/#9147)

    The only leftover was an optional --report-azdo-groups opt-out knob; groups default-on is fine, so there''s nothing blocking. We can spin up a fresh focused issue if we ever want that knob.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions