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 @@ -135,14 +135,21 @@ help: ## Display this help
135135.PHONY : test
136136test : generate lint go-test # # Run generate lint and tests
137137
138- go-test : export TEST_ASSET_KUBECTL = $(KUBECTL )
139- go-test : export TEST_ASSET_KUBE_APISERVER = $(KUBE_APISERVER )
140- go-test : export TEST_ASSET_ETCD = $(ETCD )
138+ envs-test :
139+ export TEST_ASSET_KUBECTL = $(KUBECTL )
140+ export TEST_ASSET_KUBE_APISERVER = $(KUBE_APISERVER )
141+ export TEST_ASSET_ETCD = $(ETCD )
141142
142143.PHONY : go-test
143- go-test : $(KUBECTL ) $(KUBE_APISERVER ) $(ETCD ) # # Run go tests
144+ go-test : envs-test $(KUBECTL ) $(KUBE_APISERVER ) $(ETCD ) # # Run go tests
145+ echo $(TEST_ASSET_KUBECTL )
144146 go test ./...
145147
148+ .PHONY : test-cover
149+ test-cover : envs-test $(KUBECTL ) $(KUBE_APISERVER ) $(ETCD ) # # Run tests with code coverage and code generate reports
150+ go test -v -coverprofile=coverage.out ./...
151+ go tool cover -func=coverage.out -o coverage.txt
152+ go tool cover -html=coverage.out -o coverage.html
146153
147154.PHONY : test-integration
148155test-integration : # # Run integration tests
You can’t perform that action at this time.
0 commit comments