Skip to content

Commit

Permalink
[YUNIKORN-2911] Add kind-e2e Makefile target (#925)
Browse files Browse the repository at this point in the history
Adds a simple kind-e2e Makefile target. This target starts a kind
cluster on the latest version, executes the e2e tests, and tears down
the cluster.

Ideally this should be run by users prior to PR pushes.

Also, update to kind image for v1.31.1.

Closes: #925
  • Loading branch information
craigcondit committed Oct 10, 2024
1 parent 32903ff commit 92a17ad
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
matrix:
k8s:
[
v1.31.0,
v1.31.1,
v1.30.4,
v1.29.8,
v1.28.13,
Expand Down
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export PATH := $(BASE_DIR)/$(TOOLS_DIR):$(GO_EXE_PATH):$(PATH)

# Default values for dev cluster
ifeq ($(K8S_VERSION),)
K8S_VERSION := v1.29.4
K8S_VERSION := v1.31.1
endif
ifeq ($(CLUSTER_NAME),)
CLUSTER_NAME := yk8s
Expand Down Expand Up @@ -705,14 +705,23 @@ arch:
@echo EXEC_ARCH=$(EXEC_ARCH)

# Start dev cluster
.PHONY: start-cluster
start-cluster: $(KIND_BIN)
@"$(KIND_BIN)" delete cluster --name="$(CLUSTER_NAME)" || :
@./scripts/run-e2e-tests.sh -a install -n "$(CLUSTER_NAME)" -v "kindest/node:$(K8S_VERSION)" $(PLUGIN_OPTS)

# Stop dev cluster
.PHONY: stop-cluster
stop-cluster: $(KIND_BIN)
@"$(KIND_BIN)" delete cluster --name="$(CLUSTER_NAME)"

# Start dev cluster, run e2e tests, stop dev cluster
.PHONY: kind-e2e
kind-e2e: $(KIND_BIN)
@"$(KIND_BIN)" delete cluster --name="$(CLUSTER_NAME)" || : ; \
./scripts/run-e2e-tests.sh -a test -n "$(CLUSTER_NAME)" -v "kindest/node:$(K8S_VERSION)" $(PLUGIN_OPTS) ; STATUS=$$? ; \
"$(KIND_BIN)" delete cluster --name="$(CLUSTER_NAME)" || : ; exit $$STATUS

# Run the e2e tests, this assumes yunikorn is running under yunikorn namespace
.PHONY: e2e_test
e2e_test: tools
Expand Down
4 changes: 2 additions & 2 deletions scripts/run-e2e-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,10 @@ Examples:
${NAME} -a test -n yk8s -v kindest/node:v1.28.13
${NAME} -a test -n yk8s -v kindest/node:v1.29.8
${NAME} -a test -n yk8s -v kindest/node:v1.30.4
${NAME} -a test -n yk8s -v kindest/node:v1.31.0
${NAME} -a test -n yk8s -v kindest/node:v1.31.1
Use a local helm chart path:
${NAME} -a test -n yk8s -v kindest/node:v1.31.0 -p ../yunikorn-release/helm-charts/yunikorn
${NAME} -a test -n yk8s -v kindest/node:v1.31.1 -p ../yunikorn-release/helm-charts/yunikorn
EOF
}

Expand Down

0 comments on commit 92a17ad

Please sign in to comment.