Skip to content

Commit 65749d4

Browse files
authored
Merge pull request #164 from wanyufe/failuredomain-deletion
Merging with intent to follow on with a cleanup PR.
2 parents a11224f + 8c8be25 commit 65749d4

13 files changed

+701
-860
lines changed

Makefile

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ endif
7171
# Options are set to exit when a recipe line exits non-zero or a piped command fails.
7272
# SHELL = /usr/bin/env bash -o pipefail
7373
.SHELLFLAGS = -ec
74-
7574
# Quiet Ginkgo for now.
7675
# The warnings are in regards to a future release.
7776
export ACK_GINKGO_DEPRECATIONS := 1.16.5
@@ -248,10 +247,23 @@ cluster-api/tilt-settings.json: hack/tilt-settings.json cluster-api
248247
## --------------------------------------
249248
## Tests
250249
## --------------------------------------
251-
252250
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+
253265
.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.
255267
@./hack/testing_ginkgo_recover_statements.sh --add # Add ginkgo.GinkgoRecover() statements to controllers.
256268
@# The following is a slightly funky way to make sure the ginkgo statements are removed regardless the test results.
257269
@$(GINKGO_V2) --label-filter="!integ" --cover -coverprofile cover.out --covermode=atomic -v ./api/... ./controllers/... ./pkg/...; EXIT_STATUS=$$?;\

0 commit comments

Comments
 (0)