|
71 | 71 | # Options are set to exit when a recipe line exits non-zero or a piped command fails.
|
72 | 72 | # SHELL = /usr/bin/env bash -o pipefail
|
73 | 73 | .SHELLFLAGS = -ec
|
74 |
| - |
75 | 74 | # Quiet Ginkgo for now.
|
76 | 75 | # The warnings are in regards to a future release.
|
77 | 76 | export ACK_GINKGO_DEPRECATIONS := 1.16.5
|
@@ -248,10 +247,23 @@ cluster-api/tilt-settings.json: hack/tilt-settings.json cluster-api
|
248 | 247 | ## --------------------------------------
|
249 | 248 | ## Tests
|
250 | 249 | ## --------------------------------------
|
251 |
| - |
252 | 250 | export KUBEBUILDER_ASSETS=$(REPO_ROOT)/$(TOOLS_BIN_DIR)
|
| 251 | +DEEPCOPY_GEN_TARGETS_TEST=$(shell find test/fakes -type d -name "fakes" -exec echo {}\/zz_generated.deepcopy.go \;) |
| 252 | +DEEPCOPY_GEN_INPUTS_TEST=$(shell find test/fakes/* -name "*zz_generated*" -prune -o -type f -print) |
| 253 | +.PHONY: generate-deepcopy-test |
| 254 | +generate-deepcopy-test: $(DEEPCOPY_GEN_TARGETS_TEST) ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations. |
| 255 | +test/fakes/zz_generated.deepcopy.go: $(CONTROLLER_GEN) $(DEEPCOPY_GEN_INPUTS_TEST) |
| 256 | + $(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..." |
| 257 | + |
| 258 | +MANIFEST_GEN_INPUTS_TEST=$(shell find test/fakes/* -name "*zz_generated*" -prune -o -type f -print) |
| 259 | +.PHONY: generate-manifest-test |
| 260 | +generate-manifest-test: config/.flag-test.mk ## Generates crd, webhook, rbac, and other configuration manifests from kubebuilder instructions in go comments. |
| 261 | +config/.flag-test.mk: $(CONTROLLER_GEN) $(MANIFEST_GEN_INPUTS_TEST) |
| 262 | + $(CONTROLLER_GEN) crd:crdVersions=v1 rbac:roleName=manager-role webhook paths="./test/fakes" output:crd:artifacts:config=test/fakes |
| 263 | + @touch config/.flag-test.mk |
| 264 | + |
253 | 265 | .PHONY: test
|
254 |
| -test: generate-mocks lint $(GINKGO_V2) $(KUBECTL) $(API_SERVER) $(ETCD) ## Run tests. At the moment this is only unit tests. |
| 266 | +test: generate-deepcopy-test generate-manifest-test generate-mocks lint $(GINKGO_V2) $(KUBECTL) $(API_SERVER) $(ETCD) ## Run tests. At the moment this is only unit tests. |
255 | 267 | @./hack/testing_ginkgo_recover_statements.sh --add # Add ginkgo.GinkgoRecover() statements to controllers.
|
256 | 268 | @# The following is a slightly funky way to make sure the ginkgo statements are removed regardless the test results.
|
257 | 269 | @$(GINKGO_V2) --label-filter="!integ" --cover -coverprofile cover.out --covermode=atomic -v ./api/... ./controllers/... ./pkg/...; EXIT_STATUS=$$?;\
|
|
0 commit comments