|
1 |
| -# Silence update recommendations for Ginkgo |
2 |
| -export ACK_GINKGO_DEPRECATIONS:=1.16.5 |
3 |
| - |
4 | 1 | GIT_COMMIT:=$(shell git describe --dirty --always)
|
5 | 2 | GIT_TAG:=$(shell git describe --dirty --always --tags)
|
6 | 3 | PKG:=github.com/aws/aws-cloud-map-mcs-controller-for-k8s/pkg/version
|
@@ -68,20 +65,10 @@ lint: golangci-lint ## Run linter
|
68 | 65 | goimports: goimports-bin ## run goimports updating files in place
|
69 | 66 | $(GOIMPORTS) -w .
|
70 | 67 |
|
71 |
| -# Run tests |
72 |
| -ENVTEST_ASSETS_DIR=$(shell pwd)/testbin |
73 |
| -KUBEBUILDER_ASSETS?="$(shell $(ENVTEST) use -i $(ENVTEST_KUBERNETES_VERSION) --bin-dir=$(ENVTEST_ASSETS_DIR) -p path)" |
74 |
| - |
75 | 68 | .PHONY: test
|
76 |
| -test: manifests generate generate-mocks fmt vet test-setup goimports lint ## Run tests |
77 |
| - KUBEBUILDER_ASSETS=$(KUBEBUILDER_ASSETS) go test ./... -coverprofile cover.out -covermode=atomic |
78 |
| - |
79 |
| -test-setup: setup-envtest ## Ensure test environment has been downloaded |
80 |
| -ifneq ($(shell test -d $(ENVTEST_ASSETS_DIR); echo $$?), 0) |
81 |
| - @echo Setting up K8s test environment... |
82 |
| - mkdir -p ${ENVTEST_ASSETS_DIR} |
83 |
| - $(ENVTEST) use 1.24.x --bin-dir $(ENVTEST_ASSETS_DIR) |
84 |
| -endif |
| 69 | +test: manifests generate generate-mocks fmt vet goimports lint ## Run tests |
| 70 | + @echo Testing... |
| 71 | + go test ./... -coverprofile=cover.out -covermode=atomic |
85 | 72 |
|
86 | 73 | kind-integration-suite: ## Provision and run integration tests with cleanup
|
87 | 74 | make kind-integration-setup && \
|
@@ -133,8 +120,7 @@ docker-push: ## Push docker image with the manager.
|
133 | 120 | clean:
|
134 | 121 | @echo Cleaning...
|
135 | 122 | go clean
|
136 |
| - if test -d $(ENVTEST_ASSETS_DIR) ; then chmod -R +w $(ENVTEST_ASSETS_DIR) ; fi |
137 |
| - rm -rf $(MOCKS_DESTINATION)/ bin/ $(ENVTEST_ASSETS_DIR)/ cover.out |
| 123 | + rm -rf $(MOCKS_DESTINATION)/ bin/ cover.out |
138 | 124 |
|
139 | 125 | ##@ Deployment
|
140 | 126 |
|
@@ -172,10 +158,6 @@ KUSTOMIZE = $(shell pwd)/bin/kustomize
|
172 | 158 | kustomize: ## Download kustomize locally if necessary.
|
173 | 159 | $(call go-get-tool,$(KUSTOMIZE),sigs.k8s.io/kustomize/kustomize/[email protected])
|
174 | 160 |
|
175 |
| -ENVTEST = $(shell pwd)/bin/setup-envtest |
176 |
| -setup-envtest: ## Download setup-envtest |
177 |
| - $(call go-get-tool,$(ENVTEST),sigs.k8s.io/controller-runtime/tools/setup-envtest@latest) |
178 |
| - |
179 | 161 | MOCKGEN = $(shell pwd)/bin/mockgen
|
180 | 162 | mockgen: ## Download mockgen
|
181 | 163 | $(call go-get-tool,$(MOCKGEN),github.com/golang/mock/[email protected])
|
|
0 commit comments