Skip to content

Commit 107b809

Browse files
fix: test e2e should run make commands
We are running make manifests and make generate in the github action when those should be called by the e2e tests since we can trigger those locally, for example, from IDE to troubleshooting
1 parent a5fe5be commit 107b809

File tree

9 files changed

+97
-20
lines changed

9 files changed

+97
-20
lines changed

.github/workflows/test-e2e-samples.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,9 @@ jobs:
3939
KUSTOMIZATION_FILE_PATH="testdata/project-v4/config/default/kustomization.yaml"
4040
sed -i '25s/^#//' $KUSTOMIZATION_FILE_PATH
4141
sed -i '51s/^#//' $KUSTOMIZATION_FILE_PATH
42+
sed -i '55,151s/^#//' $KUSTOMIZATION_FILE_PATH
4243
cd testdata/project-v4/
4344
go mod tidy
44-
make generate
45-
make manifests
4645
4746
- name: Testing make test-e2e for project-v4
4847
working-directory: testdata/project-v4/
@@ -56,8 +55,6 @@ jobs:
5655
sed -i '51s/^#//' $KUSTOMIZATION_FILE_PATH
5756
cd testdata/project-v4-with-deploy-image/
5857
go mod tidy
59-
make generate
60-
make manifests
6158
6259
# Fixme: The e2e tests for deploy image are failing and we
6360
# need to fix in a follow up

docs/book/src/cronjob-tutorial/testdata/project/test/e2e/e2e_suite_test.go

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,19 @@ func TestE2E(t *testing.T) {
5353
}
5454

