@@ -241,7 +241,10 @@ var _ = Describe("Reconcile", func() {
241
241
Context ("and the service has no deploy or healthcheck config" , func () {
242
242
BeforeEach (func () {
243
243
workingDir = "testdata/reconcile-service-basic"
244
- overrideFiles = []string {workingDir + "/docker-compose.kev.dev.yaml" }
244
+ overrideFiles = []string {
245
+ workingDir + "/docker-compose.kev.dev.yaml" ,
246
+ workingDir + "/docker-compose.kev.stage.yaml" ,
247
+ }
245
248
})
246
249
247
250
It ("confirms the number of services pre reconciliation" , func () {
@@ -250,19 +253,32 @@ var _ = Describe("Reconcile", func() {
250
253
})
251
254
252
255
It ("should add the new service to all environments" , func () {
253
- Expect (env .GetServices ()).To (HaveLen (2 ))
254
- Expect (env .GetServices ()[0 ].Name ).To (Equal ("db" ))
255
- Expect (env .GetServices ()[1 ].Name ).To (Equal ("wordpress" ))
256
+ envs , err := manifest .GetEnvironments ([]string {"dev" , "stage" })
257
+ Expect (err ).ToNot (HaveOccurred ())
258
+ for _ , env := range envs {
259
+ Expect (env .GetServices ()).To (HaveLen (2 ), "failed for env: %s" , env .Name )
260
+ Expect (env .GetServices ()[0 ].Name ).To (Equal ("db" ), "failed for env: %s" , env .Name )
261
+ Expect (env .GetServices ()[1 ].Name ).To (Equal ("wordpress" ), "failed for env: %s" , env .Name )
262
+ }
256
263
})
257
264
258
- It ("should configure the added service extension value defaults" , func () {
265
+ It ("should configure the added service extension value defaults in all environments " , func () {
259
266
expected , err := newMinifiedServiceExtensions ("wordpress" )
260
267
Expect (err ).NotTo (HaveOccurred ())
261
- Expect (env .GetServices ()[1 ].Extensions ).To (Equal (expected ))
268
+
269
+ envs , err := manifest .GetEnvironments ([]string {"dev" , "stage" })
270
+ Expect (err ).ToNot (HaveOccurred ())
271
+ for _ , env := range envs {
272
+ Expect (env .GetServices ()[1 ].Extensions ).To (Equal (expected ), "failed for env: %s" , env .Name )
273
+ }
262
274
})
263
275
264
- It ("should not include any env vars" , func () {
265
- Expect (env .GetServices ()[1 ].Environment ).To (HaveLen (0 ))
276
+ It ("should not include any env vars in any environments" , func () {
277
+ envs , err := manifest .GetEnvironments ([]string {"dev" , "stage" })
278
+ Expect (err ).ToNot (HaveOccurred ())
279
+ for _ , env := range envs {
280
+ Expect (env .GetServices ()[1 ].Environment ).To (HaveLen (0 ), "failed for env: %s" , env .Name )
281
+ }
266
282
})
267
283
268
284
It ("should log the change summary using the debug level" , func () {
@@ -321,21 +337,30 @@ var _ = Describe("Reconcile", func() {
321
337
Context ("when a new compose volume has been added" , func () {
322
338
BeforeEach (func () {
323
339
workingDir = "testdata/reconcile-volume-add"
324
- overrideFiles = []string {workingDir + "/docker-compose.kev.dev.yaml" }
340
+ overrideFiles = []string {
341
+ workingDir + "/docker-compose.kev.dev.yaml" ,
342
+ workingDir + "/docker-compose.kev.stage.yaml" ,
343
+ }
325
344
})
326
345
327
346
It ("confirms the number of volumes pre reconciliation" , func () {
328
347
Expect (override .Volumes ).To (HaveLen (0 ))
329
348
})
330
349
331
350
It ("should add the new volumes to all environments" , func () {
332
- Expect (env .GetVolumes ()).To (HaveLen (1 ))
351
+ envs , err := manifest .GetEnvironments ([]string {"dev" , "stage" })
352
+ Expect (err ).ToNot (HaveOccurred ())
353
+
354
+ for _ , env := range envs {
355
+ Expect (env .GetVolumes ()).To (HaveLen (1 ))
356
+
357
+ v , _ := env .GetVolume ("db_data" )
358
+ volExt := v .Extensions [config .K8SExtensionKey ].(map [string ]interface {})
333
359
334
- v , _ := env .GetVolume ("db_data" )
335
- volExt := v .Extensions [config .K8SExtensionKey ].(map [string ]interface {})
360
+ Expect (v .Extensions ).To (HaveLen (1 ), "failed for env: %s" , env .Name )
361
+ Expect (volExt ["size" ]).To (Equal ("100Mi" ), "failed for env: %s" , env .Name )
362
+ }
336
363
337
- Expect (v .Extensions ).To (HaveLen (1 ))
338
- Expect (volExt ["size" ]).To (Equal ("100Mi" ))
339
364
})
340
365
341
366
It ("should log the change summary using the debug level" , func () {
0 commit comments