From c4c93ac88b8957263b7d3f7a5fe890ae848fd33d Mon Sep 17 00:00:00 2001 From: Marco Cadetg Date: Thu, 15 Feb 2024 14:17:38 +0100 Subject: [PATCH 1/2] fix: scaffolding e2e template err check --- .../golang/v4/scaffolds/internal/templates/test/e2e/test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/plugins/golang/v4/scaffolds/internal/templates/test/e2e/test.go b/pkg/plugins/golang/v4/scaffolds/internal/templates/test/e2e/test.go index 3a242614598..66f93be8259 100644 --- a/pkg/plugins/golang/v4/scaffolds/internal/templates/test/e2e/test.go +++ b/pkg/plugins/golang/v4/scaffolds/internal/templates/test/e2e/test.go @@ -101,6 +101,7 @@ var _ = Describe("controller", Ordered, func() { By("installing CRDs") cmd = exec.Command("make", "install") _, err = utils.Run(cmd) + ExpectWithOffset(1, err).NotTo(HaveOccurred()) By("deploying the controller-manager") cmd = exec.Command("make", "deploy", fmt.Sprintf("IMG=%s", projectimage)) From 1d28efd23241299e5e72432c8cde961b38619802 Mon Sep 17 00:00:00 2001 From: Marco Cadetg Date: Thu, 15 Feb 2024 21:48:23 +0100 Subject: [PATCH 2/2] generate testdata samples --- .../testdata/project/test/e2e/e2e_test.go | 1 + .../src/cronjob-tutorial/testdata/project/test/e2e/e2e_test.go | 1 + .../src/getting-started/testdata/project/test/e2e/e2e_test.go | 1 + .../project-v4-multigroup-with-deploy-image/test/e2e/e2e_test.go | 1 + testdata/project-v4-multigroup/test/e2e/e2e_test.go | 1 + testdata/project-v4-with-deploy-image/test/e2e/e2e_test.go | 1 + testdata/project-v4-with-grafana/test/e2e/e2e_test.go | 1 + testdata/project-v4/test/e2e/e2e_test.go | 1 + 8 files changed, 8 insertions(+) diff --git a/docs/book/src/component-config-tutorial/testdata/project/test/e2e/e2e_test.go b/docs/book/src/component-config-tutorial/testdata/project/test/e2e/e2e_test.go index 86ea48b830f..1193e5f1532 100644 --- a/docs/book/src/component-config-tutorial/testdata/project/test/e2e/e2e_test.go +++ b/docs/book/src/component-config-tutorial/testdata/project/test/e2e/e2e_test.go @@ -74,6 +74,7 @@ var _ = Describe("controller", Ordered, func() { By("installing CRDs") cmd = exec.Command("make", "install") _, err = utils.Run(cmd) + ExpectWithOffset(1, err).NotTo(HaveOccurred()) By("deploying the controller-manager") cmd = exec.Command("make", "deploy", fmt.Sprintf("IMG=%s", projectimage)) diff --git a/docs/book/src/cronjob-tutorial/testdata/project/test/e2e/e2e_test.go b/docs/book/src/cronjob-tutorial/testdata/project/test/e2e/e2e_test.go index 86ea48b830f..1193e5f1532 100644 --- a/docs/book/src/cronjob-tutorial/testdata/project/test/e2e/e2e_test.go +++ b/docs/book/src/cronjob-tutorial/testdata/project/test/e2e/e2e_test.go @@ -74,6 +74,7 @@ var _ = Describe("controller", Ordered, func() { By("installing CRDs") cmd = exec.Command("make", "install") _, err = utils.Run(cmd) + ExpectWithOffset(1, err).NotTo(HaveOccurred()) By("deploying the controller-manager") cmd = exec.Command("make", "deploy", fmt.Sprintf("IMG=%s", projectimage)) diff --git a/docs/book/src/getting-started/testdata/project/test/e2e/e2e_test.go b/docs/book/src/getting-started/testdata/project/test/e2e/e2e_test.go index e364a6fd139..c6b17a62f5e 100644 --- a/docs/book/src/getting-started/testdata/project/test/e2e/e2e_test.go +++ b/docs/book/src/getting-started/testdata/project/test/e2e/e2e_test.go @@ -74,6 +74,7 @@ var _ = Describe("controller", Ordered, func() { By("installing CRDs") cmd = exec.Command("make", "install") _, err = utils.Run(cmd) + ExpectWithOffset(1, err).NotTo(HaveOccurred()) By("deploying the controller-manager") cmd = exec.Command("make", "deploy", fmt.Sprintf("IMG=%s", projectimage)) diff --git a/testdata/project-v4-multigroup-with-deploy-image/test/e2e/e2e_test.go b/testdata/project-v4-multigroup-with-deploy-image/test/e2e/e2e_test.go index 1d78418758d..619c7651e00 100644 --- a/testdata/project-v4-multigroup-with-deploy-image/test/e2e/e2e_test.go +++ b/testdata/project-v4-multigroup-with-deploy-image/test/e2e/e2e_test.go @@ -74,6 +74,7 @@ var _ = Describe("controller", Ordered, func() { By("installing CRDs") cmd = exec.Command("make", "install") _, err = utils.Run(cmd) + ExpectWithOffset(1, err).NotTo(HaveOccurred()) By("deploying the controller-manager") cmd = exec.Command("make", "deploy", fmt.Sprintf("IMG=%s", projectimage)) diff --git a/testdata/project-v4-multigroup/test/e2e/e2e_test.go b/testdata/project-v4-multigroup/test/e2e/e2e_test.go index 17adfaae536..3f427fde7b4 100644 --- a/testdata/project-v4-multigroup/test/e2e/e2e_test.go +++ b/testdata/project-v4-multigroup/test/e2e/e2e_test.go @@ -74,6 +74,7 @@ var _ = Describe("controller", Ordered, func() { By("installing CRDs") cmd = exec.Command("make", "install") _, err = utils.Run(cmd) + ExpectWithOffset(1, err).NotTo(HaveOccurred()) By("deploying the controller-manager") cmd = exec.Command("make", "deploy", fmt.Sprintf("IMG=%s", projectimage)) diff --git a/testdata/project-v4-with-deploy-image/test/e2e/e2e_test.go b/testdata/project-v4-with-deploy-image/test/e2e/e2e_test.go index 16b3d708319..8e53b230045 100644 --- a/testdata/project-v4-with-deploy-image/test/e2e/e2e_test.go +++ b/testdata/project-v4-with-deploy-image/test/e2e/e2e_test.go @@ -74,6 +74,7 @@ var _ = Describe("controller", Ordered, func() { By("installing CRDs") cmd = exec.Command("make", "install") _, err = utils.Run(cmd) + ExpectWithOffset(1, err).NotTo(HaveOccurred()) By("deploying the controller-manager") cmd = exec.Command("make", "deploy", fmt.Sprintf("IMG=%s", projectimage)) diff --git a/testdata/project-v4-with-grafana/test/e2e/e2e_test.go b/testdata/project-v4-with-grafana/test/e2e/e2e_test.go index 875ab54ad58..18448c90e19 100644 --- a/testdata/project-v4-with-grafana/test/e2e/e2e_test.go +++ b/testdata/project-v4-with-grafana/test/e2e/e2e_test.go @@ -74,6 +74,7 @@ var _ = Describe("controller", Ordered, func() { By("installing CRDs") cmd = exec.Command("make", "install") _, err = utils.Run(cmd) + ExpectWithOffset(1, err).NotTo(HaveOccurred()) By("deploying the controller-manager") cmd = exec.Command("make", "deploy", fmt.Sprintf("IMG=%s", projectimage)) diff --git a/testdata/project-v4/test/e2e/e2e_test.go b/testdata/project-v4/test/e2e/e2e_test.go index c57a2b5b607..5dfdb827a21 100644 --- a/testdata/project-v4/test/e2e/e2e_test.go +++ b/testdata/project-v4/test/e2e/e2e_test.go @@ -74,6 +74,7 @@ var _ = Describe("controller", Ordered, func() { By("installing CRDs") cmd = exec.Command("make", "install") _, err = utils.Run(cmd) + ExpectWithOffset(1, err).NotTo(HaveOccurred()) By("deploying the controller-manager") cmd = exec.Command("make", "deploy", fmt.Sprintf("IMG=%s", projectimage))