You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a new Microsoft.Testing.Extensions.GitHubActionsReport extension package (sibling of the existing Microsoft.Testing.Extensions.AzureDevOpsReport) that emits GitHub Actions-native workflow commands so test runs on GitHub Actions produce a first-class experience:
Per-assembly log groups — ::group:: / ::endgroup:: so the runner UI collapses them by default.
Failure annotations — ::error file=…,line=…,title=Test failed::FQN so failures appear in the PR Files changed gutter and the workflow Annotations tab.
Job summary — write a markdown summary to \ rolling up totals, failures, slowest tests.
Hooks into the IProgressEnricher surface introduced by #9139.
Motivation
GitHub Actions is now one of the most common CI hosts for .NET projects. There is currently no first-party MTP integration.
\ is a uniquely powerful GH surface — a markdown blob that appears on the workflow run summary page. Test runners that use it provide a massively better PR review experience than those that don't.
Failure annotations on the diff gutter let reviewers jump straight to the failing assert in code review without scrolling logs.
Proposed behaviour
Log groups
On OnAssemblyStart(asm) → ::group::Tests: {asm.Name} ({asm.TargetFramework}).
On OnAssemblyEnd(asm) → ::endgroup::.
Concurrency-safe append (per GH docs) since multiple matrix legs may write concurrently — though each leg gets its own file, so this is mostly a non-issue.
Knobs
--report-gh-groups — on/off, default on.
--report-gh-annotations — on/off, default on.
--report-gh-step-summary — on/off, default on.
--report-gh-slow-test-notices — on/off, default on.
Auto-detection: extension activates iff GITHUB_ACTIONS=true; otherwise no-ops silently. Discoverable via a single master switch — TBD whether --report-gh (similar to --report-azdo-progress) or auto-on when the env is detected. Recommendation: auto-on when env detected, with each individual knob still respected.
Touchpoints
New package: src/Platform/Microsoft.Testing.Extensions.GitHubActionsReport/ (mirror the AzureDevOpsReport folder layout).
Unit tests in test/UnitTests/Microsoft.Testing.Extensions.UnitTests/ — verify escape behaviour, group emission, step-summary markdown shape.
Open questions
Auto-on (when GITHUB_ACTIONS=true) vs explicit --report-gh-* opt-in master switch. AzDO precedent is explicit opt-in via --report-azdo-progress; symmetric choice would be --report-gh master switch.
Should \ be byte-capped to GitHub's 1 MiB limit? (Yes, with truncation note.)
Should we emit ::warning:: for skipped tests or only for failures? (Probably only on opt-in.)
How to surface the file/line for failure annotations when running on Linux runners but the test assembly was built on Windows (path-separator translation).
Out of scope
Other CI hosts (GitLab, Jenkins, Buildkite, TeamCity) — each is its own package.
Uploading test result artifacts (use the existing actions/upload-artifact action + the platform's existing TRX/JUnit/HTML reports).
PR review comments (would need pull-requests: write token, separate concern).
Summary
Add a new
Microsoft.Testing.Extensions.GitHubActionsReportextension package (sibling of the existingMicrosoft.Testing.Extensions.AzureDevOpsReport) that emits GitHub Actions-native workflow commands so test runs on GitHub Actions produce a first-class experience:::group::/::endgroup::so the runner UI collapses them by default.::error file=…,line=…,title=Test failed::FQNso failures appear in the PR Files changed gutter and the workflow Annotations tab.\rolling up totals, failures, slowest tests.::notice::for tests crossing the slow-test threshold from Silence-driven progress heartbeat renderer for SimpleAnsi/NoAnsi terminal modes #9139.Hooks into the
IProgressEnrichersurface introduced by #9139.Motivation
\is a uniquely powerful GH surface — a markdown blob that appears on the workflow run summary page. Test runners that use it provide a massively better PR review experience than those that don't.Proposed behaviour
Log groups
On
OnAssemblyStart(asm)→::group::Tests: {asm.Name} ({asm.TargetFramework}).On
OnAssemblyEnd(asm)→::endgroup::.Failure annotations
On
OnFailure(testResult):::error file={file},line={line},col={col},title=Test failed: {fqn}::{firstLineOfMessage}Multiline error messages: prefer
::errorfollowed by the message body via%0AURL-escaped newlines, or fall back to a single-line snippet.Slow-test notices
On
OnSlowTestEmit(test, currentDuration):::notice file={file},line={line}::{fqn} still running after {currentDuration}sJob summary
Append a markdown block to the file pointed to by
\(per Microsoft docs):Concurrency-safe append (per GH docs) since multiple matrix legs may write concurrently — though each leg gets its own file, so this is mostly a non-issue.
Knobs
--report-gh-groups— on/off, defaulton.--report-gh-annotations— on/off, defaulton.--report-gh-step-summary— on/off, defaulton.--report-gh-slow-test-notices— on/off, defaulton.Auto-detection: extension activates iff
GITHUB_ACTIONS=true; otherwise no-ops silently. Discoverable via a single master switch — TBD whether--report-gh(similar to--report-azdo-progress) or auto-on when the env is detected. Recommendation: auto-on when env detected, with each individual knob still respected.Touchpoints
src/Platform/Microsoft.Testing.Extensions.GitHubActionsReport/(mirror theAzureDevOpsReportfolder layout).GitHubActionsReporter.cs— implementsIProgressEnricher.GitHubActionsReportCommandLineProvider.cs— the four options above.GitHubActionsEscaper.cs— escape special chars in titles/messages per GH workflow commands docs.dotnet msbuild .../GitHubActionsReport.csproj /t:UpdateXlf.test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HelpInfoAllExtensionsTests.cstest/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/MSBuild.KnownExtensionRegistration.cstest/UnitTests/Microsoft.Testing.Extensions.UnitTests/— verify escape behaviour, group emission, step-summary markdown shape.Open questions
GITHUB_ACTIONS=true) vs explicit--report-gh-*opt-in master switch. AzDO precedent is explicit opt-in via--report-azdo-progress; symmetric choice would be--report-ghmaster switch.\be byte-capped to GitHub's 1 MiB limit? (Yes, with truncation note.)::warning::for skipped tests or only for failures? (Probably only on opt-in.)Out of scope
actions/upload-artifactaction + the platform's existing TRX/JUnit/HTML reports).pull-requests: writetoken, separate concern).Related
IProgressEnricherhook (prerequisite).Microsoft.Testing.Extensions.AzureDevOpsReport— sibling extension; aim for symmetric command-line shape where it makes sense.