Skip to content

Commit 0a2160a

Browse files
committed
test: add full e2e tests
1 parent 1abd633 commit 0a2160a

File tree

6 files changed

+597
-147
lines changed

6 files changed

+597
-147
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
bin/*
99
Dockerfile.cross
1010

11+
# Secrets
12+
test/e2e/values.yaml
13+
1114
# Test binary, built with `go test -c`
1215
*.test
1316

Makefile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ cleanup-test-e2e:
150150

151151
# Utilize Kind or modify the e2e tests to load the image locally, enabling compatibility with other vendors.
152152
.PHONY: test-e2e
153-
test-e2e: setup-test-e2e manifests generate fmt vet ## Run the e2e tests. Expected an isolated environment using Kind.
154-
KIND_CLUSTER=$(KIND_CLUSTER) go test ./test/e2e/ -v -ginkgo.v
153+
test-e2e: fmt vet setup-test-e2e ## Run the e2e tests. Expected an isolated environment using Kind.
154+
KUBE_CONTEXT=kind-$(KIND_CLUSTER) go test ./test/e2e/ -tags=e2e -v -ginkgo.v
155155
$(MAKE) cleanup-test-e2e
156156

157157
.PHONY: lint
@@ -213,7 +213,7 @@ build-installer: manifests generate kustomize ## Generate a consolidated YAML wi
213213
.PHONY: ko-build
214214
ko-build: ## Build the manager image using ko.
215215
KO_DOCKER_REPO=$(IMAGE_TAG_BASE) \
216-
ko build --bare --platform=$(PLATFORMS) --image-label org.opencontainers.image.source=$(IMAGE_SOURCE) --tags "latest,$(VERSION)" --push ./cmd/manager
216+
$(KO) build --bare --platform=$(PLATFORMS) --image-label org.opencontainers.image.source=$(IMAGE_SOURCE) --tags "latest,$(VERSION)" --push ./cmd/manager
217217

218218

219219
##@ Deployment
@@ -249,6 +249,7 @@ $(LOCALBIN):
249249
## Tool Binaries
250250
KUBECTL ?= kubectl
251251
KIND ?= kind
252+
KO ?= ko
252253
KUSTOMIZE ?= $(LOCALBIN)/kustomize
253254
CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
254255
ENVTEST ?= $(LOCALBIN)/setup-envtest

test/e2e/e2e_suite_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
//go:build e2e
2+
// +build e2e
3+
14
/*
25
Copyright 2024 Robin Breathe.
36
@@ -27,6 +30,6 @@ import (
2730
// Run e2e tests using the Ginkgo runner.
2831
func TestE2E(t *testing.T) {
2932
RegisterFailHandler(Fail)
30-
fmt.Fprintf(GinkgoWriter, "Starting github-token-manager suite\n")
33+
_, _ = fmt.Fprintf(GinkgoWriter, "Starting github-token-manager suite\n")
3134
RunSpecs(t, "e2e suite")
3235
}

0 commit comments

Comments
 (0)