@@ -107,6 +107,11 @@ func testStepNewConfig(ctx context.Context, t testing.T, c TestCase, wd *plugint
107
107
if step .Destroy {
108
108
opts = append (opts , tfexec .Destroy (true ))
109
109
}
110
+
111
+ if c .AdditionalCLIOptions != nil && c .AdditionalCLIOptions .Plan .AllowDeferral {
112
+ opts = append (opts , tfexec .AllowDeferral (true ))
113
+ }
114
+
110
115
return wd .CreatePlan (ctx , opts ... )
111
116
}, wd , providers )
112
117
if err != nil {
@@ -168,7 +173,13 @@ func testStepNewConfig(ctx context.Context, t testing.T, c TestCase, wd *plugint
168
173
169
174
// Apply the diff, creating real resources
170
175
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 ... )
172
183
}, wd , providers )
173
184
if err != nil {
174
185
if step .Destroy {
@@ -238,6 +249,11 @@ func testStepNewConfig(ctx context.Context, t testing.T, c TestCase, wd *plugint
238
249
if step .Destroy {
239
250
opts = append (opts , tfexec .Destroy (true ))
240
251
}
252
+
253
+ if c .AdditionalCLIOptions != nil && c .AdditionalCLIOptions .Plan .AllowDeferral {
254
+ opts = append (opts , tfexec .AllowDeferral (true ))
255
+ }
256
+
241
257
return wd .CreatePlan (ctx , opts ... )
242
258
}, wd , providers )
243
259
if err != nil {
@@ -302,6 +318,11 @@ func testStepNewConfig(ctx context.Context, t testing.T, c TestCase, wd *plugint
302
318
opts = append (opts , tfexec .Refresh (false ))
303
319
}
304
320
}
321
+
322
+ if c .AdditionalCLIOptions != nil && c .AdditionalCLIOptions .Plan .AllowDeferral {
323
+ opts = append (opts , tfexec .AllowDeferral (true ))
324
+ }
325
+
305
326
return wd .CreatePlan (ctx , opts ... )
306
327
}, wd , providers )
307
328
if err != nil {
0 commit comments