ci: add coverage badge generator and make targets - #345
Open
markope wants to merge 1 commit into
Open
Conversation
Replaces the dead Travis badge in README.md with a GitHub Actions CI badge and a shields.io coverage badge whose percentage is regenerated in place by `make coverage`. - `make test-coverage` runs `go test -race -coverprofile` once over the whole module and writes the total percentage to coverage.txt. The transport-matrix variants in `make test` are intentionally not re-run here since they exercise transport edge cases, not different code paths in the router/wamp/client packages we measure. - `make coverage-badge` (depends on test-coverage) reads coverage.txt, picks a shields.io-compatible color from the same thresholds shields uses for its built-in coverage badges (red/orange/yellow/yellowgreen/ brightgreen at 50/70/80/90), and rewrites the Coverage badge URL in README.md in place via cross-platform sed. shields.io renders the badge on the fly so no SVG artifact is committed. - `make coverage` is a convenience alias. CI runs `make coverage` on ubuntu-latest and warns (does not fail) if the badge in README.md drifted, so PRs with stale badges surface in the workflow logs without blocking merge. Re-running `make coverage` against the same percentage produces no diff (deterministic output).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces the dead Travis badge in README.md with a GitHub Actions CI badge and a shields.io coverage badge whose percentage is regenerated in place by
make coverage.make test-coveragerunsgo test -race -coverprofileonce over the whole module and writes the total percentage to coverage.txt. The transport-matrix variants inmake testare intentionally not re-run here since they exercise transport edge cases, not different code paths in the router/wamp/client packages we measure.make coverage-badge(depends on test-coverage) reads coverage.txt, picks a shields.io-compatible color from the same thresholds shields uses for its built-in coverage badges (red/orange/yellow/yellowgreen/ brightgreen at 50/70/80/90), and rewrites the Coverage badge URL in README.md in place via cross-platform sed. shields.io renders the badge on the fly so no SVG artifact is committed.make coverageis a convenience alias.CI runs
make coverageon ubuntu-latest and warns (does not fail) if the badge in README.md drifted, so PRs with stale badges surface in the workflow logs without blocking merge.Re-running
make coverageagainst the same percentage produces no diff (deterministic output).Description, Motivation and Context
We want to extend and harden the nexus for our usage patterns. We would like to do this in an upstream friendly way.
First on our list is to extend the testing framework to cover more tests and to provide a WAMP-spec harness.
This is a first PR with just a code coverage badge and tooling.
The goal is to just make test coverage more transparent and coverage more prominent.
What kind of change does this PR introduce?
Checklist: