Skip to content

Commit c5e41e9

Browse files
committed
fix: split unit and integration coverage
1 parent ee02df0 commit c5e41e9

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ jobs:
7878
INTEGRATION_TESTS: "1"
7979
run: |
8080
cd backend
81-
go test -v -race -tags=integration ./internal/infrastructure/database/...
81+
# Run DB + admin integration tests, serialized to avoid CI flakiness
82+
go test -v -race -tags=integration -p 1 -count=1 ./internal/infrastructure/database/... ./internal/presentation/api/admin
8283
8384
- name: Generate coverage report (unit+integration)
8485
env:
@@ -91,7 +92,16 @@ jobs:
9192
ACKIFY_OAUTH_COOKIE_SECRET: "dGVzdC1jb29raWUtc2VjcmV0LXRlc3QtY29va2llLXNlY3JldA=="
9293
run: |
9394
cd backend
94-
go test -v -race -tags=integration -coverprofile=coverage.out ./...
95+
# 1) Unit coverage (no integration tag)
96+
go test -v -race -short -covermode=atomic -coverprofile=coverage-unit.out ./...
97+
# 2) Integration coverage only for integration packages, serialized
98+
go test -v -race -tags=integration -p 1 -count=1 -covermode=atomic -coverprofile=coverage-integration.out \
99+
./internal/infrastructure/database/... \
100+
./internal/presentation/api/admin
101+
# 3) Merge coverage
102+
echo "mode: atomic" > coverage.out
103+
tail -n +2 coverage-unit.out >> coverage.out
104+
tail -n +2 coverage-integration.out >> coverage.out
95105
go tool cover -func=coverage.out | tail -1
96106
97107
- name: Upload coverage to Codecov

0 commit comments

Comments
 (0)