Skip to content

Commit

Permalink
add ginkgo ut coverage
Browse files Browse the repository at this point in the history
Signed-off-by: bobz965 <[email protected]>
  • Loading branch information
bobz965 committed Sep 11, 2024
1 parent 9795131 commit 3dd404c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ vpc-nat-gateway.tar
image-amd64.tar
image-amd64-dpdk.tar
image-arm64.tar
*.test
test/**/*.test
*.out
*.html
cover.out
cover.html
kube-ovn-app-sa.yaml
Expand Down
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1059,6 +1059,13 @@ cover:
go tool cover -func=cover.out | grep -v "100.0%"
go tool cover -html=cover.out -o cover.html

.PHONY: ginkgo-cover
ginkgo-cover:
if [ -f test/unittest/cover.out ]; then rm test/unittest/cover.out; fi
cd test/unittest && ginkgo -r -cover -output-dir=. -coverprofile=cover.out -covermode=atomic -coverpkg=github.com/kubeovn/kube-ovn/pkg/ipam
go tool cover -func=test/unittest/cover.out | grep -v "100.0%"
go tool cover -html=test/unittest/cover.out -o test/unittest/cover.html

.PHONY: ipam-bench
ipam-bench:
go test -timeout 30m -bench='^BenchmarkIPAM' -benchtime=10000x test/unittest/ipam_bench/ipam_test.go -args -logtostderr=false
Expand Down

0 comments on commit 3dd404c

Please sign in to comment.