From 3dd404caa8657f2278357c7a523a2ce0ee029f82 Mon Sep 17 00:00:00 2001 From: bobz965 Date: Wed, 11 Sep 2024 17:25:25 +0800 Subject: [PATCH] add ginkgo ut coverage Signed-off-by: bobz965 --- .gitignore | 3 +++ Makefile | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/.gitignore b/.gitignore index 4d8aaa52649..5a68eb88a5f 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/Makefile b/Makefile index cbabd12ec4a..e5622233cf3 100644 --- a/Makefile +++ b/Makefile @@ -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