Skip to content

ci: use -test.gocoverdir and add make static - #592

Merged
mafredri merged 3 commits into
masterfrom
mafredri/ci-coverage
Oct 29, 2026
Merged

mafredri merged 3 commits into
masterfrom
mafredri/ci-coverage

Conversation

@mafredri

@mafredri mafredri commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

make static builds the GitHub Pages files (coverage report and badge) with the new ci/static.sh, and static.yml runs it instead of inline commands, so CI and a local run build the same output. The inline step ran under bash -e without pipefail, so a failing go tool cover would publish a badge without a number; ci/static.sh fails instead.

ci/test.sh collects coverage with -test.gocoverdir, which go tool covdata can merge across separate test runs, and converts it to ci/out/profile.txt.

The arm64 steps in ci/test.sh and ci/bench.sh install qemu-user instead of qemu-user-static. GitHub's ubuntu-latest runners are now Ubuntu 26.04, where qemu-user-static has no installation candidate, so the test and bench jobs failed at that step. qemu-user installs /usr/bin/qemu-aarch64 on Ubuntu 24.04 and 26.04 (checked in containers, and in this PR's CI on 26.04). A separate commit formats ci/bench.sh with shfmt (whitespace only).

AUTOBAHN=1 make test on master and on this branch ran and passed the same 853 tests and subtests, including the 299 Autobahn cases and TestWasm. Coverage was 92.3% on master and 92.5% here, over the same 1284 statements; identical runs differ by more than that (see the decision log). make static writes ci/out/static/coverage.html and coverage.svg. static.yml runs only on pushes to master and on manual dispatch, so the checks on this PR do not run it.

Refs #539

Decision log
  • Excluded coverage matches master: stringer.go is still deleted from the profile, internal/test/... is left out of -coverpkg, and master's examples filter matched nothing because internal/examples is a separate module.
  • ci/static.sh uses curl -fsSL instead of wget, from the review on ci: remove dev branch jobs from daily workflow #549. ci/test.sh uses pipefail too, because go list feeds -coverpkg through a pipe.
  • qemu-user, not qemu-user-binfmt (which apt lists as providing qemu-user-static on 26.04): the scripts run qemu-aarch64 directly, so they do not need binfmt registration.
  • Coverage difference: the 3 statements only this branch covered are conn.go:176-179 (a write ctx cancelled during the write) and frame.go:68-70 (a read error after one header byte). Without Autobahn, 8 runs of each command covered 1129 to 1149 statements, and conn.go:176-179 was covered in 2 of 8 runs of each. Most of the spread is in compression code; the tests pick compression modes at random. frame.go:68-70 was covered only in this branch's Autobahn run.

🤖 This PR was created with the help of Coder Agents.

it can merge the coverage of its separately built HTTP/2 test binary,
and added ci/static.sh to build the Pages badge from the result. Move
the parts that do not depend on HTTP/2 to master, so #539 only adds its
HTTP/2 test runs. 325114f's message lists ci/static.sh, but its diff
does not contain it.

#539 rewrote ci/test.sh to collect coverage with -test.gocoverdir, so
GitHub's ubuntu-latest runners are now Ubuntu 26.04, where
qemu-user-static is a virtual package with no installation candidate, so
the test and bench jobs fail before running TestMask and Benchmark_mask
under qemu. qemu-user installs /usr/bin/qemu-aarch64 on both 24.04 and
26.04, so the symlink is no longer needed.
@mafredri
mafredri marked this pull request as ready for review October 29, 2026 21:06
@mafredri
mafredri requested a review from code-asher October 29, 2026 21:06

@code-asher code-asher left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome looks good to me!

@mafredri
mafredri merged commit bd31a8f into master Oct 29, 2026
4 checks passed
@mafredri
mafredri deleted the mafredri/ci-coverage branch October 29, 2026 21:19
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.

2 participants