5555
var _ = BeforeSuite(func() {
56-
By("building the manager(Operator) image")
57-
cmd := exec.Command("make", "docker-build", fmt.Sprintf("IMG=%s", projectImage))
56+
By("generating files")
57+
cmd := exec.Command("make", "generate")
5858
_, err := utils.Run(cmd)
59+
ExpectWithOffset(1, err).NotTo(HaveOccurred(), "Failed to run make generate")
60+
61+
By("generating manifests")
62+
cmd = exec.Command("make", "manifests")
63+
_, err = utils.Run(cmd)
64+
ExpectWithOffset(1, err).NotTo(HaveOccurred(), "Failed to run make manifests")
65+
66+
By("building the manager(Operator) image")
67+
cmd = exec.Command("make", "docker-build", fmt.Sprintf("IMG=%s", projectImage))
68+
_, err = utils.Run(cmd)
5969
ExpectWithOffset(1, err).NotTo(HaveOccurred(), "Failed to build the manager(Operator) image")
6070

6171
// TODO(user): If you want to change the e2e test vendor from Kind, ensure the image is

docs/book/src/getting-started/testdata/project/test/e2e/e2e_suite_test.go

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,19 @@ func TestE2E(t *testing.T) {
5353
}
5454

5555
var _ = BeforeSuite(func() {
56-
By("building the manager(Operator) image")
57-
cmd := exec.Command("make", "docker-build", fmt.Sprintf("IMG=%s", projectImage))
56+
By("generating files")
57+
cmd := exec.Command("make", "generate")
5858
_, err := utils.Run(cmd)
59+
ExpectWithOffset(1, err).NotTo(HaveOccurred(), "Failed to run make generate")
60+
61+
By("generating manifests")
62+
cmd = exec.Command("make", "manifests")
63+
_, err = utils.Run(cmd)
64+
ExpectWithOffset(1, err).NotTo(HaveOccurred(), "Failed to run make manifests")
65+
66+
By("building the manager(Operator) image")
67+
cmd = exec.Command("make", "docker-build", fmt.Sprintf("IMG=%s", projectImage))
68+
_, err = utils.Run(cmd)
5969
ExpectWithOffset(1, err).NotTo(HaveOccurred(), "Failed to build the manager(Operator) image")
6070

6171
// TODO(user): If you want to change the e2e test vendor from Kind, ensure the image is

pkg/plugins/golang/v4/scaffolds/internal/templates/test/e2e/suite.go

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,19 @@ func TestE2E(t *testing.T) {
7979
}
8080
8181
var _ = BeforeSuite(func() {
82-
By("building the manager(Operator) image")
83-
cmd := exec.Command("make", "docker-build", fmt.Sprintf("IMG=%s", projectImage))
82+
By("generating files")
83+
cmd := exec.Command("make", "generate")
8484
_, err := utils.Run(cmd)
85+
ExpectWithOffset(1, err).NotTo(HaveOccurred(), "Failed to run make generate")
86+
87+
By("generating manifests")
88+
cmd = exec.Command("make", "manifests")
89+
_, err = utils.Run(cmd)
90+
ExpectWithOffset(1, err).NotTo(HaveOccurred(), "Failed to run make manifests")
91+
92+
By("building the manager(Operator) image")
93+
cmd = exec.Command("make", "docker-build", fmt.Sprintf("IMG=%s", projectImage))
94+
_, err = utils.Run(cmd)
8595
ExpectWithOffset(1, err).NotTo(HaveOccurred(), "Failed to build the manager(Operator) image")
8696
8797
// TODO(user): If you want to change the e2e test vendor from Kind, ensure the image is

testdata/project-v4-multigroup-with-deploy-image/test/e2e/e2e_suite_test.go

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,19 @@ func TestE2E(t *testing.T) {
5353
}
5454

5555
var _ = BeforeSuite(func() {
56-
By("building the manager(Operator) image")
57-
cmd := exec.Command("make", "docker-build", fmt.Sprintf("IMG=%s", projectImage))
56+
By("generating files")
57+
cmd := exec.Command("make", "generate")
5858
_, err := utils.Run(cmd)
59+
ExpectWithOffset(1, err).NotTo(HaveOccurred(), "Failed to run make generate")
60+
61+
By("generating manifests")
62+
cmd = exec.Command("make", "manifests")
63+
_, err = utils.Run(cmd)
64+
ExpectWithOffset(1, err).NotTo(HaveOccurred(), "Failed to run make manifests")
65+
66+
By("building the manager(Operator) image")
67+
cmd = exec.Command("make", "docker-build", fmt.Sprintf("IMG=%s", projectImage))
68+
_, err = utils.Run(cmd)
5969
ExpectWithOffset(1, err).NotTo(HaveOccurred(), "Failed to build the manager(Operator) image")
6070

6171
// TODO(user): If you want to change the e2e test vendor from Kind, ensure the image is

testdata/project-v4-multigroup/test/e2e/e2e_suite_test.go

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,19 @@ func TestE2E(t *testing.T) {
5353
}
5454

5555
var _ = BeforeSuite(func() {
56-
By("building the manager(Operator) image")
57-
cmd := exec.Command("make", "docker-build", fmt.Sprintf("IMG=%s", projectImage))
56+
By("generating files")
57+
cmd := exec.Command("make", "generate")
5858
_, err := utils.Run(cmd)
59+
ExpectWithOffset(1, err).NotTo(HaveOccurred(), "Failed to run make generate")
60+
61+
By("generating manifests")
62+
cmd = exec.Command("make", "manifests")
63+
_, err = utils.Run(cmd)
64+
ExpectWithOffset(1, err).NotTo(HaveOccurred(), "Failed to run make manifests")
65+
66+
By("building the manager(Operator) image")
67+
cmd = exec.Command("make", "docker-build", fmt.Sprintf("IMG=%s", projectImage))
68+
_, err = utils.Run(cmd)
5969
ExpectWithOffset(1, err).NotTo(HaveOccurred(), "Failed to build the manager(Operator) image")
6070

6171
// TODO(user): If you want to change the e2e test vendor from Kind, ensure the image is

testdata/project-v4-with-deploy-image/test/e2e/e2e_suite_test.go

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,19 @@ func TestE2E(t *testing.T) {
5353
}
5454

5555
var _ = BeforeSuite(func() {
56-
By("building the manager(Operator) image")
57-
cmd := exec.Command("make", "docker-build", fmt.Sprintf("IMG=%s", projectImage))
56+
By("generating files")
57+
cmd := exec.Command("make", "generate")
5858
_, err := utils.Run(cmd)
59+
ExpectWithOffset(1, err).NotTo(HaveOccurred(), "Failed to run make generate")
60+
61+
By("generating manifests")
62+
cmd = exec.Command("make", "manifests")
63+
_, err = utils.Run(cmd)
64+
ExpectWithOffset(1, err).NotTo(HaveOccurred(), "Failed to run make manifests")
65+
66+
By("building the manager(Operator) image")
67+
cmd = exec.Command("make", "docker-build", fmt.Sprintf("IMG=%s", projectImage))
68+
_, err = utils.Run(cmd)
5969
ExpectWithOffset(1, err).NotTo(HaveOccurred(), "Failed to build the manager(Operator) image")
6070

6171
// TODO(user): If you want to change the e2e test vendor from Kind, ensure the image is

testdata/project-v4-with-grafana/test/e2e/e2e_suite_test.go

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,19 @@ func TestE2E(t *testing.T) {
5353
}
5454

5555
var _ = BeforeSuite(func() {
56-
By("building the manager(Operator) image")
57-
cmd := exec.Command("make", "docker-build", fmt.Sprintf("IMG=%s", projectImage))
56+
By("generating files")
57+
cmd := exec.Command("make", "generate")
5858
_, err := utils.Run(cmd)
59+
ExpectWithOffset(1, err).NotTo(HaveOccurred(), "Failed to run make generate")
60+
61+
By("generating manifests")
62+
cmd = exec.Command("make", "manifests")
63+
_, err = utils.Run(cmd)
64+
ExpectWithOffset(1, err).NotTo(HaveOccurred(), "Failed to run make manifests")
65+
66+
By("building the manager(Operator) image")
67+
cmd = exec.Command("make", "docker-build", fmt.Sprintf("IMG=%s", projectImage))
68+
_, err = utils.Run(cmd)
5969
ExpectWithOffset(1, err).NotTo(HaveOccurred(), "Failed to build the manager(Operator) image")
6070

6171
// TODO(user): If you want to change the e2e test vendor from Kind, ensure the image is

testdata/project-v4/test/e2e/e2e_suite_test.go

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,19 @@ func TestE2E(t *testing.T) {
5353
}
5454

5555
var _ = BeforeSuite(func() {
56-
By("building the manager(Operator) image")
57-
cmd := exec.Command("make", "docker-build", fmt.Sprintf("IMG=%s", projectImage))
56+
By("generating files")
57+
cmd := exec.Command("make", "generate")
5858
_, err := utils.Run(cmd)
59+
ExpectWithOffset(1, err).NotTo(HaveOccurred(), "Failed to run make generate")
60+
61+
By("generating manifests")
62+
cmd = exec.Command("make", "manifests")
63+
_, err = utils.Run(cmd)
64+
ExpectWithOffset(1, err).NotTo(HaveOccurred(), "Failed to run make manifests")
65+
66+
By("building the manager(Operator) image")
67+
cmd = exec.Command("make", "docker-build", fmt.Sprintf("IMG=%s", projectImage))
68+
_, err = utils.Run(cmd)
5969
ExpectWithOffset(1, err).NotTo(HaveOccurred(), "Failed to build the manager(Operator) image")
6070

6171
// TODO(user): If you want to change the e2e test vendor from Kind, ensure the image is

0 commit comments

Comments
 (0)