Skip to content

Commit 86ad84b

Browse files
authored
ci: report unittest coverage (#4783)
Signed-off-by: zhangzujian <[email protected]>
1 parent 6ee3b36 commit 86ad84b

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

.github/workflows/build-x86-image.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,10 @@ jobs:
184184
go install -mod=mod github.com/onsi/ginkgo/v2/ginkgo
185185
make ut
186186
187+
- uses: shogo82148/actions-goveralls@v1
188+
with:
189+
path-to-profile: profile.cov
190+
187191
- name: Install golangci-lint
188192
run: |
189193
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin $GOLANGCI_LINT_VERSION

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ test/**/*.test
4444
*.html
4545
cover.out
4646
cover.html
47+
profile.cov
4748
kube-ovn-app-sa.yaml
4849
kube-ovn-cni-sa.yaml
4950
kube-ovn-sa.yaml

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1055,7 +1055,7 @@ scan:
10551055
.PHONY: ut
10561056
ut:
10571057
ginkgo -mod=mod --show-node-events --poll-progress-after=60s $(GINKGO_OUTPUT_OPT) -v test/unittest
1058-
go test ./pkg/...
1058+
go test -coverprofile=profile.cov $$(go list ./pkg/... | grep -vw '^github.com/kubeovn/kube-ovn/pkg/client')
10591059

10601060
.PHONY: ovs-sandbox
10611061
ovs-sandbox: clean-ovs-sandbox

0 commit comments

Comments
 (0)