Skip to content

Commit c72aa30

Browse files
committed
Update pollStackDeployments to look at deploymentGroups
1 parent 48df569 commit c72aa30

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

stack_integration_test.go

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ func pollStackDeployments(t *testing.T, ctx context.Context, client *Client, sta
307307
defer cancel()
308308

309309
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)
311311

312312
ticker := time.NewTicker(2 * time.Second)
313313
defer ticker.Stop()
@@ -316,16 +316,22 @@ func pollStackDeployments(t *testing.T, ctx context.Context, client *Client, sta
316316
t.Log("...")
317317
select {
318318
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)
320320
case <-ticker.C:
321321
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+
})
323325
if err != nil {
324326
t.Fatalf("Failed to read stack %q: %s", stackID, err)
325327
}
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+
}
326332

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 {
329335
finished = true
330336
}
331337
}

0 commit comments

Comments
 (0)