Skip to content

Commit eb8e911

Browse files
fix: split coverprofile per test path to avoid File exists warnings
1 parent 529a41c commit eb8e911

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,13 @@ jobs:
5151
- name: Run unit tests with coverage
5252
run: |
5353
mkdir -p test-results
54-
go test -v -race -coverprofile=test-results/coverage.out -covermode=atomic -coverpkg=./internal/...,./pkg/...,./cmd/... -timeout=5m ./tests/unit/... ./internal/... ./pkg/...
54+
# Run each test path separately to avoid coverprofile "File exists" conflicts
55+
go test -v -race -coverprofile=test-results/unit.out -covermode=atomic -coverpkg=./internal/...,./pkg/...,./cmd/... -timeout=5m ./tests/unit/...
56+
go test -v -race -coverprofile=test-results/internal.out -covermode=atomic -coverpkg=./internal/...,./pkg/...,./cmd/... -timeout=5m ./internal/...
57+
go test -v -race -coverprofile=test-results/pkg.out -covermode=atomic -coverpkg=./internal/...,./pkg/...,./cmd/... -timeout=5m ./pkg/...
58+
# Merge coverage profiles
59+
head -1 test-results/unit.out > test-results/coverage.out
60+
tail -n +2 -q test-results/unit.out test-results/internal.out test-results/pkg.out >> test-results/coverage.out
5561
echo "✅ Unit tests completed"
5662
5763
- name: Check test coverage

0 commit comments

Comments
 (0)