From 458615a6d5c20c93f82fcf60767d132c1e6d4e7c Mon Sep 17 00:00:00 2001 From: Mateus Oliveira Date: Tue, 7 Jan 2025 03:13:00 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=8C=B1=20:=20fix:=20remove=20unnecessary?= =?UTF-8?q?=20make=20manifests=20and=20make=20generate=20in=20E2E=20scaffo?= =?UTF-8?q?ld=20code=20(#4471)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix: remove unnecessary make manifest and make generate in E2E scaffold code Signed-off-by: Mateus Oliveira --- .../testdata/project/test/e2e/e2e_suite_test.go | 14 ++------------ .../testdata/project/test/e2e/e2e_suite_test.go | 14 ++------------ .../testdata/project/test/e2e/e2e_suite_test.go | 14 ++------------ .../scaffolds/internal/templates/test/e2e/suite.go | 14 ++------------ .../test/e2e/e2e_suite_test.go | 14 ++------------ .../test/e2e/e2e_suite_test.go | 14 ++------------ testdata/project-v4/test/e2e/e2e_suite_test.go | 14 ++------------ 7 files changed, 14 insertions(+), 84 deletions(-) diff --git a/docs/book/src/cronjob-tutorial/testdata/project/test/e2e/e2e_suite_test.go b/docs/book/src/cronjob-tutorial/testdata/project/test/e2e/e2e_suite_test.go index 7b2f3fdd17b..21174e0b4d1 100644 --- a/docs/book/src/cronjob-tutorial/testdata/project/test/e2e/e2e_suite_test.go +++ b/docs/book/src/cronjob-tutorial/testdata/project/test/e2e/e2e_suite_test.go @@ -60,19 +60,9 @@ var _ = BeforeSuite(func() { By("Ensure that Prometheus is enabled") _ = utils.UncommentCode("config/default/kustomization.yaml", "#- ../prometheus", "#") - By("generating files") - cmd := exec.Command("make", "generate") - _, err := utils.Run(cmd) - ExpectWithOffset(1, err).NotTo(HaveOccurred(), "Failed to run make generate") - - By("generating manifests") - cmd = exec.Command("make", "manifests") - _, err = utils.Run(cmd) - ExpectWithOffset(1, err).NotTo(HaveOccurred(), "Failed to run make manifests") - By("building the manager(Operator) image") - cmd = exec.Command("make", "docker-build", fmt.Sprintf("IMG=%s", projectImage)) - _, err = utils.Run(cmd) + cmd := exec.Command("make", "docker-build", fmt.Sprintf("IMG=%s", projectImage)) + _, err := utils.Run(cmd) ExpectWithOffset(1, err).NotTo(HaveOccurred(), "Failed to build the manager(Operator) image") // TODO(user): If you want to change the e2e test vendor from Kind, ensure the image is diff --git a/docs/book/src/getting-started/testdata/project/test/e2e/e2e_suite_test.go b/docs/book/src/getting-started/testdata/project/test/e2e/e2e_suite_test.go index 656df2daef2..73d3845ebda 100644 --- a/docs/book/src/getting-started/testdata/project/test/e2e/e2e_suite_test.go +++ b/docs/book/src/getting-started/testdata/project/test/e2e/e2e_suite_test.go @@ -60,19 +60,9 @@ var _ = BeforeSuite(func() { By("Ensure that Prometheus is enabled") _ = utils.UncommentCode("config/default/kustomization.yaml", "#- ../prometheus", "#") - By("generating files") - cmd := exec.Command("make", "generate") - _, err := utils.Run(cmd) - ExpectWithOffset(1, err).NotTo(HaveOccurred(), "Failed to run make generate") - - By("generating manifests") - cmd = exec.Command("make", "manifests") - _, err = utils.Run(cmd) - ExpectWithOffset(1, err).NotTo(HaveOccurred(), "Failed to run make manifests") - By("building the manager(Operator) image") - cmd = exec.Command("make", "docker-build", fmt.Sprintf("IMG=%s", projectImage)) - _, err = utils.Run(cmd) + cmd := exec.Command("make", "docker-build", fmt.Sprintf("IMG=%s", projectImage)) + _, err := utils.Run(cmd) ExpectWithOffset(1, err).NotTo(HaveOccurred(), "Failed to build the manager(Operator) image") // TODO(user): If you want to change the e2e test vendor from Kind, ensure the image is diff --git a/docs/book/src/multiversion-tutorial/testdata/project/test/e2e/e2e_suite_test.go b/docs/book/src/multiversion-tutorial/testdata/project/test/e2e/e2e_suite_test.go index 7b2f3fdd17b..21174e0b4d1 100644 --- a/docs/book/src/multiversion-tutorial/testdata/project/test/e2e/e2e_suite_test.go +++ b/docs/book/src/multiversion-tutorial/testdata/project/test/e2e/e2e_suite_test.go @@ -60,19 +60,9 @@ var _ = BeforeSuite(func() { By("Ensure that Prometheus is enabled") _ = utils.UncommentCode("config/default/kustomization.yaml", "#- ../prometheus", "#") - By("generating files") - cmd := exec.Command("make", "generate") - _, err := utils.Run(cmd) - ExpectWithOffset(1, err).NotTo(HaveOccurred(), "Failed to run make generate") - - By("generating manifests") - cmd = exec.Command("make", "manifests") - _, err = utils.Run(cmd) - ExpectWithOffset(1, err).NotTo(HaveOccurred(), "Failed to run make manifests") - By("building the manager(Operator) image") - cmd = exec.Command("make", "docker-build", fmt.Sprintf("IMG=%s", projectImage)) - _, err = utils.Run(cmd) + cmd := exec.Command("make", "docker-build", fmt.Sprintf("IMG=%s", projectImage)) + _, err := utils.Run(cmd) ExpectWithOffset(1, err).NotTo(HaveOccurred(), "Failed to build the manager(Operator) image") // TODO(user): If you want to change the e2e test vendor from Kind, ensure the image is diff --git a/pkg/plugins/golang/v4/scaffolds/internal/templates/test/e2e/suite.go b/pkg/plugins/golang/v4/scaffolds/internal/templates/test/e2e/suite.go index b0383e36d4a..526b7b42c3a 100644 --- a/pkg/plugins/golang/v4/scaffolds/internal/templates/test/e2e/suite.go +++ b/pkg/plugins/golang/v4/scaffolds/internal/templates/test/e2e/suite.go @@ -88,19 +88,9 @@ var _ = BeforeSuite(func() { By("Ensure that Prometheus is enabled") _ = utils.UncommentCode("config/default/kustomization.yaml", "#- ../prometheus", "#") - By("generating files") - cmd := exec.Command("make", "generate") - _, err := utils.Run(cmd) - ExpectWithOffset(1, err).NotTo(HaveOccurred(), "Failed to run make generate") - - By("generating manifests") - cmd = exec.Command("make", "manifests") - _, err = utils.Run(cmd) - ExpectWithOffset(1, err).NotTo(HaveOccurred(), "Failed to run make manifests") - By("building the manager(Operator) image") - cmd = exec.Command("make", "docker-build", fmt.Sprintf("IMG=%s", projectImage)) - _, err = utils.Run(cmd) + cmd := exec.Command("make", "docker-build", fmt.Sprintf("IMG=%s", projectImage)) + _, err := utils.Run(cmd) ExpectWithOffset(1, err).NotTo(HaveOccurred(), "Failed to build the manager(Operator) image") // TODO(user): If you want to change the e2e test vendor from Kind, ensure the image is diff --git a/testdata/project-v4-multigroup/test/e2e/e2e_suite_test.go b/testdata/project-v4-multigroup/test/e2e/e2e_suite_test.go index 6b91f51c12f..cdaf8694687 100644 --- a/testdata/project-v4-multigroup/test/e2e/e2e_suite_test.go +++ b/testdata/project-v4-multigroup/test/e2e/e2e_suite_test.go @@ -60,19 +60,9 @@ var _ = BeforeSuite(func() { By("Ensure that Prometheus is enabled") _ = utils.UncommentCode("config/default/kustomization.yaml", "#- ../prometheus", "#") - By("generating files") - cmd := exec.Command("make", "generate") - _, err := utils.Run(cmd) - ExpectWithOffset(1, err).NotTo(HaveOccurred(), "Failed to run make generate") - - By("generating manifests") - cmd = exec.Command("make", "manifests") - _, err = utils.Run(cmd) - ExpectWithOffset(1, err).NotTo(HaveOccurred(), "Failed to run make manifests") - By("building the manager(Operator) image") - cmd = exec.Command("make", "docker-build", fmt.Sprintf("IMG=%s", projectImage)) - _, err = utils.Run(cmd) + cmd := exec.Command("make", "docker-build", fmt.Sprintf("IMG=%s", projectImage)) + _, err := utils.Run(cmd) ExpectWithOffset(1, err).NotTo(HaveOccurred(), "Failed to build the manager(Operator) image") // TODO(user): If you want to change the e2e test vendor from Kind, ensure the image is diff --git a/testdata/project-v4-with-plugins/test/e2e/e2e_suite_test.go b/testdata/project-v4-with-plugins/test/e2e/e2e_suite_test.go index bd1c625d309..85f60d65bfb 100644 --- a/testdata/project-v4-with-plugins/test/e2e/e2e_suite_test.go +++ b/testdata/project-v4-with-plugins/test/e2e/e2e_suite_test.go @@ -60,19 +60,9 @@ var _ = BeforeSuite(func() { By("Ensure that Prometheus is enabled") _ = utils.UncommentCode("config/default/kustomization.yaml", "#- ../prometheus", "#") - By("generating files") - cmd := exec.Command("make", "generate") - _, err := utils.Run(cmd) - ExpectWithOffset(1, err).NotTo(HaveOccurred(), "Failed to run make generate") - - By("generating manifests") - cmd = exec.Command("make", "manifests") - _, err = utils.Run(cmd) - ExpectWithOffset(1, err).NotTo(HaveOccurred(), "Failed to run make manifests") - By("building the manager(Operator) image") - cmd = exec.Command("make", "docker-build", fmt.Sprintf("IMG=%s", projectImage)) - _, err = utils.Run(cmd) + cmd := exec.Command("make", "docker-build", fmt.Sprintf("IMG=%s", projectImage)) + _, err := utils.Run(cmd) ExpectWithOffset(1, err).NotTo(HaveOccurred(), "Failed to build the manager(Operator) image") // TODO(user): If you want to change the e2e test vendor from Kind, ensure the image is diff --git a/testdata/project-v4/test/e2e/e2e_suite_test.go b/testdata/project-v4/test/e2e/e2e_suite_test.go index f43b20bf754..e423e5f95c3 100644 --- a/testdata/project-v4/test/e2e/e2e_suite_test.go +++ b/testdata/project-v4/test/e2e/e2e_suite_test.go @@ -60,19 +60,9 @@ var _ = BeforeSuite(func() { By("Ensure that Prometheus is enabled") _ = utils.UncommentCode("config/default/kustomization.yaml", "#- ../prometheus", "#") - By("generating files") - cmd := exec.Command("make", "generate") - _, err := utils.Run(cmd) - ExpectWithOffset(1, err).NotTo(HaveOccurred(), "Failed to run make generate") - - By("generating manifests") - cmd = exec.Command("make", "manifests") - _, err = utils.Run(cmd) - ExpectWithOffset(1, err).NotTo(HaveOccurred(), "Failed to run make manifests") - By("building the manager(Operator) image") - cmd = exec.Command("make", "docker-build", fmt.Sprintf("IMG=%s", projectImage)) - _, err = utils.Run(cmd) + cmd := exec.Command("make", "docker-build", fmt.Sprintf("IMG=%s", projectImage)) + _, err := utils.Run(cmd) ExpectWithOffset(1, err).NotTo(HaveOccurred(), "Failed to build the manager(Operator) image") // TODO(user): If you want to change the e2e test vendor from Kind, ensure the image is