File tree 21 files changed +86
-70
lines changed
cronjob-tutorial/testdata/project
getting-started/testdata/project
multiversion-tutorial/testdata/project
pkg/plugins/golang/v4/scaffolds/internal/templates
21 files changed +86
-70
lines changed Original file line number Diff line number Diff line change 26
26
- name : Verify kind installation
27
27
run : kind version
28
28
29
- - name : Create kind cluster
30
- run : kind create cluster
31
-
32
29
- name : Running Test e2e
33
30
run : |
34
31
go mod tidy
Original file line number Diff line number Diff line change @@ -69,17 +69,22 @@ 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- test-e2e
73
+ setup- test-e2e : # # 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 ; \
81
- }
78
+ $(KIND ) create cluster --name project-test-e2e --wait 5m
79
+
80
+ .PHONY : test-e2e
81
+ test-e2e : setup-test-e2e manifests generate fmt vet # # Run the e2e tests. Expected an isolated environment using Kind.
82
82
go test ./test/e2e/ -v -ginkgo.v
83
+ $(MAKE ) teardown-test-e2e
84
+
85
+ .PHONY : teardown-test-e2e
86
+ teardown-test-e2e : # # Tear down the Kind cluster used for e2e tests
87
+ @$(KIND ) delete cluster --name project-test-e2e
83
88
84
89
.PHONY : lint
85
90
lint : golangci-lint # # Run golangci-lint linter
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-test-e2e "
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 26
26
- name : Verify kind installation
27
27
run : kind version
28
28
29
- - name : Create kind cluster
30
- run : kind create cluster
31
-
32
29
- name : Running Test e2e
33
30
run : |
34
31
go mod tidy
Original file line number Diff line number Diff line change @@ -65,17 +65,22 @@ 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- test-e2e
69
+ setup- test-e2e : # # 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 ; \
77
- }
74
+ $(KIND ) create cluster --name project-test-e2e --wait 5m
75
+
76
+ .PHONY : test-e2e
77
+ test-e2e : setup-test-e2e manifests generate fmt vet # # Run the e2e tests. Expected an isolated environment using Kind.
78
78
go test ./test/e2e/ -v -ginkgo.v
79
+ $(MAKE ) teardown-test-e2e
80
+
81
+ .PHONY : teardown-test-e2e
82
+ teardown-test-e2e : # # Tear down the Kind cluster used for e2e tests
83
+ @$(KIND ) delete cluster --name project-test-e2e
79
84
80
85
.PHONY : lint
81
86
lint : golangci-lint # # Run golangci-lint linter
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-test-e2e "
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 26
26
- name : Verify kind installation
27
27
run : kind version
28
28
29
- - name : Create kind cluster
30
- run : kind create cluster
31
-
32
29
- name : Running Test e2e
33
30
run : |
34
31
go mod tidy
Original file line number Diff line number Diff line change @@ -69,17 +69,22 @@ 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- test-e2e
73
+ setup- test-e2e : # # 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 ; \
81
- }
78
+ $(KIND ) create cluster --name project-test-e2e --wait 5m
79
+
80
+ .PHONY : test-e2e
81
+ test-e2e : setup-test-e2e manifests generate fmt vet # # Run the e2e tests. Expected an isolated environment using Kind.
82
82
go test ./test/e2e/ -v -ginkgo.v
83
+ $(MAKE ) teardown-test-e2e
84
+
85
+ .PHONY : teardown-test-e2e
86
+ teardown-test-e2e : # # Tear down the Kind cluster used for e2e tests
87
+ @$(KIND ) delete cluster --name project-test-e2e
83
88
84
89
.PHONY : lint
85
90
lint : golangci-lint # # Run golangci-lint linter
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-test-e2e "
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
71
72
- name: Verify kind installation
72
73
run: kind version
73
74
74
- - name: Create kind cluster
75
- run: kind create cluster
76
-
77
75
- name: Running Test e2e
78
76
run: |
79
77
go mod tidy
Original file line number Diff line number Diff line change @@ -144,17 +144,22 @@ test: manifests generate fmt vet setup-envtest ## Run tests.
144
144
# The default setup assumes Kind is pre-installed and builds/loads the Manager Docker image locally.
145
145
# CertManager is installed by default; skip with:
146
146
# - CERT_MANAGER_INSTALL_SKIP=true
147
- .PHONY: test-e2e
148
- test-e2e: manifests generate fmt vet ## Run the e2e tests. Expected an isolated environment using Kind.
147
+ .PHONY: setup- test-e2e
148
+ setup- test-e2e: ## Set up a Kind cluster for e2e tests if it does not exist
149
149
@command -v $(KIND) >/dev/null 2>&1 || { \
150
150
echo "Kind is not installed. Please install Kind manually."; \
151
151
exit 1; \
152
152
}
153
- @ $(KIND) get clusters | grep -q 'kind' || { \
154
- echo "No Kind cluster is running. Please start a Kind cluster before running the e2e tests."; \
155
- exit 1; \
156
- }
153
+ $(KIND) create cluster --name {{ .ProjectName }}-test-e2e --wait 5m
154
+
155
+ .PHONY: test-e2e
156
+ test-e2e: setup-test-e2e manifests generate fmt vet ## Run the e2e tests. Expected an isolated environment using Kind.
157
157
go test ./test/e2e/ -v -ginkgo.v
158
+ $(MAKE) teardown-test-e2e
159
+
160
+ .PHONY: teardown-test-e2e
161
+ teardown-test-e2e: ## Tear down the Kind cluster used for e2e tests
162
+ @$(KIND) delete cluster --name {{ .ProjectName }}-test-e2e
158
163
159
164
.PHONY: lint
160
165
lint: golangci-lint ## Run golangci-lint linter
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ var _ machinery.Template = &Utils{}
26
26
type Utils struct {
27
27
machinery.TemplateMixin
28
28
machinery.BoilerplateMixin
29
+ machinery.ProjectNameMixin
29
30
}
30
31
31
32
// SetTemplateDefaults set the defaults for its template
@@ -194,7 +195,7 @@ func IsCertManagerCRDsInstalled() bool {
194
195
195
196
// LoadImageToKindClusterWithName loads a local docker image to the kind cluster
196
197
func LoadImageToKindClusterWithName(name string) error {
197
- cluster := "kind "
198
+ cluster := "{{ .ProjectName }}-test-e2e "
198
199
if v, ok := os.LookupEnv("KIND_CLUSTER"); ok {
199
200
cluster = v
200
201
}
Original file line number Diff line number Diff line change 26
26
- name : Verify kind installation
27
27
run : kind version
28
28
29
- - name : Create kind cluster
30
- run : kind create cluster
31
-
32
29
- name : Running Test e2e
33
30
run : |
34
31
go mod tidy
Original file line number Diff line number Diff line change @@ -65,17 +65,22 @@ 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- test-e2e
69
+ setup- test-e2e : # # 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 ; \
77
- }
74
+ $(KIND ) create cluster --name project-v4-multigroup-test-e2e --wait 5m
75
+
76
+ .PHONY : test-e2e
77
+ test-e2e : setup-test-e2e manifests generate fmt vet # # Run the e2e tests. Expected an isolated environment using Kind.
78
78
go test ./test/e2e/ -v -ginkgo.v
79
+ $(MAKE ) teardown-test-e2e
80
+
81
+ .PHONY : teardown-test-e2e
82
+ teardown-test-e2e : # # Tear down the Kind cluster used for e2e tests
83
+ @$(KIND ) delete cluster --name project-v4-multigroup-test-e2e
79
84
80
85
.PHONY : lint
81
86
lint : golangci-lint # # Run golangci-lint linter
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-v4-multigroup-test-e2e "
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 26
26
- name : Verify kind installation
27
27
run : kind version
28
28
29
- - name : Create kind cluster
30
- run : kind create cluster
31
-
32
29
- name : Running Test e2e
33
30
run : |
34
31
go mod tidy
Original file line number Diff line number Diff line change @@ -65,17 +65,22 @@ 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- test-e2e
69
+ setup- test-e2e : # # 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 ; \
77
- }
74
+ $(KIND ) create cluster --name project-v4-with-plugins-test-e2e --wait 5m
75
+
76
+ .PHONY : test-e2e
77
+ test-e2e : setup-test-e2e manifests generate fmt vet # # Run the e2e tests. Expected an isolated environment using Kind.
78
78
go test ./test/e2e/ -v -ginkgo.v
79
+ $(MAKE ) teardown-test-e2e
80
+
81
+ .PHONY : teardown-test-e2e
82
+ teardown-test-e2e : # # Tear down the Kind cluster used for e2e tests
83
+ @$(KIND ) delete cluster --name project-v4-with-plugins-test-e2e
79
84
80
85
.PHONY : lint
81
86
lint : golangci-lint # # Run golangci-lint linter
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-v4-with-plugins-test-e2e "
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 26
26
- name : Verify kind installation
27
27
run : kind version
28
28
29
- - name : Create kind cluster
30
- run : kind create cluster
31
-
32
29
- name : Running Test e2e
33
30
run : |
34
31
go mod tidy
Original file line number Diff line number Diff line change @@ -65,17 +65,22 @@ 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- test-e2e
69
+ setup- test-e2e : # # 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 ; \
77
- }
74
+ $(KIND ) create cluster --name project-v4-test-e2e --wait 5m
75
+
76
+ .PHONY : test-e2e
77
+ test-e2e : setup-test-e2e manifests generate fmt vet # # Run the e2e tests. Expected an isolated environment using Kind.
78
78
go test ./test/e2e/ -v -ginkgo.v
79
+ $(MAKE ) teardown-test-e2e
80
+
81
+ .PHONY : teardown-test-e2e
82
+ teardown-test-e2e : # # Tear down the Kind cluster used for e2e tests
83
+ @$(KIND ) delete cluster --name project-v4-test-e2e
79
84
80
85
.PHONY : lint
81
86
lint : golangci-lint # # Run golangci-lint linter
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-v4-test-e2e "
171
171
if v , ok := os .LookupEnv ("KIND_CLUSTER" ); ok {
172
172
cluster = v
173
173
}
You can’t perform that action at this time.
0 commit comments