@@ -60,7 +60,7 @@ test/verify:
6060test/lint :
6161 bazel run //hack:verify-gofmt
6262
63- # NODE_VERSION refers the to version of the kindest/node image. E. g. 1.22.1
63+ # NODE_VERSION refers the to patch version of Kubernetes (e. g. 1.22.6)
6464.PHONY : test/smoketest
6565test/smoketest :
6666 @bazel run //hack/smoketest -- -dir $(PWD ) -version $(NODE_VERSION )
@@ -71,10 +71,9 @@ test/smoketest:
7171test/e2e-short :
7272 bazel test //e2e/... --test_arg=--test.short
7373
74- #
7574# End to end testing targets
7675#
77- # kind : use make test/e2e/kind
76+ # k3d : use make test/e2e/k3d
7877# gke: use make test/e2e/gke
7978#
8079# kubetest2 binaries from the kubernetes testing team is used
@@ -83,31 +82,32 @@ test/e2e-short:
8382# Once the repo releases binaries we should vendor the tag or
8483# download the built binaries.
8584
86- # This target is used by kubetest2-tester-exec when running a kind test
87- # This target exportis the kubeconfig from kind and then runs
88- # k8s:k8s -type kind which checks to see if kind is up and running.
85+ # This target is used by kubetest2-tester-exec when running a k3d test
86+ # It run k8s:k8s -type k3d which checks to see if k3d is up and running.
8987# Then bazel e2e testing is run.
90- # An example of calling this is using make test/e2e/testrunner-kind-upgrades
91- test/e2e/testrunner-kind-% : PACKAGE=$*
92- test/e2e/testrunner-kind-% :
93- bazel-bin/hack/bin/kind export kubeconfig --name $(CLUSTER_NAME )
94- bazel run //hack/k8s:k8s -- -type kind
88+ # An example of calling this is using make test/e2e/testrunner-k3d-upgrades
89+ test/e2e/testrunner-k3d-% : PACKAGE=$*
90+ test/e2e/testrunner-k3d-% :
91+ bazel run //hack/k8s:k8s -- -type k3d
9592 bazel test --stamp //e2e/$(PACKAGE ) /... --test_arg=-test.v --test_arg=-test.parallel=8 --test_arg=parallel=true
9693
97- # Use this target to run e2e tests using a kind k8s cluster.
98- # This target uses kind to start a k8s cluster and runs the e2e tests
94+ # Use this target to run e2e tests using a k3d k8s cluster.
95+ # This target uses k3d to start a k8s cluster and runs the e2e tests
9996# against that cluster.
100- # This is the main entrypoint for running the e2e tests on kind.
101- # This target runs kubetest2 kind that starts a kind cluster
97+ #
98+ # This is the main entrypoint for running the e2e tests on k3d.
99+ # This target runs kubetest2 k3d that starts a k3d cluster
102100# Then kubetest2 tester exec is run which runs the make target
103- # test/e2e/testrunner-kind .
101+ # test/e2e/testrunner-k3d .
104102# After the tests run the cluster is deleted.
105103# If you need a unique cluster name override CLUSTER_NAME.
106- test/e2e/kind-% : PACKAGE=$*
107- test/e2e/kind-% :
108- bazel build //hack/bin/...
109- PATH=${PATH} :bazel-bin/hack/bin kubetest2 kind --cluster-name=$(CLUSTER_NAME ) \
110- --up --down -v 10 --test=exec -- make test/e2e/testrunner-kind-$(PACKAGE )
104+ test/e2e/k3d-% : PACKAGE=$*
105+ test/e2e/k3d-% :
106+ bazel build //hack/bin/... //e2e/kubetest2-k3d/...
107+ PATH=bazel-bin/hack/bin:bazel-bin/e2e/kubetest2-k3d/kubetest2-k3d_/:${PATH} \
108+ bazel-bin/hack/bin/kubetest2 k3d \
109+ --cluster-name=$(CLUSTER_NAME ) --image rancher/k3s:v1.23.3-k3s1 --servers 3 \
110+ --up --down -v 10 --test=exec -- make test/e2e/testrunner-k3d-$(PACKAGE )
111111
112112# This target is used by kubetest2-eks to run e2e tests.
113113.PHONY : test/e2e/testrunner-eks
@@ -118,7 +118,7 @@ test/e2e/testrunner-eks:
118118 bazel test --stamp //e2e/decommission/... --action_env=KUBECONFIG=$(TMPDIR ) /$(CLUSTER_NAME ) -eks.kubeconfig.yaml
119119
120120# Use this target to run e2e tests with a eks cluster.
121- # This target uses kind to start a eks k8s cluster and runs the e2e tests
121+ # This target uses kubetest2 to start a eks k8s cluster and runs the e2e tests
122122# against that cluster.
123123.PHONY : test/e2e/eks
124124test/e2e/eks :
@@ -148,9 +148,9 @@ test/e2e/testrunner-gke:
148148 bazel test --stamp //e2e/decommission/...
149149
150150# Use this target to run e2e tests with a gke cluster.
151- # This target uses kind to start a gke k8s cluster and runs the e2e tests
151+ # This target uses kubetest2 to start a gke k8s cluster and runs the e2e tests
152152# against that cluster.
153- # This is the main entrypoint for running the e2e tests on gke kind .
153+ # This is the main entrypoint for running the e2e tests on gke.
154154# This target runs kubetest2 gke that starts a gke cluster
155155# Then kubetest2 tester exec is run which runs the make target
156156# test/e2e/testrunner-gke.
@@ -175,7 +175,7 @@ test/e2e/testrunner-openshift:
175175 bazel test --stamp //e2e/decommission/... --action_env=KUBECONFIG=$(HOME ) /openshift-$(CLUSTER_NAME ) /auth/kubeconfig
176176
177177# Use this target to run e2e tests with a openshift cluster.
178- # This target uses kind to start a openshift cluster and runs the e2e tests
178+ # This target uses kubetest2 to start a openshift cluster and runs the e2e tests
179179# against that cluster. A full TLD is required to creat an openshift clutser.
180180# This target runs kubetest2 openshift that starts a openshift cluster
181181# Then kubetest2 tester exec is run which runs the make target
@@ -257,7 +257,7 @@ dev/syncdeps:
257257 @make dev/syncbazel
258258
259259.PHONY : dev/up
260- dev/up :
260+ dev/up : dev/down
261261 @hack/dev.sh up
262262
263263.PHONY : dev/down
0 commit comments