@@ -74,21 +74,24 @@ var _ = Describe("kubebuilder", func() {
7474 validateProjectFile (kbc , filepath .Join (kbc .Dir , "PROJECT" ))
7575 })
7676
77- It ("should regenerate project with grafana plugin with success" , func () {
78- generateProjectWithGrafanaPlugin (kbc )
79- regenerateProjectWith (kbc , projectOutputDir )
80- validateGrafanaPlugin (projectFilePath )
81- })
77+ It ("should regenerate project with plugins with success" , func () {
78+ By ("Enabling the Grafana plugin" )
79+ err := kbc .Edit ("--plugins" , "grafana.kubebuilder.io/v1-alpha" )
80+ Expect (err ).NotTo (HaveOccurred (), "Failed to edit project to enable Grafana Plugin" )
8281
83- It ("should regenerate project with DeployImage plugin with success" , func () {
84- generateProjectWithDeployImagePlugin (kbc )
85- regenerateProjectWith (kbc , projectOutputDir )
86- validateDeployImagePlugin (projectFilePath )
87- })
82+ By ("Generate API with Deploy Image plugin" )
83+ generateAPIWithDeployImage (kbc )
84+
85+ By ("Enabling Helm plugin" )
86+ err = kbc .Edit ("--plugins" , "helm.kubebuilder.io/v1-alpha" )
87+ Expect (err ).NotTo (HaveOccurred (), "Failed to edit project to enable Helm Plugin" )
8888
89- It ("should regenerate project with helm plugin with success" , func () {
90- generateProjectWithHelmPlugin (kbc )
89+ By ("Re-generating the project with plugins" )
9190 regenerateProjectWith (kbc , projectOutputDir )
91+
92+ By ("By validating the expected scaffolded files" )
93+ validateGrafanaPlugin (projectFilePath )
94+ validateDeployImagePlugin (projectFilePath )
9295 validateHelmPlugin (projectFilePath )
9396 })
9497 })
@@ -200,19 +203,7 @@ func regenerateProjectWith(kbc *utils.TestContext, projectOutputDir string) {
200203 Expect (err ).NotTo (HaveOccurred (), "Failed to regenerate project" )
201204}
202205
203- func generateProjectWithGrafanaPlugin (kbc * utils.TestContext ) {
204- By ("editing project to enable Grafana plugin" )
205- err := kbc .Edit ("--plugins" , "grafana.kubebuilder.io/v1-alpha" )
206- Expect (err ).NotTo (HaveOccurred (), "Failed to edit project to enable Grafana Plugin" )
207- }
208-
209- func generateProjectWithHelmPlugin (kbc * utils.TestContext ) {
210- By ("editing project to enable Helm plugin" )
211- err := kbc .Edit ("--plugins" , "helm.kubebuilder.io/v1-alpha" )
212- Expect (err ).NotTo (HaveOccurred (), "Failed to edit project to enable Helm Plugin" )
213- }
214-
215- func generateProjectWithDeployImagePlugin (kbc * utils.TestContext ) {
206+ func generateAPIWithDeployImage (kbc * utils.TestContext ) {
216207 By ("creating an API with DeployImage plugin" )
217208 err := kbc .CreateAPI (
218209 "--group" , "crew" ,
0 commit comments