Repository navigation
Commit 970022e
authored
coverage: emit a markdown job summary from the report generator (#440)
* coverage: emit a markdown job summary from the report generator
Every consumer that wants a human-readable coverage summary on its
workflow run page has been re-parsing the LCOV itself; the report
generator now emits it directly.
- New py_binary coverage_summary (stdlib only): parses the pipeline's
LCOV (which includes the exact-0% baseline records), aggregates
line/branch/file totals, and renders markdown — overall table with
text progress bars, raw-vs-effective when a justification report
exists, a per-directory rollup (first one/two path segments, worst
first), and collapsible least-covered / exact-0% file lists, closing
with a pointer to the HTML artifact.
- generate_coverage_html: new optional --summary-md <path>; when the
flag is absent and GITHUB_STEP_SUMMARY is set (GitHub Actions), the
summary is appended there automatically; with neither, behavior is
unchanged. Emitted BEFORE the threshold gate decides the exit code,
so a failing gate still leaves the summary on the run page.
- Edge cases covered by unit tests: missing/empty LCOV (note instead of
crash), records with LF but no BRF (branch cells render as an em
dash), BRDA fallback counting, zero denominators, non-UTF8 bytes in
paths, markdown cell escaping.
- Integration workspace: asserts summary content markers, append
semantics for GITHUB_STEP_SUMMARY (existing content preserved), and
that the summary survives a failing gate. The test script unsets
GITHUB_STEP_SUMMARY first so CI runs don't spam the real run page.
- Docs: adoption guide (README) and COVERAGE_GUIDE updated.
* coverage: clarify summary test resets, import-lib pattern and bar docstring
Review follow-up for #440: comment why each summary test section deletes
summary.md before its own run (stale-file false passes; the failing-gate
section must prove re-creation), note that imports=[".."] is confined to
the *_lib unit-test import helpers, and state in the docstring that the
progress bar visualizes the coverage percentage.1 parent b7d7599 commit 970022e
9 files changed
Lines changed: 645 additions & 0 deletions
File tree
- coverage
- integration_tests
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
59 | 66 | | |
60 | 67 | | |
61 | 68 | | |
| |||
75 | 82 | | |
76 | 83 | | |
77 | 84 | | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
78 | 94 | | |
79 | 95 | | |
80 | 96 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
184 | 192 | | |
185 | 193 | | |
186 | 194 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
| |||
207 | 208 | | |
208 | 209 | | |
209 | 210 | | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
210 | 221 | | |
211 | 222 | | |
212 | 223 | | |
| |||
219 | 230 | | |
220 | 231 | | |
221 | 232 | | |
| 233 | + | |
222 | 234 | | |
223 | 235 | | |
224 | 236 | | |
| |||
0 commit comments