Skip to content

Add failure-only GitHub step summaries - #10695

Merged
Amaury Levé (Evangelink) merged 4 commits into
mainfrom
dev/amauryleve/github-report-summaries
Aug 25, 2026
Merged

Amaury Levé (Evangelink) merged 4 commits into
mainfrom
dev/amauryleve/github-report-summaries

Conversation

@Evangelink

Copy link
Copy Markdown
Member

Summary

  • extend --report-gh-step-summary with an on-failure value
  • suppress successful GitHub job summaries in both direct and post-processed reporting
  • preserve failure-only policy through aggregate summary fragments
  • continue producing merged summary artifacts even when no GitHub step summary is written
  • treat failed and truncated runs conservatively so diagnostics remain visible

Usage

--report-gh --report-gh-step-summary on-failure

The existing on default and off behavior remain unchanged.

Fixes #10600

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 9b40ad18-2680-4d54-b965-8cf41c6df384
Copilot AI balanced review requested due to automatic review settings August 24, 2026 13:50

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 failure-only GitHub job summaries to address #10600 while preserving existing on and off behavior.

Changes:

  • Adds and documents the on-failure CLI value.
  • Propagates the policy through direct and aggregated reporting.
  • Adds unit and acceptance coverage for successful, failed, and truncated runs.
Show a summary per file
File Description
test/UnitTests/Microsoft.Testing.Extensions.UnitTests/GitHubActionsCommandLineProviderTests.cs Tests CLI validation.
test/UnitTests/Microsoft.Testing.Extensions.UnitTests/CiRunSummaryAggregationTests.cs Tests post-processing behavior.
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HelpInfoAllExtensionsTests.cs Updates help expectations.
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/GitHubActionsReportTests.cs Tests direct failure-only reporting.
src/Platform/SharedExtensionHelpers/CiRunSummaryAggregation.cs Persists the reporting policy.
src/Platform/Microsoft.Testing.Extensions.GitHubActionsReport/Resources/xlf/GitHubActionsResources.zh-Hant.xlf Updates localized resources.
src/Platform/Microsoft.Testing.Extensions.GitHubActionsReport/Resources/xlf/GitHubActionsResources.zh-Hans.xlf Updates localized resources.
src/Platform/Microsoft.Testing.Extensions.GitHubActionsReport/Resources/xlf/GitHubActionsResources.tr.xlf Updates localized resources.
src/Platform/Microsoft.Testing.Extensions.GitHubActionsReport/Resources/xlf/GitHubActionsResources.ru.xlf Updates localized resources.
src/Platform/Microsoft.Testing.Extensions.GitHubActionsReport/Resources/xlf/GitHubActionsResources.pt-BR.xlf Updates localized resources.
src/Platform/Microsoft.Testing.Extensions.GitHubActionsReport/Resources/xlf/GitHubActionsResources.pl.xlf Updates localized resources.
src/Platform/Microsoft.Testing.Extensions.GitHubActionsReport/Resources/xlf/GitHubActionsResources.ko.xlf Updates localized resources.
src/Platform/Microsoft.Testing.Extensions.GitHubActionsReport/Resources/xlf/GitHubActionsResources.ja.xlf Updates localized resources.
src/Platform/Microsoft.Testing.Extensions.GitHubActionsReport/Resources/xlf/GitHubActionsResources.it.xlf Updates localized resources.
src/Platform/Microsoft.Testing.Extensions.GitHubActionsReport/Resources/xlf/GitHubActionsResources.fr.xlf Updates localized resources.
src/Platform/Microsoft.Testing.Extensions.GitHubActionsReport/Resources/xlf/GitHubActionsResources.es.xlf Updates localized resources.
src/Platform/Microsoft.Testing.Extensions.GitHubActionsReport/Resources/xlf/GitHubActionsResources.de.xlf Updates localized resources.
src/Platform/Microsoft.Testing.Extensions.GitHubActionsReport/Resources/xlf/GitHubActionsResources.cs.xlf Updates localized resources.
src/Platform/Microsoft.Testing.Extensions.GitHubActionsReport/Resources/GitHubActionsResources.resx Adds CLI text and validation message.
src/Platform/Microsoft.Testing.Extensions.GitHubActionsReport/PACKAGE.md Documents package usage.
src/Platform/Microsoft.Testing.Extensions.GitHubActionsReport/InternalAPI/InternalAPI.Unshipped.txt Records new internal APIs.
src/Platform/Microsoft.Testing.Extensions.GitHubActionsReport/GitHubActionsSummaryReporter.cs Suppresses successful direct summaries.
src/Platform/Microsoft.Testing.Extensions.GitHubActionsReport/GitHubActionsSummaryArtifactPostProcessor.cs Applies policy during aggregation.
src/Platform/Microsoft.Testing.Extensions.GitHubActionsReport/GitHubActionsFeature.cs Detects failure-only mode.
src/Platform/Microsoft.Testing.Extensions.GitHubActionsReport/GitHubActionsCommandLineProvider.cs Validates the new value.
src/Platform/Microsoft.Testing.Extensions.GitHubActionsReport/GitHubActionsCommandLineOptions.cs Defines the new value.
docs/glossary.md Documents failure-only summaries.

Review details

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

  • Files reviewed: 27/27 changed files
  • Comments generated: 1
  • Review effort level: Balanced

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

Caution

agentic threat detected
Threat detection flagged this output in warn mode. Manual review is REQUIRED before any follow-up automation.

Details

Potential security threats were detected in the agent output.

Review the workflow run logs for details.

Note

🤖 Automated review by GitHub Copilot. Generated by the Expert Code Review workflow. To request a follow-up action, reply by tagging @copilot directly.

✅ 22/22 dimensions clean — no findings.

Generated by Expert Code Review (on PR ready) for #10695 · auto · 105.3 AIC · ⌖ 0.532 AIC · ⊞ 10.4K

@github-actions

This comment has been minimized.

@Evangelink Amaury Levé (Evangelink) added the state/needs-review Awaiting review from the team. label Aug 24, 2026
@Evangelink
Amaury Levé (Evangelink) enabled auto-merge (squash) August 24, 2026 14:37
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 9b40ad18-2680-4d54-b965-8cf41c6df384
Copilot AI review requested due to automatic review settings August 25, 2026 07:35
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

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

  • Files reviewed: 27/27 changed files
  • Comments generated: 3
  • Review effort level: Balanced

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 9b40ad18-2680-4d54-b965-8cf41c6df384
Copilot AI review requested due to automatic review settings August 25, 2026 07:59
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

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

  • Files reviewed: 28/28 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 9b40ad18-2680-4d54-b965-8cf41c6df384
Copilot AI review requested due to automatic review settings August 25, 2026 09:12
@github-actions

Copy link
Copy Markdown
Contributor

🧪 Expert test review — PR #10695

Reviewed new/modified test methods across 4 test files supporting the --report-gh-step-summary on-failure feature. The Copilot PR reviewer bot already flagged three coverage gaps (deferred-reporter fragment persistence, authoritative exit-code-only branch, on-failure exit-code-only acceptance case) in earlier rounds, and the author addressed all of them in follow-up commits (9811611, 4fcbcb2) — those fixes are reflected in the grades below.

GradeTestMutationNotesHow to improve
B (80–89) new GitHubActionsCommandLineProviderTests.
ValidateOptionArgumentsAsync_
ReturnsValid_
WhenStepSummaryValueIsOnFailureAsync
1/1 killed Confirms the new value parses as valid but not that it round-trips to the correct enum/flag. Also assert the parsed option value equals the on-failure sentinel, not just IsValid.
B (80–89) new GitHubActionsSummaryReporterTests.
SessionFinishing_
WhenDeferred_
PersistsOnFailurePolicyInFragmentAsync
3/4 killed Long integration-style unit test; verifies the fragment round-trip but only checks one aggregate field. Also assert other module fields (exit code, test counts) survive the fragment round-trip.
A (90–100) new CiRunSummaryAggregationTests.
GitHubPostProcessor_
OnFailureOnly_
WritesStepSummaryOnlyForFailureAsync
4/4 killed Data-driven case matrix cleanly covers pass/fail/zero-tests exit-code branches with a shared helper. —
A (90–100) new CiRunSummaryAggregationTests.
GitHubPostProcessor_
OnFailureOnly_
UsesModuleExitCodeWhenRunSummaryIsUnavailableAsync
2/2 killed Clearly isolates the fallback-to-module-exit-code path when run summary is missing. —
A (90–100) new CiRunSummaryAggregationTests.
GitHubPostProcessor_
OnFailureOnly_
WritesPartialSummaryForTruncatedRunAsync
2/2 killed Targeted assertion on the truncation-notice text ties directly to the truncation-reason input. —
A (90–100) new CiRunSummaryAggregationTests.
GitHubPostProcessor_
AlwaysMode_
WritesSuccessfulSummaryAsync
2/2 killed Good counterpart verifying always-write mode still emits a summary on success. —
A (90–100) mod GitHubActionsCommandLineProviderTests.
ValidateOptionArgumentsAsync_
ReturnsInvalid_
WhenStepSummaryValueIsNotSupportedAsync
2/2 killed Rename plus scope broadening correctly reflects the new set of supported values. —
A (90–100) new GitHubActionsReportTests.
WhenRunPassesAndSummaryIsOnFailure_
SummaryIsNotCreated
2/2 killed Solid acceptance-level negative case confirming summary suppression on pass. —
A (90–100) new GitHubActionsReportTests.
WhenTestFailsAndSummaryIsOnFailure_
SummaryIsCreated
2/2 killed Directly exercises the on-failure trigger with a real failing test run end to end. —
A (90–100) new GitHubActionsReportTests.
WhenZeroTestsRanAndSummaryIsOnFailure_
SummaryIsCreated
2/2 killed Covers the non-test-result failure branch (exit-code-only), closing the gap flagged in earlier review. —

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 · 66.7 AIC · ⌖ 2.73 AIC · ⊞ 16.9K · [◷]( · ◷)

