Skip to content

Commit 8d168d7

Browse files
authored
✨ Add clusteraddon integration tests (#47)
Adding integration tests for clusteraddon controller that use the separate kind cluster. Signed-off-by: janiskemper <janis.kemper@syself.com>
1 parent fe1fcbb commit 8d168d7

4 files changed

Lines changed: 488 additions & 2 deletions

File tree

.github/workflows/test.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,12 @@ jobs:
5656
env:
5757
GO111MODULE: "on"
5858
run: make test-unit
59+
60+
- name: Running integration tests workloadcluster
61+
env:
62+
GIT_PROVIDER: github
63+
GIT_ORG_NAME: SovereignCloudStack
64+
GIT_REPOSITORY_NAME: cluster-stacks
65+
GO111MODULE: "on"
66+
GIT_ACCESS_TOKEN: ${{ secrets.GIT_ACCESS_TOKEN }}
67+
run: make test-integration-workloadcluster

Makefile

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,17 +319,27 @@ $(WORKER_CLUSTER_KUBECONFIG):
319319

320320
KUBEBUILDER_ASSETS ?= $(shell $(SETUP_ENVTEST) use --use-env --bin-dir $(abspath $(TOOLS_BIN_DIR)) -p path $(KUBEBUILDER_ENVTEST_KUBERNETES_VERSION))
321321

322+
.PHONY: test-integration
323+
test-integration: test-integration-workloadcluster test-integration-github
324+
echo done
325+
322326
.PHONY: test-unit
323327
test-unit: $(SETUP_ENVTEST) $(GOTESTSUM) $(HELM) ## Run unit
324328
@mkdir -p $(shell pwd)/.coverage
325329
CREATE_KIND_CLUSTER=true KUBEBUILDER_ASSETS="$(KUBEBUILDER_ASSETS)" $(GOTESTSUM) --junitfile=.coverage/junit.xml --format testname -- -mod=vendor \
326330
-covermode=atomic -coverprofile=.coverage/cover.out -p=4 ./internal/controller/...
327331

332+
.PHONY: test-integration-workloadcluster
333+
test-integration-workloadcluster: $(SETUP_ENVTEST) $(GOTESTSUM)
334+
@mkdir -p $(shell pwd)/.coverage
335+
CREATE_KIND_CLUSTER=true KUBEBUILDER_ASSETS="$(KUBEBUILDER_ASSETS)" $(GOTESTSUM) --junitfile=.coverage/junit.xml --format testname -- -mod=vendor \
336+
-covermode=atomic -coverprofile=.coverage/cover.out -p=1 ./internal/test/integration/workloadcluster/...
337+
328338
.PHONY: test-integration-github
329339
test-integration-github: $(SETUP_ENVTEST) $(GOTESTSUM)
330340
@mkdir -p $(shell pwd)/.coverage
331-
CREATE_KIND_CLUSTER=false KUBEBUILDER_ASSETS="$(KUBEBUILDER_ASSETS)" $(GOTESTSUM) --junitfile=../.coverage/junit.xml --format testname -- -mod=vendor \
332-
-covermode=atomic -coverprofile=../.coverage/cover.out -p=1 ./internal/test/integration/github/...
341+
CREATE_KIND_CLUSTER=false KUBEBUILDER_ASSETS="$(KUBEBUILDER_ASSETS)" $(GOTESTSUM) --junitfile=.coverage/junit.xml --format testname -- -mod=vendor \
342+
-covermode=atomic -coverprofile=.coverage/cover.out -p=1 ./internal/test/integration/github/...
333343

334344
##@ Verify
335345
##########

0 commit comments

Comments
 (0)