Skip to content

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

Description

@Evangelink

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions