Skip to content

feat(reports): --report-md and an automatic GitHub step summary - #1043

Merged
Chemaclass merged 3 commits into
mainfrom
feat/1015-report-md
Aug 10, 2026
Merged

feat(reports): --report-md and an automatic GitHub step summary#1043
Chemaclass merged 3 commits into
mainfrom
feat/1015-report-md

Conversation

@Chemaclass

@Chemaclass Chemaclass commented Aug 10, 2026

Copy link
Copy Markdown
Member

🤔 Background

Related #1015

Every existing report format targets a machine, and the HTML one has to be uploaded as an artifact and downloaded to be read. Nothing targeted the page a developer looks at first: the pull request.

💡 Changes

  • --report-md <file> writes a Markdown summary: verdict, counts table, and each failure with its file:line and message. Coverage and slowest-tests sections appear only when that data exists.
  • Inside GitHub Actions there is nothing to configure: with GITHUB_STEP_SUMMARY set and no explicit path, the summary is appended to it and renders on the job page. Appended, never written, since that file belongs to the whole job.
  • Failure messages are fenced and ANSI-stripped; test names are escaped so |, *, _ or a backtick cannot break the table.
  • Only the outermost run writes the step summary, matching the annotations: the variable is inherited by every child, so a nested run would otherwise append its fixtures' results to the parent's job page.

🩹 Follow-up fix in this branch

The coverage percentage in the summary was read before the hit records were finalized, and before a --parallel run's per-worker data was aggregated, so it reported 0% for a covered run under --parallel and a lower-than-console figure sequentially. The coverage numbers are now computed before the summary is written; the console and file reports still render where they did. Covered by test_the_coverage_percentage_matches_the_console_report.

✅ Build & Verify

The earlier block on this PR is gone: the standalone size budget was raised to 544 KiB on main in #1046. The artifact built from this branch is 523306 bytes, inside the budget.

@Chemaclass Chemaclass added the enhancement New feature or request label Aug 10, 2026
@Chemaclass Chemaclass self-assigned this Aug 10, 2026
Every existing report format targets a machine, and the HTML one has to
be uploaded and downloaded to be read. Nothing targeted the page a
developer actually looks at first.

The summary carries the verdict, a counts table and each failure with its
file:line and message. Coverage and slowest-tests sections appear only
when that data exists. Failure messages go inside a fence with ANSI
stripped so they render verbatim, and test names are escaped so a name
containing a pipe, asterisk, underscore or backtick cannot break the
table.

With GITHUB_STEP_SUMMARY set and no explicit path, the summary is
appended there. Appended, never written: that file belongs to the whole
job, so truncating it would discard the other steps' output. Only the
outermost run writes it, for the same reason the annotations do -- the
variable is inherited by every child, so a nested run would append its
own fixtures' results to the parent's job page.

Generation moved ahead of print_profile_and_reset, which deletes the
profile records the summary reads, and load_spooled moved with it so a
--parallel run still reports the rows its workers spooled (#1004).

Closes #1015
GITHUB_STEP_SUMMARY is set on every GitHub Actions runner, which makes
the Markdown summary a third reason to collect rows. These tests ask
whether a file report was configured, so the ambient CI environment has
to be pinned off for the answer to mean anything.
…nsole nor parallel

The summary read the coverage percentage before the hit records were
finalized, and before a parallel run's per-worker data was aggregated, so
it reported 0% for a covered run under --parallel and a low figure
sequentially. Compute the coverage numbers before the summary is written;
the reports still render where they did.
@Chemaclass
Chemaclass force-pushed the feat/1015-report-md branch from 14d5cde to 341da2a Compare August 10, 2026 19:50
@Chemaclass
Chemaclass merged commit eab6b9a into main Aug 10, 2026
37 checks passed
@Chemaclass
Chemaclass deleted the feat/1015-report-md branch August 10, 2026 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant