From aa9bc74fc2c0e8f246688bef92c0e921155c37ae Mon Sep 17 00:00:00 2001 From: Florian Kinder Date: Fri, 30 Jan 2026 16:23:07 +0100 Subject: [PATCH] ci: exclude generated code from coverage metrics Use -coverpkg flag to measure coverage only for cmd/ and internal/ packages, excluding auto-generated protobuf and flatbuffers code in pkg/schemas/ that cannot be meaningfully tested. This gives a more accurate coverage percentage (86.4% vs 48.7%) that reflects the actual test coverage of application code. --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6f4c4a5d..2391ef7a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -33,7 +33,7 @@ jobs: cache: true - name: Run tests - run: go test -coverprofile=cover.out ./... + run: go test -coverprofile=cover.out -coverpkg=./cmd/...,./internal/... ./... - name: Build run: go build -o ocap-webserver ./cmd/ocap-webserver