diff --git a/.github/workflows/conformance.yaml b/.github/workflows/conformance.yaml index b86b8b6739..f69a3d98f6 100644 --- a/.github/workflows/conformance.yaml +++ b/.github/workflows/conformance.yaml @@ -17,13 +17,9 @@ jobs: uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f # pin@v3.3.1 with: go-version: ~1.18.6 - - name: Prep environment + - name: Prepare environment run: make kind-create-cluster kind-deploy-kyverno - name: Wait for Kyverno to start run: sleep 60 - - name: Install kuttl - run: curl -sL https://github.com/kudobuilder/kuttl/releases/download/v0.13.0/kubectl-kuttl_0.13.0_linux_x86_64 -o kuttl && chmod +x kuttl - name: Test with kuttl - run: ./kuttl test --config ./test/conformance/kuttl/kuttl-test.yaml - # - name: Kyverno conformance tests - # run: go run ./test/conformance/main.go + run: make test-kuttl diff --git a/Makefile b/Makefile index b718f52449..484d6a3079 100644 --- a/Makefile +++ b/Makefile @@ -57,7 +57,9 @@ HELM_DOCS := $(TOOLS_DIR)/helm-docs HELM_DOCS_VERSION := v1.11.0 KO := $(TOOLS_DIR)/ko KO_VERSION := main #e93dbee8540f28c45ec9a2b8aec5ef8e43123966 -TOOLS := $(KIND) $(CONTROLLER_GEN) $(CLIENT_GEN) $(LISTER_GEN) $(INFORMER_GEN) $(OPENAPI_GEN) $(GEN_CRD_API_REFERENCE_DOCS) $(GO_ACC) $(KUSTOMIZE) $(GOIMPORTS) $(HELM) $(HELM_DOCS) $(KO) +KUTTL := $(TOOLS_DIR)/kubectl-kuttl +KUTTL_VERSION := v0.13.0 +TOOLS := $(KIND) $(CONTROLLER_GEN) $(CLIENT_GEN) $(LISTER_GEN) $(INFORMER_GEN) $(OPENAPI_GEN) $(GEN_CRD_API_REFERENCE_DOCS) $(GO_ACC) $(KUSTOMIZE) $(GOIMPORTS) $(HELM) $(HELM_DOCS) $(KO) $(KUTTL) ifeq ($(GOOS), darwin) SED := gsed else @@ -116,6 +118,10 @@ $(KO): @echo Install ko... >&2 @GOBIN=$(TOOLS_DIR) go install github.com/google/ko@$(KO_VERSION) +$(KUTTL): + @echo Install kuttl... >&2 + @GOBIN=$(TOOLS_DIR) go install github.com/kudobuilder/kuttl/cmd/kubectl-kuttl@$(KUTTL_VERSION) + .PHONY: install-tools install-tools: $(TOOLS) ## Install tools @@ -575,6 +581,15 @@ kind-test-conformance: kind-deploy-kyverno ## Run conformance tests on a local c @echo Running conformance tests... >&2 @go run ./test/conformance --create-cluster=false +############### +# KUTTL TESTS # +############### + +.PHONY: test-kuttl +test-kuttl: $(KUTTL) ## Run kuttl tests + @echo Running kuttl tests... >&2 + @$(KUTTL) test --config ./test/conformance/kuttl/kuttl-test.yaml + ############# # CLI TESTS # #############