@@ -34,7 +34,6 @@ func TestContextPlan_actions(t *testing.T) {
3434 "unreferenced" : {
3535 module : map [string ]string {
3636 "main.tf" : `
37- terraform { experiments = [actions] }
3837action "test_unlinked" "hello" {}
3938 ` ,
4039 },
@@ -44,7 +43,6 @@ action "test_unlinked" "hello" {}
4443 "invalid config" : {
4544 module : map [string ]string {
4645 "main.tf" : `
47- terraform { experiments = [actions] }
4846action "test_unlinked" "hello" {
4947 config {
5048 unknown_attr = "value"
@@ -60,8 +58,8 @@ action "test_unlinked" "hello" {
6058 Detail : `An argument named "unknown_attr" is not expected here.` ,
6159 Subject : & hcl.Range {
6260 Filename : filepath .Join (m .Module .SourceDir , "main.tf" ),
63- Start : hcl.Pos {Line : 5 , Column : 5 , Byte : 87 },
64- End : hcl.Pos {Line : 5 , Column : 17 , Byte : 99 },
61+ Start : hcl.Pos {Line : 4 , Column : 5 , Byte : 49 },
62+ End : hcl.Pos {Line : 4 , Column : 17 , Byte : 61 },
6563 },
6664 })
6765 },
@@ -70,7 +68,6 @@ action "test_unlinked" "hello" {
7068 "before_create triggered" : {
7169 module : map [string ]string {
7270 "main.tf" : `
73- terraform { experiments = [actions] }
7471action "test_unlinked" "hello" {}
7572resource "test_object" "a" {
7673 lifecycle {
@@ -88,7 +85,6 @@ resource "test_object" "a" {
8885 "after_create triggered" : {
8986 module : map [string ]string {
9087 "main.tf" : `
91- terraform { experiments = [actions] }
9288action "test_unlinked" "hello" {}
9389resource "test_object" "a" {
9490 lifecycle {
@@ -106,7 +102,6 @@ resource "test_object" "a" {
106102 "before_update triggered - on create" : {
107103 module : map [string ]string {
108104 "main.tf" : `
109- terraform { experiments = [actions] }
110105action "test_unlinked" "hello" {}
111106resource "test_object" "a" {
112107 lifecycle {
@@ -124,7 +119,6 @@ resource "test_object" "a" {
124119 "after_update triggered - on create" : {
125120 module : map [string ]string {
126121 "main.tf" : `
127- terraform { experiments = [actions] }
128122action "test_unlinked" "hello" {}
129123resource "test_object" "a" {
130124 lifecycle {
@@ -142,7 +136,6 @@ resource "test_object" "a" {
142136 "before_update triggered - on update" : {
143137 module : map [string ]string {
144138 "main.tf" : `
145- terraform { experiments = [actions] }
146139action "test_unlinked" "hello" {}
147140resource "test_object" "a" {
148141 lifecycle {
@@ -167,7 +160,6 @@ resource "test_object" "a" {
167160 "after_update triggered - on update" : {
168161 module : map [string ]string {
169162 "main.tf" : `
170- terraform { experiments = [actions] }
171163action "test_unlinked" "hello" {}
172164resource "test_object" "a" {
173165 lifecycle {
@@ -192,7 +184,6 @@ resource "test_object" "a" {
192184 "before_update triggered - on replace" : {
193185 module : map [string ]string {
194186 "main.tf" : `
195- terraform { experiments = [actions] }
196187action "test_unlinked" "hello" {}
197188resource "test_object" "a" {
198189 lifecycle {
@@ -218,7 +209,6 @@ resource "test_object" "a" {
218209 "after_update triggered - on replace" : {
219210 module : map [string ]string {
220211 "main.tf" : `
221- terraform { experiments = [actions] }
222212action "test_unlinked" "hello" {}
223213resource "test_object" "a" {
224214 lifecycle {
@@ -244,7 +234,6 @@ resource "test_object" "a" {
244234 "action for_each" : {
245235 module : map [string ]string {
246236 "main.tf" : `
247- terraform { experiments = [actions] }
248237action "test_unlinked" "hello" {
249238 for_each = toset(["a", "b"])
250239
@@ -268,7 +257,6 @@ resource "test_object" "a" {
268257 "action for_each with auto-expansion" : {
269258 module : map [string ]string {
270259 "main.tf" : `
271- terraform { experiments = [actions] }
272260action "test_unlinked" "hello" {
273261 for_each = toset(["a", "b"])
274262
@@ -292,7 +280,6 @@ resource "test_object" "a" {
292280 "action count" : {
293281 module : map [string ]string {
294282 "main.tf" : `
295- terraform { experiments = [actions] }
296283action "test_unlinked" "hello" {
297284 count = 2
298285
@@ -317,7 +304,6 @@ resource "test_object" "a" {
317304 "action count with auto-expansion" : {
318305 module : map [string ]string {
319306 "main.tf" : `
320- terraform { experiments = [actions] }
321307action "test_unlinked" "hello" {
322308 count = 2
323309
@@ -342,7 +328,6 @@ resource "test_object" "a" {
342328 "action for_each invalid access" : {
343329 module : map [string ]string {
344330 "main.tf" : `
345- terraform { experiments = [actions] }
346331action "test_unlinked" "hello" {
347332 for_each = toset(["a", "b"])
348333
@@ -373,7 +358,6 @@ resource "test_object" "a" {
373358 "action count invalid access" : {
374359 module : map [string ]string {
375360 "main.tf" : `
376- terraform { experiments = [actions] }
377361action "test_unlinked" "hello" {
378362 count = 2
379363
@@ -404,7 +388,6 @@ resource "test_object" "a" {
404388 "expanded resource - unexpanded action" : {
405389 module : map [string ]string {
406390 "main.tf" : `
407- terraform { experiments = [actions] }
408391action "test_unlinked" "hello" {}
409392resource "test_object" "a" {
410393 count = 2
@@ -424,7 +407,6 @@ resource "test_object" "a" {
424407 toBeImplemented : true , // TODO: Not sure why this panics
425408 module : map [string ]string {
426409 "main.tf" : `
427- terraform { experiments = [actions] }
428410action "test_unlinked" "hello" {
429411 count = 2
430412
@@ -450,7 +432,6 @@ resource "test_object" "a" {
450432 "transitive dependencies" : {
451433 module : map [string ]string {
452434 "main.tf" : `
453- terraform { experiments = [actions] }
454435resource "test_object" "a" {
455436 name = "a"
456437}
@@ -476,7 +457,6 @@ resource "test_object" "b" {
476457 "expanded transitive dependencies" : {
477458 module : map [string ]string {
478459 "main.tf" : `
479- terraform { experiments = [actions] }
480460resource "test_object" "a" {
481461 name = "a"
482462}
@@ -528,7 +508,6 @@ resource "test_object" "e" {
528508 "failing actions cancel next ones" : {
529509 module : map [string ]string {
530510 "main.tf" : `
531- terraform { experiments = [actions] }
532511action "test_unlinked" "failure" {}
533512resource "test_object" "a" {
534513 lifecycle {
@@ -563,7 +542,6 @@ resource "test_object" "a" {
563542 "actions cant be accessed in resources" : {
564543 module : map [string ]string {
565544 "main.tf" : `
566- terraform { experiments = [actions] }
567545action "test_unlinked" "my_action" {
568546 config {
569547 attr = "value"
@@ -588,8 +566,8 @@ resource "test_object" "a" {
588566 Detail : "Actions can't be referenced in this context, they can only be referenced from within a resources lifecycle events list." ,
589567 Subject : & hcl.Range {
590568 Filename : filepath .Join (m .Module .SourceDir , "main.tf" ),
591- Start : hcl.Pos {Line : 9 , Column : 10 , Byte : 150 },
592- End : hcl.Pos {Line : 9 , Column : 40 , Byte : 180 },
569+ Start : hcl.Pos {Line : 8 , Column : 10 , Byte : 112 },
570+ End : hcl.Pos {Line : 8 , Column : 40 , Byte : 142 },
593571 },
594572 })
595573 },
@@ -598,7 +576,6 @@ resource "test_object" "a" {
598576 "actions cant be accessed in outputs" : {
599577 module : map [string ]string {
600578 "main.tf" : `
601- terraform { experiments = [actions] }
602579action "test_unlinked" "my_action" {
603580 config {
604581 attr = "value"
@@ -630,8 +607,8 @@ output "my_output2" {
630607 Detail : "Actions can't be referenced in this context, they can only be referenced from within a resources lifecycle events list." ,
631608 Subject : & hcl.Range {
632609 Filename : filepath .Join (m .Module .SourceDir , "main.tf" ),
633- Start : hcl.Pos {Line : 22 , Column : 13 , Byte : 375 },
634- End : hcl.Pos {Line : 22 , Column : 43 , Byte : 405 },
610+ Start : hcl.Pos {Line : 21 , Column : 13 , Byte : 337 },
611+ End : hcl.Pos {Line : 21 , Column : 43 , Byte : 367 },
635612 },
636613 }).Append (
637614 & hcl.Diagnostic {
@@ -640,8 +617,8 @@ output "my_output2" {
640617 Detail : "Actions can't be referenced in this context, they can only be referenced from within a resources lifecycle events list." ,
641618 Subject : & hcl.Range {
642619 Filename : filepath .Join (m .Module .SourceDir , "main.tf" ),
643- Start : hcl.Pos {Line : 18 , Column : 13 , Byte : 302 },
644- End : hcl.Pos {Line : 18 , Column : 43 , Byte : 332 },
620+ Start : hcl.Pos {Line : 17 , Column : 13 , Byte : 264 },
621+ End : hcl.Pos {Line : 17 , Column : 43 , Byte : 294 },
645622 },
646623 },
647624 )
0 commit comments