From f7e6a28ade6a1b192e7127e94e437fbf1fac962a Mon Sep 17 00:00:00 2001 From: Shubham Gupta <69793468+shubham-cmyk@users.noreply.github.com> Date: Sun, 29 Oct 2023 18:17:42 +0530 Subject: [PATCH] makefile : Add Target to run e2e Test (#685) * makefile targets for e2e Signed-off-by: Shubham Gupta * fix Signed-off-by: Shubham Gupta --------- Signed-off-by: Shubham Gupta --- Makefile | 18 +++++++++++++++++- tests/_config/kind-config.yaml | 1 + 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ad9403426..aed1dd5da 100644 --- a/Makefile +++ b/Makefile @@ -132,4 +132,20 @@ verify-codegen: codegen @git --no-pager diff -- . @echo 'If this test fails, it is because the git diff is non-empty after running "make codegen".' >&2 @echo 'To correct this, locally run "make codegen", commit the changes, and re-run tests.' >&2 - @git diff --quiet --exit-code -- . \ No newline at end of file + @git diff --quiet --exit-code -- . + +.PHONY: install-kuttl +install-kuttl: + curl -L https://github.com/kudobuilder/kuttl/releases/download/v0.15.0/kubectl-kuttl_0.15.0_linux_x86_64 -o $(shell pwd)/bin/kuttl + chmod +x $(shell pwd)/bin/kuttl + +.PHONY: e2e-kind-setup +e2e-kind-setup: + docker build -t redis-operator:e2e -f Dockerfile . + kind create cluster --config tests/_config/kind-config.yaml + kind load docker-image redis-operator:e2e --name kind + make deploy IMG=redis-operator:e2e + +.PHONY: e2e-test +e2e-test: e2e-kind-setup install-kuttl + $(shell pwd)/bin/kuttl test --config tests/_config/kuttl-test.yaml \ No newline at end of file diff --git a/tests/_config/kind-config.yaml b/tests/_config/kind-config.yaml index 752e993cd..da75a970a 100644 --- a/tests/_config/kind-config.yaml +++ b/tests/_config/kind-config.yaml @@ -1,5 +1,6 @@ kind: Cluster apiVersion: kind.x-k8s.io/v1alpha4 +name: kind nodes: - role: control-plane - role: worker