@@ -74,21 +74,24 @@ var _ = Describe("kubebuilder", func() {
74
74
validateProjectFile (kbc , filepath .Join (kbc .Dir , "PROJECT" ))
75
75
})
76
76
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" )
82
81
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" )
88
88
89
- It ("should regenerate project with helm plugin with success" , func () {
90
- generateProjectWithHelmPlugin (kbc )
89
+ By ("Re-generating the project with plugins" )
91
90
regenerateProjectWith (kbc , projectOutputDir )
91
+
92
+ By ("By validating the expected scaffolded files" )
93
+ validateGrafanaPlugin (projectFilePath )
94
+ validateDeployImagePlugin (projectFilePath )
92
95
validateHelmPlugin (projectFilePath )
93
96
})
94
97
})
@@ -200,19 +203,7 @@ func regenerateProjectWith(kbc *utils.TestContext, projectOutputDir string) {
200
203
Expect (err ).NotTo (HaveOccurred (), "Failed to regenerate project" )
201
204
}
202
205
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 ) {
216
207
By ("creating an API with DeployImage plugin" )
217
208
err := kbc .CreateAPI (
218
209
"--group" , "crew" ,
0 commit comments