Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
liamcervante committed May 15, 2024
1 parent fd21d76 commit a52de21
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions internal/stacks/stackruntime/plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ func Plan(ctx context.Context, req *PlanRequest, resp *PlanResponse) {
ProviderFactories: req.ProviderFactories,

ForcePlanTimestamp: req.ForcePlanTimestamp,
DeferralAllowed: req.DeferralAllowed,
})
main.AllowLanguageExperiments(req.ExperimentsAllowed)
main.PlanAll(ctx, stackeval.PlanOutput{
Expand Down Expand Up @@ -100,6 +101,7 @@ type PlanRequest struct {
ForcePlanTimestamp *time.Time

ExperimentsAllowed bool
DeferralAllowed bool
}

// PlanResponse is used by [Plan] to describe the results of planning.
Expand Down
8 changes: 7 additions & 1 deletion internal/stacks/stackruntime/plan_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1602,6 +1602,12 @@ func TestPlanWithDeferredResource(t *testing.T) {
Value: cty.BoolVal(true),
},
},
// TEMP: Currently there's no way in normal operation to set this to
// true in the PlanOpts, because it would regress other features. So,
// the test has to set it manually. In the future, deferred actions will
// always be enabled for stacks, and we'll remove this option from the
// stackeval.PlanOpts struct.
DeferralAllowed: true,
}
resp := PlanResponse{
PlannedChanges: changesCh,
Expand Down Expand Up @@ -1635,7 +1641,7 @@ func TestPlanWithDeferredResource(t *testing.T) {
Component: stackaddrs.Component{Name: "self"},
},
),
PlanComplete: true, // TODO(TF-15444, TF-15442): This should be false
PlanComplete: false,
PlanApplyable: false, // We don't have any resources to apply since they're deferred.
Action: plans.Create,
PlannedInputValues: map[string]plans.DynamicValue{
Expand Down

0 comments on commit a52de21

Please sign in to comment.