Skip to content

refactor: add Go test coverage workflow#3

Open
knecasov wants to merge 4 commits into
mainfrom
add-coverage-workflow
Open

refactor: add Go test coverage workflow#3
knecasov wants to merge 4 commits into
mainfrom
add-coverage-workflow

Conversation

@knecasov

Copy link
Copy Markdown
Owner

What

Refactor coverage workflow to use a single make test-coverage Makefile target for unit and integration test coverage measurement.

Why

This PR is related to the issue fido-device-onboard#192.

@knecasov
knecasov force-pushed the add-coverage-workflow branch 2 times, most recently from 5915037 to af8755b Compare February 28, 2026 16:32
@github-actions

github-actions Bot commented Feb 28, 2026

Copy link
Copy Markdown

go-test-coverage report

Total test coverage: 63.9% (1403/2197)

Test coverage has changed in the current files, with 311 lines missing coverage.
  file:					uncovered:	current coverage:	base coverage:
  api/handlers/vouchers.go		 74		54.9% (90/164)		38.4% (63/164)
  cmd/owner.go				 60		73.2% (164/224)		72.8% (163/224)
  internal/db/db.go			 58		80.1% (233/291)		79.7% (232/291)
  internal/db/state_vouchers.go		114		19.7% (28/142)		14.1% (20/142)
  internal/to0/to0.go			  5		84.8% (28/33)		69.7% (23/33)

@knecasov
knecasov force-pushed the add-coverage-workflow branch 2 times, most recently from 5a12dce to bc54e53 Compare March 2, 2026 11:42
mmartinv and others added 3 commits March 2, 2026 17:31
Add comprehensive license tracking for vendored Go dependencies and
update RPM spec with complete license list (0BSD, Apache-2.0, BSD-3-Clause,
MIT, Unlicense). Add Makefile target for automated RPM licensing updates.
Upgrade oapi-codegen/runtime from v1.1.2 to v1.2.0, regenerating OpenAPI
handlers with enhanced enum validation methods.

Signed-off-by: Miguel Martín <mmartinv@redhat.com>
ci: add Go test coverage workflow with baseline comparison

- add GitHub Actions workflow combining unit and integration test
  coverage with HTML report artifact
- add .testcoverage.yml with initial zero thresholds and generated
  file exclusion
- update utils.sh to support coverage-instrumented server build
  when GOCOVERDIR is set
- add coverage output files to .gitignore
- enable coverage comparison against main branch baseline

Signed-off-by: Klara Necasova <knecasov@redhat.com>
- find PR number via GitHub API with event context fallback
- post coverage report as PR comment
- defer workflow failure until after PR comment and artifacts are posted

Signed-off-by: Klara Necasova <knecasov@redhat.com>
@knecasov
knecasov force-pushed the add-coverage-workflow branch 5 times, most recently from 7e80176 to 656c596 Compare March 5, 2026 11:08
- add test-coverage target combining unit tests, integration
  tests, coverage merge, and HTML report generation
- add GOFLAGS, COVERDIR, and GOCOVERDIR variables with
  configurable defaults
- simplify coverage.yml workflow to call `make test-coverage`
- remove GOCOVERDIR prefix from run_go_fdo_server()
- simplify install_server() to always use `make build`
- consolidate all coverage output under test/coverage/

Signed-off-by: Klara Necasova <knecasov@redhat.com>
@knecasov
knecasov force-pushed the add-coverage-workflow branch from 656c596 to 70e0e8e Compare March 5, 2026 11:39
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