Skip to content

Commit

Permalink
Makefile: add a rule to run e2e tests
Browse files Browse the repository at this point in the history
We add a rule to fetch ginkgo, and another one to run the e2e tests.

Signed-off-by: Federico Paolinelli <[email protected]>
  • Loading branch information
fedepaol committed Jun 28, 2023
1 parent 839cc90 commit 687feea
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ KIND ?= $(LOCALBIN)/kind
KUBECTL ?= $(LOCALBIN)/kubectl
KUSTOMIZE ?= $(LOCALBIN)/kustomize
CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
GINKGO ?= $(LOCALBIN)/ginkgo
ENVTEST ?= $(LOCALBIN)/setup-envtest
KUBECONFIG_PATH ?= $(LOCALBIN)/kubeconfig
export KUBECONFIG=$(KUBECONFIG_PATH)
Expand All @@ -123,6 +124,7 @@ export KUBECONFIG=$(KUBECONFIG_PATH)
KUSTOMIZE_VERSION ?= v5.0.0
CONTROLLER_TOOLS_VERSION ?= v0.11.3
KUBECTL_VERSION ?= v1.27.0
GINKGO_VERSION ?= v2.11.0
KIND_VERSION ?= v0.19.0
KIND_CLUSTER_NAME ?= frr-k8s

Expand Down Expand Up @@ -179,6 +181,17 @@ envtest: $(ENVTEST) ## Download envtest-setup locally if necessary.
$(ENVTEST): $(LOCALBIN)
test -s $(LOCALBIN)/setup-envtest || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest

.PHONY: ginkgo
ginkgo: $(GINKGO) ## Download controller-gen locally if necessary. If wrong version is installed, it will be overwritten.
$(GINKGO): $(LOCALBIN)
test -s $(LOCALBIN)/ginkgo && $(LOCALBIN)/ginkgo version | grep -q $(GINKGO_VERSION) || \
GOBIN=$(LOCALBIN) go install github.com/onsi/ginkgo/v2/ginkgo@$(GINKGO_VERSION)

.PHONY: e2etest
e2etest: ginkgo
$(GINKGO) -v $(GINKGO_ARGS) ./e2etests


.PHONY: kind-cluster
kind-cluster: kind
KIND_BIN=$(LOCALBIN)/kind hack/kind.sh
Expand Down

0 comments on commit 687feea

Please sign in to comment.