@@ -307,7 +307,7 @@ func pollStackDeployments(t *testing.T, ctx context.Context, client *Client, sta
307
307
defer cancel ()
308
308
309
309
deadline , _ := ctx .Deadline ()
310
- t .Logf ("Polling stack %q for deployments with deadline of %s" , stackID , deadline )
310
+ t .Logf ("Polling stack %q for deployment groups with deadline of %s" , stackID , deadline )
311
311
312
312
ticker := time .NewTicker (2 * time .Second )
313
313
defer ticker .Stop ()
@@ -316,16 +316,22 @@ func pollStackDeployments(t *testing.T, ctx context.Context, client *Client, sta
316
316
t .Log ("..." )
317
317
select {
318
318
case <- ctx .Done ():
319
- t .Fatalf ("Stack %q had no deployments at deadline" , stackID )
319
+ t .Fatalf ("Stack %q had no deployment groups at deadline" , stackID )
320
320
case <- ticker .C :
321
321
var err error
322
- stack , err = client .Stacks .Read (ctx , stackID , nil )
322
+ stack , err = client .Stacks .Read (ctx , stackID , & StackReadOptions {
323
+ Include : []StackIncludeOpt {StackIncludeLatestStackConfiguration },
324
+ })
323
325
if err != nil {
324
326
t .Fatalf ("Failed to read stack %q: %s" , stackID , err )
325
327
}
328
+ groups , err := client .StackDeploymentGroups .List (ctx , stack .LatestStackConfiguration .ID , nil )
329
+ if err != nil {
330
+ t .Fatalf ("Failed to read deployment groups %q: %s" , stackID , err )
331
+ }
326
332
327
- t .Logf ("Stack %q had %d deployments " , stack .ID , len (stack .DeploymentNames ))
328
- if len ( stack . DeploymentNames ) > 0 {
333
+ t .Logf ("Stack %q had %d deployment groups " , stack .ID , len (stack .DeploymentNames ))
334
+ if groups . TotalCount > 0 {
329
335
finished = true
330
336
}
331
337
}
0 commit comments