Skip to content

Commit e0d0ea7

Browse files
authored
Add kubetest2-kind for end to end testing (#8)
Create and destroy kind clusters during build workflow to run end to end testing.
1 parent 44154f1 commit e0d0ea7

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,8 @@ jobs:
1616
with:
1717
go-version: 1.17
1818

19-
- name: make test
19+
- name: Run unit tests
2020
run: make test
21+
22+
- name: Run acceptance tests
23+
run: make e2e-test

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,8 @@ cover.out
1010
# OSX trash
1111
.DS_Store
1212

13-
#mocks generated by mockgen
13+
# mocks generated by mockgen
1414
mocks/
15+
16+
# e2e test artifacts
17+
_artifacts/

Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ test: manifests generate generate-mocks fmt vet ## Run tests.
5555
test -f ${ENVTEST_ASSETS_DIR}/setup-envtest.sh || curl -sSLo ${ENVTEST_ASSETS_DIR}/setup-envtest.sh https://raw.githubusercontent.com/kubernetes-sigs/controller-runtime/v0.7.2/hack/setup-envtest.sh
5656
source ${ENVTEST_ASSETS_DIR}/setup-envtest.sh; fetch_envtest_tools $(ENVTEST_ASSETS_DIR); setup_envtest_env $(ENVTEST_ASSETS_DIR); go test ./... -coverprofile cover.out
5757

58+
e2e-test: generate kubetest2 fmt vet
59+
$(KUBETEST2-KIND) --cluster-name aws-cloudmap-mcs-e2e --up
60+
$(KUBETEST2-KIND) --cluster-name aws-cloudmap-mcs-e2e --down
61+
5862
##@ Build
5963

6064
build: generate fmt vet ## Build manager binary.
@@ -100,6 +104,9 @@ MOCKGEN = $(shell pwd)/bin/mockgen
100104
mockgen: ## Download mockgen
101105
$(call go-get-tool,$(MOCKGEN),github.com/golang/mock/[email protected])
102106

107+
KUBETEST2-KIND = $(shell pwd)/bin/kubetest2-kind
108+
kubetest2: ## Download kubetest2
109+
$(call go-get-tool,$(KUBETEST2-KIND),sigs.k8s.io/kubetest2/kubetest2-kind@latest)
103110

104111
# go-get-tool will 'go get' any package $2 and install it to $1.
105112
PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))

pkg/api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)