F-10: Ginkgo + 100% coverage gate (bookshelf-qqz.10) #4

Merged
zombor merged 1 commit from bd-bookshelf-qqz.10 into main 2026-05-20 17:10:39 +00:00
Owner

Summary

  • Adds Ginkgo v2 + Gomega as test dependencies and rewires make test to ginkgo --race --keep-going -r ./internal/....
  • Adds scripts/check-coverage.sh and a make coverage target enforcing a 100% statement-coverage gate on internal/. Exclusions documented at the top of the script: internal/db/sqlc/** (sqlc-generated), *_mock.go (generated mocks), and doc.go (no executable code).
  • Adds a tiny internal/version package with one ginkgo spec to prove the gate detects coverage correctly end-to-end. The gate was also manually verified by inserting an untested helper (made it fail with file/line output) and then removing it.

Test plan

  • go vet ./... passes
  • make test runs all ginkgo suites under internal/... with race detector
  • make coverage passes (100.0% >= 100.00%) on the current repo
  • Gate fails non-zero with uncovered-line output when an untested function is added (manually verified pre-commit)
  • doc.go-only packages do NOT cause the gate to fail (no statements emitted)

Closes bead bookshelf-qqz.10 on merge.

## Summary - Adds Ginkgo v2 + Gomega as test dependencies and rewires `make test` to `ginkgo --race --keep-going -r ./internal/...`. - Adds `scripts/check-coverage.sh` and a `make coverage` target enforcing a 100% statement-coverage gate on `internal/`. Exclusions documented at the top of the script: `internal/db/sqlc/**` (sqlc-generated), `*_mock.go` (generated mocks), and `doc.go` (no executable code). - Adds a tiny `internal/version` package with one ginkgo spec to prove the gate detects coverage correctly end-to-end. The gate was also manually verified by inserting an untested helper (made it fail with file/line output) and then removing it. ## Test plan - [x] `go vet ./...` passes - [x] `make test` runs all ginkgo suites under `internal/...` with race detector - [x] `make coverage` passes (100.0% >= 100.00%) on the current repo - [x] Gate fails non-zero with uncovered-line output when an untested function is added (manually verified pre-commit) - [x] doc.go-only packages do NOT cause the gate to fail (no statements emitted) Closes bead bookshelf-qqz.10 on merge.
- Wire Ginkgo v2 + Gomega into go.mod and switch `make test` to
  `ginkgo --race --keep-going -r ./internal/...`.
- Add scripts/check-coverage.sh enforcing 100% coverage on internal/,
  excluding internal/db/sqlc/**, *_mock.go, and doc.go files. The script
  generates a profile via -coverpkg=./internal/..., filters excluded
  paths, computes total via `go tool cover -func`, and prints uncovered
  file:line ranges on failure.
- Add `make coverage` target invoking the script.
- Add internal/version package with a single executable function and a
  ginkgo spec exercising it 100% to prove the gate works end-to-end.
- .gitignore the filtered coverage profile.

BEAD_ID: bookshelf-qqz.10
zombor force-pushed bd-bookshelf-qqz.10 from 0e93e33647 to cb61c11cb8 2026-05-20 17:10:23 +00:00 Compare
zombor merged commit c21aa2b092 into main 2026-05-20 17:10:39 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
zombor/pergamum!4
No description provided.