github.com/1aal/kubeblocks@v0.0.0-20231107070852-e1c03e598921/test/e2e/Makefile (about) 1 GO ?= go 2 GOPATH ?= $(shell $(GO) env GOPATH) 3 4 GINKGO_VERSION = 2.9.1 5 GINKGO = $(GOPATH)/bin/ginkgo 6 HELM_VERSION ?= v3.9.0 7 INIT_ENV ?= false 8 CONFIG_TYPE ?= s3 9 # The help target prints out all targets with their descriptions organized 10 # beneath their categories. The categories are represented by '##@' and the 11 # target descriptions by '##'. The awk commands is responsible for reading the 12 # entire set of makefiles included in this invocation, looking for lines of the 13 # file as xyz: ## something, and then pretty-format the target and help. Then, 14 # if there's a line with ##@ something, that gets pretty-printed as a category. 15 # More info on the usage of ANSI control characters for terminal formatting: 16 # https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters 17 # More info on the awk command: 18 # http://linuxcommand.org/lc3_adv_awk.php 19 # https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html 20 21 22 23 .PHONY: help 24 help: ## Display this help. 25 @awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST) 26 27 .PHONY:ginkgo 28 ginkgo: # Make sure ginkgo is in $GOPATH/bin 29 go install github.com/onsi/ginkgo/v2/ginkgo@v$(GINKGO_VERSION) 30 31 ifeq ($(origin VERSION), command line) 32 VERSION ?= $(VERSION) 33 endif 34 ifeq ($(origin PROVIDER), command line) 35 PROVIDER ?= $(PROVIDER) 36 else 37 PROVIDER ?= "" 38 endif 39 ifeq ($(origin REGION), command line) 40 REGION ?= $(REGION) 41 else 42 REGION ?= "" 43 endif 44 ifeq ($(origin SKIP_CASE), command line) 45 SKIP_CASE ?= $(SKIP_CASE) 46 else 47 SKIP_CASE ?= "" 48 endif 49 ifeq ($(origin INIT_ENV), command line) 50 INIT_ENV ?= $(INIT_ENV) 51 else 52 INIT_ENV ?= false 53 endif 54 ifeq ($(origin CONFIG_TYPE), command line) 55 CONFIG_TYPE ?= $(CONFIG_TYPE) 56 else 57 CONFIG_TYPE ?= s3 58 endif 59 60 .PHONY: run 61 run: ginkgo ## Run end-to-end tests. 62 #ACK_GINKGO_DEPRECATIONS=$(GINKGO_VERSION) $(GINKGO) run . 63 $(GINKGO) test -process -ginkgo.v . -- -VERSION=$(VERSION) -PROVIDER=$(PROVIDER) -REGION=$(REGION) -SECRET_ID=$(SECRET_ID) -SECRET_KEY=$(SECRET_KEY) -INIT_ENV=$(INIT_ENV) -TEST_TYPE=$(TEST_TYPE) -SKIP_CASE=$(SKIP_CASE) -CONFIG_TYPE=$(CONFIG_TYPE) --ginkgo.json-report=report.json 64 65 build: ginkgo ## Run ginkgo build e2e test suite binary. 66 $(GINKGO) build . 67 68 .PHONY: helmtool 69 helmtool: ## Download helm locally if necessary. 70 ifeq (, $(shell which helm)) 71 @{ \ 72 set -e ;\ 73 go install github.com/helm/helm@$(HELM_VERSION);\ 74 } 75 HELM=$(GOBIN)/helm 76 else 77 HELM=$(shell which helm) 78 endif