@@ -21,12 +21,12 @@ import (
2121 r "github.com/hashicorp/terraform-plugin-testing/helper/resource"
2222)
2323
24- func TestTest_TestStep_ImportBlockId (t * testing.T ) {
24+ func Test_TestStep_ImportBlockId (t * testing.T ) {
2525 t .Parallel ()
2626
2727 r .UnitTest (t , r.TestCase {
2828 TerraformVersionChecks : []tfversion.TerraformVersionCheck {
29- tfversion .SkipBelow (tfversion .Version1_5_0 ), // ImportBlockWithId requires Terraform 1.5.0 or later
29+ tfversion .SkipBelow (tfversion .Version1_5_0 ), // ImportBlockWithID requires Terraform 1.5.0 or later
3030 },
3131 ProtoV6ProviderFactories : map [string ]func () (tfprotov6.ProviderServer , error ){
3232 "examplecloud" : providerserver .NewProviderServer (testprovider.Provider {
@@ -44,10 +44,9 @@ func TestTest_TestStep_ImportBlockId(t *testing.T) {
4444 }` ,
4545 },
4646 {
47- ResourceName : "examplecloud_container.test" ,
48- ImportState : true ,
49- ImportStateKind : r .ImportBlockWithId ,
50- ImportStateVerify : true ,
47+ ResourceName : "examplecloud_container.test" ,
48+ ImportState : true ,
49+ ImportStateKind : r .ImportBlockWithID ,
5150 },
5251 },
5352 })
@@ -58,7 +57,7 @@ func TestTest_TestStep_ImportBlockId_ExpectError(t *testing.T) {
5857
5958 r .UnitTest (t , r.TestCase {
6059 TerraformVersionChecks : []tfversion.TerraformVersionCheck {
61- tfversion .SkipBelow (tfversion .Version1_5_0 ), // ImportBlockWithId requires Terraform 1.5.0 or later
60+ tfversion .SkipBelow (tfversion .Version1_5_0 ), // ImportBlockWithID requires Terraform 1.5.0 or later
6261 },
6362 ProtoV6ProviderFactories : map [string ]func () (tfprotov6.ProviderServer , error ){
6463 "examplecloud" : providerserver .NewProviderServer (testprovider.Provider {
@@ -81,11 +80,10 @@ func TestTest_TestStep_ImportBlockId_ExpectError(t *testing.T) {
8180 location = "eastus"
8281 name = "somevalue"
8382 }` ,
84- ResourceName : "examplecloud_container.test" ,
85- ImportState : true ,
86- ImportStateKind : r .ImportBlockWithId ,
87- ImportStateVerify : true ,
88- ExpectError : regexp .MustCompile (`importing resource examplecloud_container.test should be a no-op, but got action update with plan(.?)` ),
83+ ResourceName : "examplecloud_container.test" ,
84+ ImportState : true ,
85+ ImportStateKind : r .ImportBlockWithID ,
86+ ExpectError : regexp .MustCompile (`importing resource examplecloud_container.test: expected a no-op resource action, got "update" action with plan(.?)` ),
8987 },
9088 },
9189 })
@@ -120,11 +118,10 @@ func TestTest_TestStep_ImportBlockId_FailWhenPlannableImportIsNotSupported(t *te
120118 location = "eastus"
121119 name = "somevalue"
122120 }` ,
123- ResourceName : "examplecloud_container.test" ,
124- ImportState : true ,
125- ImportStateKind : r .ImportBlockWithId ,
126- ImportStateVerify : true ,
127- ExpectError : regexp .MustCompile (`Terraform 1.5.0` ),
121+ ResourceName : "examplecloud_container.test" ,
122+ ImportState : true ,
123+ ImportStateKind : r .ImportBlockWithID ,
124+ ExpectError : regexp .MustCompile (`Terraform 1.5.0` ),
128125 },
129126 },
130127 })
@@ -135,7 +132,7 @@ func TestTest_TestStep_ImportBlockId_SkipDataSourceState(t *testing.T) {
135132
136133 r .UnitTest (t , r.TestCase {
137134 TerraformVersionChecks : []tfversion.TerraformVersionCheck {
138- tfversion .SkipBelow (tfversion .Version1_5_0 ), // ImportBlockWithId requires Terraform 1.5.0 or later
135+ tfversion .SkipBelow (tfversion .Version1_5_0 ), // ImportBlockWithID requires Terraform 1.5.0 or later
139136
140137 },
141138 ProtoV6ProviderFactories : map [string ]func () (tfprotov6.ProviderServer , error ){
@@ -161,7 +158,7 @@ func TestTest_TestStep_ImportBlockId_SkipDataSourceState(t *testing.T) {
161158 {
162159 ResourceName : "examplecloud_thing.test" ,
163160 ImportState : true ,
164- ImportStateKind : r .ImportBlockWithId ,
161+ ImportStateKind : r .ImportBlockWithID ,
165162 ImportStateCheck : func (is []* terraform.InstanceState ) error {
166163 if len (is ) > 1 {
167164 return fmt .Errorf ("expected 1 state, got: %d" , len (is ))
@@ -200,11 +197,16 @@ func TestTest_TestStep_ImportBlockId_ImportStateVerifyIgnore_Real_Example(t *tes
200197 I also need to omit the `password` in the import config, otherwise the value in the config is used when importing the
201198 with an import block and the test ends up passing regardless of whether `ImportStateVerifyIgnore` has been specified or not
202199 */
200+
201+ // In prerelease, we are choosing that ImportBlockWithID will not perform an apply, so it will not produce a new state,
202+ // and there is no new state for ImportStateVerify to do anything meaningful with.
203+ t .Skip ()
204+
203205 t .Parallel ()
204206
205207 r .UnitTest (t , r.TestCase {
206208 TerraformVersionChecks : []tfversion.TerraformVersionCheck {
207- tfversion .SkipBelow (tfversion .Version1_5_0 ), // ImportBlockWithId requires Terraform 1.5.0 or later
209+ tfversion .SkipBelow (tfversion .Version1_5_0 ), // ImportBlockWithID requires Terraform 1.5.0 or later
208210 },
209211 ProtoV6ProviderFactories : map [string ]func () (tfprotov6.ProviderServer , error ){
210212 "examplecloud" : providerserver .NewProviderServer (testprovider.Provider {
@@ -292,7 +294,7 @@ func TestTest_TestStep_ImportBlockId_ImportStateVerifyIgnore_Real_Example(t *tes
292294 }` ,
293295 ResourceName : "examplecloud_container.test" ,
294296 ImportState : true ,
295- ImportStateKind : r .ImportBlockWithId ,
297+ ImportStateKind : r .ImportBlockWithID ,
296298 ImportStateVerify : true ,
297299 ImportStateVerifyIgnore : []string {"password" },
298300 },
@@ -301,11 +303,15 @@ func TestTest_TestStep_ImportBlockId_ImportStateVerifyIgnore_Real_Example(t *tes
301303}
302304
303305func TestTest_TestStep_ImportBlockId_ImportStateVerifyIgnore (t * testing.T ) {
306+ // In prerelease, we are choosing that ImportBlockWithID will not perform an apply, so it will not produce a new state,
307+ // and there is no new state for ImportStateVerify to do anything meaningful with.
308+ t .Skip ()
309+
304310 t .Parallel ()
305311
306312 r .UnitTest (t , r.TestCase {
307313 TerraformVersionChecks : []tfversion.TerraformVersionCheck {
308- tfversion .SkipBelow (tfversion .Version1_5_0 ), // ImportBlockWithId requires Terraform 1.5.0 or later
314+ tfversion .SkipBelow (tfversion .Version1_5_0 ), // ImportBlockWithID requires Terraform 1.5.0 or later
309315 },
310316 ProtoV6ProviderFactories : map [string ]func () (tfprotov6.ProviderServer , error ){
311317 "examplecloud" : providerserver .NewProviderServer (testprovider.Provider {
@@ -377,7 +383,7 @@ func TestTest_TestStep_ImportBlockId_ImportStateVerifyIgnore(t *testing.T) {
377383 {
378384 ResourceName : "examplecloud_container.test" ,
379385 ImportState : true ,
380- ImportStateKind : r .ImportBlockWithId ,
386+ ImportStateKind : r .ImportBlockWithID ,
381387 ImportStateVerify : true ,
382388 ImportStateVerifyIgnore : []string {"password" },
383389 },
0 commit comments