File tree Expand file tree Collapse file tree 21 files changed +72
-49
lines changed
cronjob-tutorial/testdata/project
getting-started/testdata/project
multiversion-tutorial/testdata/project
pkg/plugins/golang/v4/scaffolds/internal/templates Expand file tree Collapse file tree 21 files changed +72
-49
lines changed Original file line number Diff line number Diff line change 27
27
run : kind version
28
28
29
29
- name : Create kind cluster
30
- run : kind create cluster
30
+ run : kind create cluster --name project-test-e2e
31
31
32
32
- name : Running Test e2e
33
33
run : |
Original file line number Diff line number Diff line change @@ -69,16 +69,19 @@ test: manifests generate fmt vet setup-envtest ## Run tests.
69
69
# The default setup assumes Kind is pre-installed and builds/loads the Manager Docker image locally.
70
70
# CertManager is installed by default; skip with:
71
71
# - CERT_MANAGER_INSTALL_SKIP=true
72
- .PHONY : test -e2e
73
- test -e2e: manifests generate fmt vet # # Run the e2e tests. Expected an isolated environment using Kind.
72
+ .PHONY : setup -e2e-test
73
+ setup -e2e-test : # # Set up a Kind cluster for e2e tests if it does not exist
74
74
@command -v $(KIND ) > /dev/null 2>&1 || { \
75
75
echo " Kind is not installed. Please install Kind manually." ; \
76
76
exit 1; \
77
77
}
78
- @$(KIND ) get clusters | grep -q ' kind ' || { \
79
- echo " No Kind cluster is running. Please start a Kind cluster before running the e2e tests. " ; \
80
- exit 1 ; \
78
+ @$(KIND ) get clusters | grep -q ' project-e2e-test ' || { \
79
+ echo " Kind cluster not running, creating Kind cluster: project- e2e-test " ; \
80
+ $( KIND ) create cluster --name project-e2e-test ; \
81
81
}
82
+
83
+ .PHONY : test-e2e
84
+ test-e2e : setup-e2e-test manifests generate fmt vet # # Run the e2e tests. Expected an isolated environment using Kind.
82
85
go test ./test/e2e/ -v -ginkgo.v
83
86
84
87
.PHONY : lint
Original file line number Diff line number Diff line change @@ -167,7 +167,7 @@ func IsCertManagerCRDsInstalled() bool {
167
167
168
168
// LoadImageToKindClusterWithName loads a local docker image to the kind cluster
169
169
func LoadImageToKindClusterWithName (name string ) error {
170
- cluster := "kind "
170
+ cluster := "project-e2e-test "
171
171
if v , ok := os .LookupEnv ("KIND_CLUSTER" ); ok {
172
172
cluster = v
173
173
}
Original file line number Diff line number Diff line change 27
27
run : kind version
28
28
29
29
- name : Create kind cluster
30
- run : kind create cluster
30
+ run : kind create cluster --name project-test-e2e
31
31
32
32
- name : Running Test e2e
33
33
run : |
Original file line number Diff line number Diff line change @@ -65,16 +65,19 @@ test: manifests generate fmt vet setup-envtest ## Run tests.
65
65
# The default setup assumes Kind is pre-installed and builds/loads the Manager Docker image locally.
66
66
# CertManager is installed by default; skip with:
67
67
# - CERT_MANAGER_INSTALL_SKIP=true
68
- .PHONY : test -e2e
69
- test -e2e: manifests generate fmt vet # # Run the e2e tests. Expected an isolated environment using Kind.
68
+ .PHONY : setup -e2e-test
69
+ setup -e2e-test : # # Set up a Kind cluster for e2e tests if it does not exist
70
70
@command -v $(KIND ) > /dev/null 2>&1 || { \
71
71
echo " Kind is not installed. Please install Kind manually." ; \
72
72
exit 1; \
73
73
}
74
- @$(KIND ) get clusters | grep -q ' kind ' || { \
75
- echo " No Kind cluster is running. Please start a Kind cluster before running the e2e tests. " ; \
76
- exit 1 ; \
74
+ @$(KIND ) get clusters | grep -q ' project-e2e-test ' || { \
75
+ echo " Kind cluster not running, creating Kind cluster: project- e2e-test " ; \
76
+ $( KIND ) create cluster --name project-e2e-test ; \
77
77
}
78
+
79
+ .PHONY : test-e2e
80
+ test-e2e : setup-e2e-test manifests generate fmt vet # # Run the e2e tests. Expected an isolated environment using Kind.
78
81
go test ./test/e2e/ -v -ginkgo.v
79
82
80
83
.PHONY : lint
Original file line number Diff line number Diff line change @@ -167,7 +167,7 @@ func IsCertManagerCRDsInstalled() bool {
167
167
168
168
// LoadImageToKindClusterWithName loads a local docker image to the kind cluster
169
169
func LoadImageToKindClusterWithName (name string ) error {
170
- cluster := "kind "
170
+ cluster := "project-e2e-test "
171
171
if v , ok := os .LookupEnv ("KIND_CLUSTER" ); ok {
172
172
cluster = v
173
173
}
Original file line number Diff line number Diff line change 27
27
run : kind version
28
28
29
29
- name : Create kind cluster
30
- run : kind create cluster
30
+ run : kind create cluster --name project-test-e2e
31
31
32
32
- name : Running Test e2e
33
33
run : |
Original file line number Diff line number Diff line change @@ -69,16 +69,19 @@ test: manifests generate fmt vet setup-envtest ## Run tests.
69
69
# The default setup assumes Kind is pre-installed and builds/loads the Manager Docker image locally.
70
70
# CertManager is installed by default; skip with:
71
71
# - CERT_MANAGER_INSTALL_SKIP=true
72
- .PHONY : test -e2e
73
- test -e2e: manifests generate fmt vet # # Run the e2e tests. Expected an isolated environment using Kind.
72
+ .PHONY : setup -e2e-test
73
+ setup -e2e-test : # # Set up a Kind cluster for e2e tests if it does not exist
74
74
@command -v $(KIND ) > /dev/null 2>&1 || { \
75
75
echo " Kind is not installed. Please install Kind manually." ; \
76
76
exit 1; \
77
77
}
78
- @$(KIND ) get clusters | grep -q ' kind ' || { \
79
- echo " No Kind cluster is running. Please start a Kind cluster before running the e2e tests. " ; \
80
- exit 1 ; \
78
+ @$(KIND ) get clusters | grep -q ' project-e2e-test ' || { \
79
+ echo " Kind cluster not running, creating Kind cluster: project- e2e-test " ; \
80
+ $( KIND ) create cluster --name project-e2e-test ; \
81
81
}
82
+
83
+ .PHONY : test-e2e
84
+ test-e2e : setup-e2e-test manifests generate fmt vet # # Run the e2e tests. Expected an isolated environment using Kind.
82
85
go test ./test/e2e/ -v -ginkgo.v
83
86
84
87
.PHONY : lint
Original file line number Diff line number Diff line change @@ -167,7 +167,7 @@ func IsCertManagerCRDsInstalled() bool {
167
167
168
168
// LoadImageToKindClusterWithName loads a local docker image to the kind cluster
169
169
func LoadImageToKindClusterWithName (name string ) error {
170
- cluster := "kind "
170
+ cluster := "project-e2e-test "
171
171
if v , ok := os .LookupEnv ("KIND_CLUSTER" ); ok {
172
172
cluster = v
173
173
}
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ var _ machinery.Template = &E2eTestCi{}
28
28
type E2eTestCi struct {
29
29
machinery.TemplateMixin
30
30
machinery.BoilerplateMixin
31
+ machinery.ProjectNameMixin
31
32
}
32
33
33
34
// SetTemplateDefaults implements machinery.Template
72
73
run: kind version
73
74
74
75
- name: Create kind cluster
75
- run: kind create cluster
76
+ run: kind create cluster --name {{ .ProjectName }}-test-e2e
76
77
77
78
- name: Running Test e2e
78
79
run: |
You can’t perform that action at this time.
0 commit comments