Skip to content

Commit 302b200

Browse files
authored
Merge pull request #70 from PDOK/jd/e2e-test
Run e2e tests locally
2 parents d17e1f4 + 426c547 commit 302b200

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

Makefile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ test: manifests generate fmt vet setup-envtest ## Run tests.
6666
# CertManager is installed by default; skip with:
6767
# - CERT_MANAGER_INSTALL_SKIP=true
6868
KIND_CLUSTER ?= atom-operator-test-e2e
69+
KUBECONFIG_PATH ?= ./kind-config.yaml # Added for local development to prevent errors with finding the kind cluster
6970

7071
.PHONY: setup-test-e2e
7172
setup-test-e2e: ## Set up a Kind cluster for e2e tests if it does not exist
@@ -78,17 +79,18 @@ setup-test-e2e: ## Set up a Kind cluster for e2e tests if it does not exist
7879
echo "Kind cluster '$(KIND_CLUSTER)' already exists. Skipping creation." ;; \
7980
*) \
8081
echo "Creating Kind cluster '$(KIND_CLUSTER)'..."; \
81-
$(KIND) create cluster --name $(KIND_CLUSTER) ;; \
82+
$(KIND) create cluster --name $(KIND_CLUSTER) --kubeconfig $(KUBECONFIG_PATH) ;; \
8283
esac
8384

8485
.PHONY: test-e2e
8586
test-e2e: setup-test-e2e manifests generate fmt vet ## Run the e2e tests. Expected an isolated environment using Kind.
86-
KIND=$(KIND) KIND_CLUSTER=$(KIND_CLUSTER) go test -tags=e2e ./test/e2e/ -v -ginkgo.v
87+
KIND=$(KIND) KIND_CLUSTER=$(KIND_CLUSTER) KUBECONFIG=$(KUBECONFIG_PATH) go test -tags=e2e ./test/e2e/ -v -ginkgo.v
8788
$(MAKE) cleanup-test-e2e
8889

8990
.PHONY: cleanup-test-e2e
9091
cleanup-test-e2e: ## Tear down the Kind cluster used for e2e tests
91-
@$(KIND) delete cluster --name $(KIND_CLUSTER)
92+
@$(KIND) delete cluster --name $(KIND_CLUSTER) --kubeconfig $(KUBECONFIG_PATH)
93+
rm $(KUBECONFIG_PATH)
9294

9395
.PHONY: lint
9496
lint: golangci-lint ## Run golangci-lint linter

config/manager/kustomization.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1
44
kind: Kustomization
55
images:
66
- name: controller
7-
newName: local-registry:5000/atom-operator
8-
newTag: v3.0.0
7+
newName: example.com/atom-operator
8+
newTag: v0.0.1

0 commit comments

Comments
 (0)