build(ci): add coverage ratchet gate with per-package floors

Add automated coverage floor validation:
- scripts/check_coverage.go: parses coverage.out, compares to per-package
  thresholds, supports --update to lock current floors
- scripts/coverage_thresholds.json: 61 packages, initial floors from Phase 1
- .github/workflows/ci.yaml: new 'Coverage ratchet gate' step in CI
- internal/testutil/: test utilities (context builders, TestDB, doc.go)
This commit is contained in:
viettranx committed 2026-04-11 21:22:23 +07:00
1 parent eb2419beed
commit 27c9415193
7 files changed
+463 -1

No files matched your search

+3 -1
View File
@@ -21,9 +21,11 @@ jobs:
- run: go build ./...
- run: go build -tags sqliteonly ./...
- run: go vet ./...
- run: go test -race -coverprofile=coverage.out ./...
- run: go test -race -coverpkg=./... -coverprofile=coverage.out ./...
- name: Coverage summary
run: go tool cover -func=coverage.out | tail -1
- name: Coverage ratchet gate
run: go run scripts/check_coverage.go -coverprofile=coverage.out
web:
runs-on: ubuntu-latest