@@ -107,6 +107,11 @@ func testStepNewConfig(ctx context.Context, t testing.T, c TestCase, wd *plugint
107107 if step .Destroy {
108108 opts = append (opts , tfexec .Destroy (true ))
109109 }
110+
111+ if c .AdditionalCLIOptions != nil && c .AdditionalCLIOptions .Plan .AllowDeferral {
112+ opts = append (opts , tfexec .AllowDeferral (true ))
113+ }
114+
110115 return wd .CreatePlan (ctx , opts ... )
111116 }, wd , providers )
112117 if err != nil {
@@ -168,7 +173,13 @@ func testStepNewConfig(ctx context.Context, t testing.T, c TestCase, wd *plugint
168173
169174 // Apply the diff, creating real resources
170175 err = runProviderCommand (ctx , t , func () error {
171- return wd .Apply (ctx )
176+ var opts []tfexec.ApplyOption
177+
178+ if c .AdditionalCLIOptions != nil && c .AdditionalCLIOptions .Apply .AllowDeferral {
179+ opts = append (opts , tfexec .AllowDeferral (true ))
180+ }
181+
182+ return wd .Apply (ctx , opts ... )
172183 }, wd , providers )
173184 if err != nil {
174185 if step .Destroy {
@@ -238,6 +249,11 @@ func testStepNewConfig(ctx context.Context, t testing.T, c TestCase, wd *plugint
238249 if step .Destroy {
239250 opts = append (opts , tfexec .Destroy (true ))
240251 }
252+
253+ if c .AdditionalCLIOptions != nil && c .AdditionalCLIOptions .Plan .AllowDeferral {
254+ opts = append (opts , tfexec .AllowDeferral (true ))
255+ }
256+
241257 return wd .CreatePlan (ctx , opts ... )
242258 }, wd , providers )
243259 if err != nil {
@@ -302,6 +318,11 @@ func testStepNewConfig(ctx context.Context, t testing.T, c TestCase, wd *plugint
302318 opts = append (opts , tfexec .Refresh (false ))
303319 }
304320 }
321+
322+ if c .AdditionalCLIOptions != nil && c .AdditionalCLIOptions .Plan .AllowDeferral {
323+ opts = append (opts , tfexec .AllowDeferral (true ))
324+ }
325+
305326 return wd .CreatePlan (ctx , opts ... )
306327 }, wd , providers )
307328 if err != nil {
0 commit comments