Skip to content

Surface coverage percentages in the CI job output and titles - #206

Merged
sarroutbi merged 1 commit into
keylime-webtool:mainfrom
sarroutbi:surface-coverage-in-ci-output
Dec 2, 2026
Merged

sarroutbi merged 1 commit into
keylime-webtool:mainfrom
sarroutbi:surface-coverage-in-ci-output

Conversation

@sarroutbi

Copy link
Copy Markdown
Contributor

The Report coverage step appended its markdown table only to $GITHUB_STEP_SUMMARY, so the step produced no output in the job log and the percentages were only visible on the run's Summary page (or buried in the raw vitest output of the test step). From the job view it looked like coverage ran but was never reported.

Print the coverage table to stdout so it lands in the job log, and emit a ::notice annotation with the headline percentages so they show up in the job's Annotations section without expanding any steps. The step summary table is preserved, now written from node instead of a shell redirect so the notice command does not leak into the summary file.

When coverage/coverage-summary.json is missing (test step failed early), emit a ::warning and exit 0 so the test step remains the single point of failure instead of adding a confusing second red step.

Also surface the headline lines coverage percentage without opening any logs: the Report coverage step exports lines-pct through $GITHUB_OUTPUT, a follow-up step is titled with the value, and a tiny lines-coverage job titled via needs.test.outputs shows it in the jobs sidebar and PR checks list. A job cannot read its own steps' outputs, so the value must flow into a downstream job. Both dynamic names fall back to 'n/a' when no coverage summary was produced, and the follow-up job runs with if: always() so the percentage is reported even when the test job fails.

Resolves: #204

The Report coverage step appended its markdown table only to
$GITHUB_STEP_SUMMARY, so the step produced no output in the job log
and the percentages were only visible on the run's Summary page (or
buried in the raw vitest output of the test step). From the job view
it looked like coverage ran but was never reported.

Print the coverage table to stdout so it lands in the job log, and
emit a ::notice annotation with the headline percentages so they show
up in the job's Annotations section without expanding any steps. The
step summary table is preserved, now written from node instead of a
shell redirect so the notice command does not leak into the summary
file.

When coverage/coverage-summary.json is missing (test step failed
early), emit a ::warning and exit 0 so the test step remains the
single point of failure instead of adding a confusing second red
step.

Also surface the headline lines coverage percentage without opening
any logs: the Report coverage step exports lines-pct through
$GITHUB_OUTPUT, a follow-up step is titled with the value, and a tiny
lines-coverage job titled via needs.test.outputs shows it in the jobs
sidebar and PR checks list. A job cannot read its own steps' outputs,
so the value must flow into a downstream job. Both dynamic names fall
back to 'n/a' when no coverage summary was produced, and the
follow-up job runs with if: always() so the percentage is reported
even when the test job fails.

Resolves: keylime-webtool#204

Signed-off-by: Sergio Arroutbi <sarroutb@redhat.com>
@sarroutbi
sarroutbi merged commit 7423fb9 into keylime-webtool:main Dec 2, 2026
7 checks passed
@sarroutbi
sarroutbi deleted the surface-coverage-in-ci-output branch December 2, 2026 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Surface coverage percentages in the CI job output and titles

1 participant