@github-actions

Copy link
Copy Markdown
Contributor

🧵 Parallel-safety audit — PR #10695

Parallelization — assemblies containing the changed test files:

Test assembly Scope Workers Analyzer coverage
Microsoft.Testing.Extensions.UnitTests MethodLevel ([assembly: Parallelize(Scope = ExecutionScope.MethodLevel, Workers = 0)] in Program.cs) CPU count coverable once the parallel-safety analyzers ship (attribute-based opt-in)
Microsoft.Testing.Platform.Acceptance.IntegrationTests MethodLevel ([assembly: Parallelize(Scope = ExecutionScope.MethodLevel, Workers = 0)] in Program.cs) CPU count coverable once the parallel-safety analyzers ship (attribute-based opt-in)

(HelpInfoAllExtensionsTests.cs only has an expected-string diff — no test/lifecycle logic changed there.)

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.

I reviewed every added/modified test method and helper in the five changed test files against the category A–D taxonomy:

  • GitHubActionsReportTests.cs (3 new [TestMethod]s exercising --report-gh-step-summary on-failure): all go through the existing RunAsync helper, which spawns an out-of-process test host (TestInfrastructure.TestHost.ExecuteAsync) and passes environment variables as a per-invocation dictionary to that child process — this does not mutate the current process's environment, so it is not a category-A finding. The step-summary path is Path.Combine(TestContext.TestRunDirectory!, $"gh-step-summary-{Guid.NewGuid():N}.md") — GUID-unique per call, so no cross-test path collision (category B clean).
  • CiRunSummaryAggregationTests.cs (4 new tests + new RunGitHubPostProcessorAsync helper): each test creates its own CreateDirectory() (Path.Combine(Path.GetTempPath(), $"ci-summary-aggregation-{Guid.NewGuid():N}")) and deletes it in a finally — per-test-owned resource, no collision.
  • GitHubActionsSummaryReporterTests.cs (1 new test SessionFinishing_WhenDeferred_PersistsOnFailurePolicyInFragmentAsync): builds its own GUID-named temp directory and cleans it up in finally; all environment/config/logging dependencies are Mock<> objects, not real process-global state — no category-A/B exposure.
  • GitHubActionsCommandLineProviderTests.cs (1 renamed + 1 new test): pure ValidateOptionArgumentsAsync calls against a stateless GitHubActionsCommandLineProvider instance — no shared state touched.
  • HelpInfoAllExtensionsTests.cs: only an expected help-text string changed; no executable test logic.

No under/over-declared [ResourceLock] or [DoNotParallelize] was added or removed by this PR, and no assembly-level parallelization configuration changed.

Top actions: None — this PR introduces no parallel-safety risk under the detected MethodLevel scope.

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 · 81.8 AIC · ⌖ 4.13 AIC · ⊞ 24.8K · [◷]( · ◷)

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

  • Files reviewed: 28/28 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

@Evangelink
Amaury Levé (Evangelink) merged commit 66ec411 into main Aug 25, 2026
40 checks passed
@Evangelink
Amaury Levé (Evangelink) deleted the dev/amauryleve/github-report-summaries branch August 25, 2026 10:44
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.

GitHubActionsReport - Create job summary only on failure

3 participants