Skip to content

Commit

Permalink
✨ Add clusteraddon integration tests (#47)
Browse files Browse the repository at this point in the history
Adding integration tests for clusteraddon controller that use the
separate kind cluster.

Signed-off-by: janiskemper <janis.kemper@syself.com>
  • Loading branch information
janiskemper committed Dec 29, 2023
1 parent fe1fcbb commit 8d168d7
Show file tree
Hide file tree
Showing 4 changed files with 488 additions and 2 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,12 @@ jobs:
env:
GO111MODULE: "on"
run: make test-unit

- name: Running integration tests workloadcluster
env:
GIT_PROVIDER: github
GIT_ORG_NAME: SovereignCloudStack
GIT_REPOSITORY_NAME: cluster-stacks
GO111MODULE: "on"
GIT_ACCESS_TOKEN: ${{ secrets.GIT_ACCESS_TOKEN }}
run: make test-integration-workloadcluster
14 changes: 12 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -319,17 +319,27 @@ $(WORKER_CLUSTER_KUBECONFIG):

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

.PHONY: test-integration
test-integration: test-integration-workloadcluster test-integration-github
echo done

.PHONY: test-unit
test-unit: $(SETUP_ENVTEST) $(GOTESTSUM) $(HELM) ## Run unit
@mkdir -p $(shell pwd)/.coverage
CREATE_KIND_CLUSTER=true KUBEBUILDER_ASSETS="$(KUBEBUILDER_ASSETS)" $(GOTESTSUM) --junitfile=.coverage/junit.xml --format testname -- -mod=vendor \
-covermode=atomic -coverprofile=.coverage/cover.out -p=4 ./internal/controller/...

.PHONY: test-integration-workloadcluster
test-integration-workloadcluster: $(SETUP_ENVTEST) $(GOTESTSUM)
@mkdir -p $(shell pwd)/.coverage
CREATE_KIND_CLUSTER=true KUBEBUILDER_ASSETS="$(KUBEBUILDER_ASSETS)" $(GOTESTSUM) --junitfile=.coverage/junit.xml --format testname -- -mod=vendor \
-covermode=atomic -coverprofile=.coverage/cover.out -p=1 ./internal/test/integration/workloadcluster/...

.PHONY: test-integration-github
test-integration-github: $(SETUP_ENVTEST) $(GOTESTSUM)
@mkdir -p $(shell pwd)/.coverage
CREATE_KIND_CLUSTER=false KUBEBUILDER_ASSETS="$(KUBEBUILDER_ASSETS)" $(GOTESTSUM) --junitfile=../.coverage/junit.xml --format testname -- -mod=vendor \
-covermode=atomic -coverprofile=../.coverage/cover.out -p=1 ./internal/test/integration/github/...
CREATE_KIND_CLUSTER=false KUBEBUILDER_ASSETS="$(KUBEBUILDER_ASSETS)" $(GOTESTSUM) --junitfile=.coverage/junit.xml --format testname -- -mod=vendor \
-covermode=atomic -coverprofile=.coverage/cover.out -p=1 ./internal/test/integration/github/...

##@ Verify
##########
Expand Down

0 comments on commit 8d168d7

Please sign in to comment.