File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed
Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change 1111
1212# Output of the go coverage tool, specifically when used with LiteIDE
1313* .out
14+ coverage. *
1415
1516# Ansible
1617* .retry
Original file line number Diff line number Diff line change @@ -136,14 +136,21 @@ help: ## Display this help
136136.PHONY : test
137137test : generate lint go-test # # Run generate lint and tests
138138
139- go-test : export TEST_ASSET_KUBECTL = $(KUBECTL )
140- go-test : export TEST_ASSET_KUBE_APISERVER = $(KUBE_APISERVER )
141- go-test : export TEST_ASSET_ETCD = $(ETCD )
139+ envs-test :
140+ export TEST_ASSET_KUBECTL = $(KUBECTL )
141+ export TEST_ASSET_KUBE_APISERVER = $(KUBE_APISERVER )
142+ export TEST_ASSET_ETCD = $(ETCD )
142143
143144.PHONY : go-test
144- go-test : $(KUBECTL ) $(KUBE_APISERVER ) $(ETCD ) # # Run go tests
145+ go-test : envs-test $(KUBECTL ) $(KUBE_APISERVER ) $(ETCD ) # # Run go tests
146+ echo $(TEST_ASSET_KUBECTL )
145147 go test ./...
146148
149+ .PHONY : test-cover
150+ test-cover : envs-test $(KUBECTL ) $(KUBE_APISERVER ) $(ETCD ) # # Run tests with code coverage and code generate reports
151+ go test -v -coverprofile=coverage.out ./...
152+ go tool cover -func=coverage.out -o coverage.txt
153+ go tool cover -html=coverage.out -o coverage.html
147154
148155.PHONY : test-integration
149156test-integration : # # Run integration tests
You can’t perform that action at this time.
0 commit comments