From 0f950973bf979295f3d01b350c68e47e543d4b09 Mon Sep 17 00:00:00 2001 From: zhangzujian Date: Tue, 3 Dec 2024 02:24:09 +0000 Subject: [PATCH] ci: report unittest coverage Signed-off-by: zhangzujian --- .github/workflows/build-x86-image.yaml | 4 ++++ .gitignore | 1 + Makefile | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-x86-image.yaml b/.github/workflows/build-x86-image.yaml index beca0fabe09..b0a4b1cd79b 100644 --- a/.github/workflows/build-x86-image.yaml +++ b/.github/workflows/build-x86-image.yaml @@ -184,6 +184,10 @@ jobs: go install -mod=mod github.com/onsi/ginkgo/v2/ginkgo make ut + - uses: shogo82148/actions-goveralls@v1 + with: + path-to-profile: profile.cov + - name: Install golangci-lint run: | curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin $GOLANGCI_LINT_VERSION diff --git a/.gitignore b/.gitignore index 5a68eb88a5f..35f10bb4fb7 100644 --- a/.gitignore +++ b/.gitignore @@ -44,6 +44,7 @@ test/**/*.test *.html cover.out cover.html +profile.cov kube-ovn-app-sa.yaml kube-ovn-cni-sa.yaml kube-ovn-sa.yaml diff --git a/Makefile b/Makefile index c7b1d77784c..bee6bcd8990 100644 --- a/Makefile +++ b/Makefile @@ -1055,7 +1055,7 @@ scan: .PHONY: ut ut: ginkgo -mod=mod --show-node-events --poll-progress-after=60s $(GINKGO_OUTPUT_OPT) -v test/unittest - go test ./pkg/... + go test -coverprofile=profile.cov ./pkg/... .PHONY: ovs-sandbox ovs-sandbox: clean-ovs-sandbox