diff --git a/go.mod b/go.mod index 6445978..82ac267 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/hashicorp/terraform-plugin-go v0.25.0 github.com/hashicorp/terraform-plugin-mux v0.17.0 github.com/hashicorp/terraform-plugin-sdk/v2 v2.35.0 - github.com/hashicorp/terraform-plugin-testing v1.10.1-0.20241112232341-e5b632d36863 + github.com/hashicorp/terraform-plugin-testing v1.10.1-0.20241115203951-22d91e86db7f github.com/zclconf/go-cty v1.15.0 ) @@ -54,12 +54,12 @@ require ( github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect - golang.org/x/crypto v0.28.0 // indirect + golang.org/x/crypto v0.29.0 // indirect golang.org/x/mod v0.21.0 // indirect golang.org/x/net v0.28.0 // indirect - golang.org/x/sync v0.8.0 // indirect - golang.org/x/sys v0.26.0 // indirect - golang.org/x/text v0.19.0 // indirect + golang.org/x/sync v0.9.0 // indirect + golang.org/x/sys v0.27.0 // indirect + golang.org/x/text v0.20.0 // indirect golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect google.golang.org/appengine v1.6.8 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 // indirect diff --git a/go.sum b/go.sum index c26929c..77f4855 100644 --- a/go.sum +++ b/go.sum @@ -95,8 +95,8 @@ github.com/hashicorp/terraform-plugin-mux v0.17.0 h1:/J3vv3Ps2ISkbLPiZOLspFcIZ0v github.com/hashicorp/terraform-plugin-mux v0.17.0/go.mod h1:yWuM9U1Jg8DryNfvCp+lH70WcYv6D8aooQxxxIzFDsE= github.com/hashicorp/terraform-plugin-sdk/v2 v2.35.0 h1:wyKCCtn6pBBL46c1uIIBNUOWlNfYXfXpVo16iDyLp8Y= github.com/hashicorp/terraform-plugin-sdk/v2 v2.35.0/go.mod h1:B0Al8NyYVr8Mp/KLwssKXG1RqnTk7FySqSn4fRuLNgw= -github.com/hashicorp/terraform-plugin-testing v1.10.1-0.20241112232341-e5b632d36863 h1:1BV2qGnJyCG0j9IuC8tETeEqGm5n32oqZWnPpMCPYJI= -github.com/hashicorp/terraform-plugin-testing v1.10.1-0.20241112232341-e5b632d36863/go.mod h1:KO4JzpCD5O7tSKZk20W70X2tpna9pIEoiTQD6cS8VrU= +github.com/hashicorp/terraform-plugin-testing v1.10.1-0.20241115203951-22d91e86db7f h1:ViwuNNUAXzR0vashnLKoESaQ7c7wmUDJB4C0qxJLHMQ= +github.com/hashicorp/terraform-plugin-testing v1.10.1-0.20241115203951-22d91e86db7f/go.mod h1:o3BALjEFqOVDdUkQ5pqkXNi8wc3il0sSmAXgSmlKEmg= github.com/hashicorp/terraform-registry-address v0.2.3 h1:2TAiKJ1A3MAkZlH1YI/aTVcLZRu7JseiXNRHbOAyoTI= github.com/hashicorp/terraform-registry-address v0.2.3/go.mod h1:lFHA76T8jfQteVfT7caREqguFrW3c4MFSPhZB7HHgUM= github.com/hashicorp/terraform-svchost v0.1.1 h1:EZZimZ1GxdqFRinZ1tpJwVxxt49xc/S52uzrw4x0jKQ= @@ -163,8 +163,8 @@ github.com/zclconf/go-cty-debug v0.0.0-20240509010212-0d6042c53940 h1:4r45xpDWB6 github.com/zclconf/go-cty-debug v0.0.0-20240509010212-0d6042c53940/go.mod h1:CmBdvvj3nqzfzJ6nTCIwDTPZ56aVGvDrmztiO5g3qrM= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw= -golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U= +golang.org/x/crypto v0.29.0 h1:L5SG1JTTXupVV3n6sUqMTeWbjAyfPwoda2DLX8J8FrQ= +golang.org/x/crypto v0.29.0/go.mod h1:+F4F4N5hv6v38hfeYwTdx20oUvLLc+QfrE9Ax9HtgRg= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.21.0 h1:vvrHzRwRfVKSiLrG+d4FMl/Qi4ukBCE6kZlTUkDYRT0= golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= @@ -177,8 +177,8 @@ golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= -golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ= +golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -191,8 +191,8 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= -golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= +golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -200,8 +200,8 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= -golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM= -golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= +golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= diff --git a/internal/framework5provider/ephemeral_lifecycle_resource_test.go b/internal/framework5provider/ephemeral_lifecycle_resource_test.go index b37066e..7c4f3d3 100644 --- a/internal/framework5provider/ephemeral_lifecycle_resource_test.go +++ b/internal/framework5provider/ephemeral_lifecycle_resource_test.go @@ -13,6 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-go/tfprotov6" "github.com/hashicorp/terraform-plugin-testing/echoprovider" "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/knownvalue" + "github.com/hashicorp/terraform-plugin-testing/statecheck" "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-plugin-testing/tfversion" ) @@ -97,13 +99,10 @@ func TestEphemeralLifecycleResource_SkipWithUnknown(t *testing.T) { ephemeral "framework_lifecycle" "test" { name = "John ${random_string.str.result}" }`), - // TODO: This is currently a known bug in Terraform v1.10.0-beta1. Once that bug is fixed, this test will fail, and then - // we can remove the ExpectError and uncomment the state checks. - ExpectError: regexp.MustCompile(`Unknown value encountered in Open lifecycle handler`), - // ConfigStateChecks: []statecheck.StateCheck{ - // statecheck.ExpectKnownValue("echo.lifecycle_test", echoDataPath.AtMapKey("name"), knownvalue.StringRegexp(regexp.MustCompile(`^John\s.{12}$`))), - // statecheck.ExpectKnownValue("echo.lifecycle_test", echoDataPath.AtMapKey("token"), knownvalue.StringExact("fake-token-12345")), - // }, + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue("echo.lifecycle_test", echoDataPath.AtMapKey("name"), knownvalue.StringRegexp(regexp.MustCompile(`^John\s.{12}$`))), + statecheck.ExpectKnownValue("echo.lifecycle_test", echoDataPath.AtMapKey("token"), knownvalue.StringExact("fake-token-12345")), + }, }, }, }) diff --git a/internal/framework5provider/schema_ephemeral_resource_test.go b/internal/framework5provider/schema_ephemeral_resource_test.go index 2f9487a..6f1992c 100644 --- a/internal/framework5provider/schema_ephemeral_resource_test.go +++ b/internal/framework5provider/schema_ephemeral_resource_test.go @@ -121,7 +121,6 @@ func TestSchemaEphemeralResource_DynamicAttribute(t *testing.T) { dynamic_attribute = [12,34] }`), ConfigStateChecks: []statecheck.StateCheck{ - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("bool_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue( "echo.schema_test", echoDataPath.AtMapKey("dynamic_attribute"), @@ -130,6 +129,7 @@ func TestSchemaEphemeralResource_DynamicAttribute(t *testing.T) { knownvalue.Int64Exact(34), }), ), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("bool_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float32_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float64_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("int32_attribute"), knownvalue.Null()), @@ -169,9 +169,9 @@ func TestSchemaEphemeralResource_Float32Attribute(t *testing.T) { float32_attribute = 1234.5 }`), ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float32_attribute"), knownvalue.Float32Exact(1234.5)), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("bool_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("dynamic_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float32_attribute"), knownvalue.Float32Exact(1234.5)), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float64_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("int32_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("int64_attribute"), knownvalue.Null()), @@ -210,10 +210,10 @@ func TestSchemaEphemeralResource_Float64Attribute(t *testing.T) { float64_attribute = 1234.5 }`), ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float64_attribute"), knownvalue.Float64Exact(1234.5)), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("bool_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("dynamic_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float32_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float64_attribute"), knownvalue.Float64Exact(1234.5)), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("int32_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("int64_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("list_attribute"), knownvalue.Null()), @@ -251,11 +251,11 @@ func TestSchemaEphemeralResource_Int32Attribute(t *testing.T) { int32_attribute = 1234 }`), ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("int32_attribute"), knownvalue.Int32Exact(1234)), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("bool_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("dynamic_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float32_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float64_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("int32_attribute"), knownvalue.Int32Exact(1234)), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("int64_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("list_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("list_nested_block"), knownvalue.ListSizeExact(0)), @@ -292,12 +292,12 @@ func TestSchemaEphemeralResource_Int64Attribute(t *testing.T) { int64_attribute = 1234 }`), ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("int64_attribute"), knownvalue.Int64Exact(1234)), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("bool_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("dynamic_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float32_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float64_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("int32_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("int64_attribute"), knownvalue.Int64Exact(1234)), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("list_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("list_nested_block"), knownvalue.ListSizeExact(0)), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("map_attribute"), knownvalue.Null()), @@ -333,12 +333,6 @@ func TestSchemaEphemeralResource_ListAttribute(t *testing.T) { list_attribute = ["value1"] }`), ConfigStateChecks: []statecheck.StateCheck{ - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("bool_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("dynamic_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float32_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float64_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("int32_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("int64_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("list_attribute"), knownvalue.ListExact( []knownvalue.Check{ @@ -346,6 +340,12 @@ func TestSchemaEphemeralResource_ListAttribute(t *testing.T) { }, ), ), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("bool_attribute"), knownvalue.Null()), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("dynamic_attribute"), knownvalue.Null()), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float32_attribute"), knownvalue.Null()), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float64_attribute"), knownvalue.Null()), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("int32_attribute"), knownvalue.Null()), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("int64_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("list_nested_block"), knownvalue.ListSizeExact(0)), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("map_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("number_attribute"), knownvalue.Null()), @@ -382,13 +382,6 @@ func TestSchemaEphemeralResource_ListNestedBlock(t *testing.T) { } }`), ConfigStateChecks: []statecheck.StateCheck{ - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("bool_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("dynamic_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float32_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float64_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("int32_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("int64_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("list_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("list_nested_block"), knownvalue.ListExact( []knownvalue.Check{ @@ -398,6 +391,13 @@ func TestSchemaEphemeralResource_ListNestedBlock(t *testing.T) { }, ), ), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("bool_attribute"), knownvalue.Null()), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("dynamic_attribute"), knownvalue.Null()), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float32_attribute"), knownvalue.Null()), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float64_attribute"), knownvalue.Null()), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("int32_attribute"), knownvalue.Null()), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("int64_attribute"), knownvalue.Null()), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("list_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("map_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("number_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("object_attribute"), knownvalue.Null()), @@ -433,6 +433,13 @@ func TestSchemaEphemeralResource_MapAttribute(t *testing.T) { } }`), ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("map_attribute"), + knownvalue.MapExact( + map[string]knownvalue.Check{ + "key1": knownvalue.StringExact("value1"), + }, + ), + ), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("bool_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("dynamic_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float32_attribute"), knownvalue.Null()), @@ -441,13 +448,6 @@ func TestSchemaEphemeralResource_MapAttribute(t *testing.T) { statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("int64_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("list_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("list_nested_block"), knownvalue.ListSizeExact(0)), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("map_attribute"), - knownvalue.MapExact( - map[string]knownvalue.Check{ - "key1": knownvalue.StringExact("value1"), - }, - ), - ), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("number_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("object_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("set_attribute"), knownvalue.Null()), @@ -480,6 +480,7 @@ func TestSchemaEphemeralResource_NumberAttribute(t *testing.T) { number_attribute = 1234.5 }`), ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("number_attribute"), knownvalue.NumberExact(big.NewFloat(1234.5))), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("bool_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("dynamic_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float32_attribute"), knownvalue.Null()), @@ -489,7 +490,6 @@ func TestSchemaEphemeralResource_NumberAttribute(t *testing.T) { statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("list_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("list_nested_block"), knownvalue.ListSizeExact(0)), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("map_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("number_attribute"), knownvalue.NumberExact(big.NewFloat(1234.5))), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("object_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("set_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("set_nested_block"), knownvalue.ListSizeExact(0)), @@ -523,6 +523,13 @@ func TestSchemaEphemeralResource_ObjectAttribute(t *testing.T) { } }`), ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("object_attribute"), + knownvalue.ObjectExact( + map[string]knownvalue.Check{ + "object_attribute_attribute": knownvalue.StringExact("value1"), + }, + ), + ), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("bool_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("dynamic_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float32_attribute"), knownvalue.Null()), @@ -533,13 +540,6 @@ func TestSchemaEphemeralResource_ObjectAttribute(t *testing.T) { statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("list_nested_block"), knownvalue.ListSizeExact(0)), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("map_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("number_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("object_attribute"), - knownvalue.ObjectExact( - map[string]knownvalue.Check{ - "object_attribute_attribute": knownvalue.StringExact("value1"), - }, - ), - ), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("set_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("set_nested_block"), knownvalue.ListSizeExact(0)), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("single_nested_block"), knownvalue.Null()), @@ -570,6 +570,13 @@ func TestSchemaEphemeralResource_SetAttribute(t *testing.T) { set_attribute = ["value1"] }`), ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("set_attribute"), + knownvalue.SetExact( + []knownvalue.Check{ + knownvalue.StringExact("value1"), + }, + ), + ), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("bool_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("dynamic_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float32_attribute"), knownvalue.Null()), @@ -581,13 +588,6 @@ func TestSchemaEphemeralResource_SetAttribute(t *testing.T) { statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("map_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("number_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("object_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("set_attribute"), - knownvalue.SetExact( - []knownvalue.Check{ - knownvalue.StringExact("value1"), - }, - ), - ), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("set_nested_block"), knownvalue.ListSizeExact(0)), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("single_nested_block"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("string_attribute"), knownvalue.Null()), @@ -619,6 +619,15 @@ func TestSchemaEphemeralResource_SetNestedBlock(t *testing.T) { } }`), ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("set_nested_block"), + knownvalue.SetExact( + []knownvalue.Check{ + knownvalue.ObjectExact(map[string]knownvalue.Check{ + "set_nested_block_attribute": knownvalue.StringExact("value1"), + }), + }, + ), + ), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("bool_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("dynamic_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float32_attribute"), knownvalue.Null()), @@ -631,15 +640,6 @@ func TestSchemaEphemeralResource_SetNestedBlock(t *testing.T) { statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("number_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("object_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("set_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("set_nested_block"), - knownvalue.SetExact( - []knownvalue.Check{ - knownvalue.ObjectExact(map[string]knownvalue.Check{ - "set_nested_block_attribute": knownvalue.StringExact("value1"), - }), - }, - ), - ), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("single_nested_block"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("string_attribute"), knownvalue.Null()), }, @@ -670,6 +670,13 @@ func TestSchemaEphemeralResource_SingleNestedBlock(t *testing.T) { } }`), ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("single_nested_block"), + knownvalue.ObjectExact( + map[string]knownvalue.Check{ + "single_nested_block_attribute": knownvalue.StringExact("value1"), + }, + ), + ), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("bool_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("dynamic_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float32_attribute"), knownvalue.Null()), @@ -683,13 +690,6 @@ func TestSchemaEphemeralResource_SingleNestedBlock(t *testing.T) { statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("object_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("set_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("set_nested_block"), knownvalue.ListSizeExact(0)), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("single_nested_block"), - knownvalue.ObjectExact( - map[string]knownvalue.Check{ - "single_nested_block_attribute": knownvalue.StringExact("value1"), - }, - ), - ), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("string_attribute"), knownvalue.Null()), }, }, @@ -717,6 +717,7 @@ func TestSchemaEphemeralResource_StringAttribute(t *testing.T) { string_attribute = "value1" }`), ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("string_attribute"), knownvalue.StringExact("value1")), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("bool_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("dynamic_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float32_attribute"), knownvalue.Null()), @@ -731,7 +732,6 @@ func TestSchemaEphemeralResource_StringAttribute(t *testing.T) { statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("set_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("set_nested_block"), knownvalue.ListSizeExact(0)), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("single_nested_block"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("string_attribute"), knownvalue.StringExact("value1")), }, }, }, diff --git a/internal/framework6provider/ephemeral_lifecycle_resource_test.go b/internal/framework6provider/ephemeral_lifecycle_resource_test.go index f0ca747..aeda4fe 100644 --- a/internal/framework6provider/ephemeral_lifecycle_resource_test.go +++ b/internal/framework6provider/ephemeral_lifecycle_resource_test.go @@ -12,6 +12,8 @@ import ( "github.com/hashicorp/terraform-plugin-go/tfprotov6" "github.com/hashicorp/terraform-plugin-testing/echoprovider" "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/knownvalue" + "github.com/hashicorp/terraform-plugin-testing/statecheck" "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-plugin-testing/tfversion" ) @@ -92,13 +94,10 @@ func TestEphemeralLifecycleResource_SkipWithUnknown(t *testing.T) { ephemeral "framework_lifecycle" "test" { name = "John ${random_string.str.result}" }`), - // TODO: This is currently a known bug in Terraform v1.10.0-beta1. Once that bug is fixed, this test will fail, and then - // we can remove the ExpectError and uncomment the state checks. - ExpectError: regexp.MustCompile(`Unknown value encountered in Open lifecycle handler`), - // ConfigStateChecks: []statecheck.StateCheck{ - // statecheck.ExpectKnownValue("echo.lifecycle_test", echoDataPath.AtMapKey("name"), knownvalue.StringRegexp(regexp.MustCompile(`^John\s.{12}$`))), - // statecheck.ExpectKnownValue("echo.lifecycle_test", echoDataPath.AtMapKey("token"), knownvalue.StringExact("fake-token-12345")), - // }, + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue("echo.lifecycle_test", echoDataPath.AtMapKey("name"), knownvalue.StringRegexp(regexp.MustCompile(`^John\s.{12}$`))), + statecheck.ExpectKnownValue("echo.lifecycle_test", echoDataPath.AtMapKey("token"), knownvalue.StringExact("fake-token-12345")), + }, }, }, }) diff --git a/internal/framework6provider/schema_ephemeral_resource_test.go b/internal/framework6provider/schema_ephemeral_resource_test.go index 31cb2cc..270bf9f 100644 --- a/internal/framework6provider/schema_ephemeral_resource_test.go +++ b/internal/framework6provider/schema_ephemeral_resource_test.go @@ -133,7 +133,6 @@ func TestSchemaEphemeralResource_DynamicAttribute(t *testing.T) { } }`), ConfigStateChecks: []statecheck.StateCheck{ - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("bool_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("dynamic_attribute"), knownvalue.ObjectExact( map[string]knownvalue.Check{ @@ -149,6 +148,7 @@ func TestSchemaEphemeralResource_DynamicAttribute(t *testing.T) { }, ), ), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("bool_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float32_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float64_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("int32_attribute"), knownvalue.Null()), @@ -193,9 +193,9 @@ func TestSchemaEphemeralResource_Float32Attribute(t *testing.T) { float32_attribute = 1234.5 }`), ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float32_attribute"), knownvalue.Float32Exact(1234.5)), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("bool_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("dynamic_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float32_attribute"), knownvalue.Float32Exact(1234.5)), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float64_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("int32_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("int64_attribute"), knownvalue.Null()), @@ -239,10 +239,10 @@ func TestSchemaEphemeralResource_Float64Attribute(t *testing.T) { float64_attribute = 1234.5 }`), ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float64_attribute"), knownvalue.Float64Exact(1234.5)), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("bool_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("dynamic_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float32_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float64_attribute"), knownvalue.Float64Exact(1234.5)), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("int32_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("int64_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("list_attribute"), knownvalue.Null()), @@ -285,11 +285,11 @@ func TestSchemaEphemeralResource_Int32Attribute(t *testing.T) { int32_attribute = 1234 }`), ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("int32_attribute"), knownvalue.Int32Exact(1234)), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("bool_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("dynamic_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float32_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float64_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("int32_attribute"), knownvalue.Int32Exact(1234)), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("int64_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("list_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("list_nested_attribute"), knownvalue.Null()), @@ -331,12 +331,12 @@ func TestSchemaEphemeralResource_Int64Attribute(t *testing.T) { int64_attribute = 1234 }`), ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("int64_attribute"), knownvalue.Int64Exact(1234)), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("bool_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("dynamic_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float32_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float64_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("int32_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("int64_attribute"), knownvalue.Int64Exact(1234)), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("list_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("list_nested_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("list_nested_block"), knownvalue.ListSizeExact(0)), @@ -377,12 +377,6 @@ func TestSchemaEphemeralResource_ListAttribute(t *testing.T) { list_attribute = ["value1"] }`), ConfigStateChecks: []statecheck.StateCheck{ - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("bool_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("dynamic_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float32_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float64_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("int32_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("int64_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("list_attribute"), knownvalue.ListExact( []knownvalue.Check{ @@ -390,6 +384,12 @@ func TestSchemaEphemeralResource_ListAttribute(t *testing.T) { }, ), ), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("bool_attribute"), knownvalue.Null()), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("dynamic_attribute"), knownvalue.Null()), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float32_attribute"), knownvalue.Null()), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float64_attribute"), knownvalue.Null()), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("int32_attribute"), knownvalue.Null()), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("int64_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("list_nested_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("list_nested_block"), knownvalue.ListSizeExact(0)), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("map_attribute"), knownvalue.Null()), @@ -433,13 +433,6 @@ func TestSchemaEphemeralResource_ListNestedAttribute(t *testing.T) { ] }`), ConfigStateChecks: []statecheck.StateCheck{ - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("bool_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("dynamic_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float32_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float64_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("int32_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("int64_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("list_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("list_nested_attribute"), knownvalue.ListExact( []knownvalue.Check{ @@ -449,6 +442,13 @@ func TestSchemaEphemeralResource_ListNestedAttribute(t *testing.T) { }, ), ), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("bool_attribute"), knownvalue.Null()), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("dynamic_attribute"), knownvalue.Null()), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float32_attribute"), knownvalue.Null()), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float64_attribute"), knownvalue.Null()), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("int32_attribute"), knownvalue.Null()), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("int64_attribute"), knownvalue.Null()), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("list_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("list_nested_block"), knownvalue.ListSizeExact(0)), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("map_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("map_nested_attribute"), knownvalue.Null()), @@ -489,14 +489,6 @@ func TestSchemaEphemeralResource_ListNestedBlock(t *testing.T) { } }`), ConfigStateChecks: []statecheck.StateCheck{ - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("bool_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("dynamic_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float32_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float64_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("int32_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("int64_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("list_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("list_nested_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("list_nested_block"), knownvalue.ListExact( []knownvalue.Check{ @@ -506,6 +498,14 @@ func TestSchemaEphemeralResource_ListNestedBlock(t *testing.T) { }, ), ), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("bool_attribute"), knownvalue.Null()), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("dynamic_attribute"), knownvalue.Null()), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float32_attribute"), knownvalue.Null()), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float64_attribute"), knownvalue.Null()), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("int32_attribute"), knownvalue.Null()), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("int64_attribute"), knownvalue.Null()), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("list_attribute"), knownvalue.Null()), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("list_nested_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("map_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("map_nested_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("number_attribute"), knownvalue.Null()), @@ -545,6 +545,13 @@ func TestSchemaEphemeralResource_MapAttribute(t *testing.T) { } }`), ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("map_attribute"), + knownvalue.MapExact( + map[string]knownvalue.Check{ + "key1": knownvalue.StringExact("value1"), + }, + ), + ), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("bool_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("dynamic_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float32_attribute"), knownvalue.Null()), @@ -554,13 +561,6 @@ func TestSchemaEphemeralResource_MapAttribute(t *testing.T) { statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("list_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("list_nested_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("list_nested_block"), knownvalue.ListSizeExact(0)), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("map_attribute"), - knownvalue.MapExact( - map[string]knownvalue.Check{ - "key1": knownvalue.StringExact("value1"), - }, - ), - ), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("map_nested_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("number_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("object_attribute"), knownvalue.Null()), @@ -601,16 +601,6 @@ func TestSchemaEphemeralResource_MapNestedAttribute(t *testing.T) { } }`), ConfigStateChecks: []statecheck.StateCheck{ - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("bool_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("dynamic_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float32_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float64_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("int32_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("int64_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("list_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("list_nested_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("list_nested_block"), knownvalue.ListSizeExact(0)), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("map_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("map_nested_attribute"), knownvalue.MapExact( map[string]knownvalue.Check{ @@ -622,6 +612,16 @@ func TestSchemaEphemeralResource_MapNestedAttribute(t *testing.T) { }, ), ), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("bool_attribute"), knownvalue.Null()), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("dynamic_attribute"), knownvalue.Null()), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float32_attribute"), knownvalue.Null()), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float64_attribute"), knownvalue.Null()), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("int32_attribute"), knownvalue.Null()), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("int64_attribute"), knownvalue.Null()), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("list_attribute"), knownvalue.Null()), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("list_nested_attribute"), knownvalue.Null()), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("list_nested_block"), knownvalue.ListSizeExact(0)), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("map_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("number_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("object_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("object_attribute_with_dynamic"), knownvalue.Null()), @@ -657,6 +657,7 @@ func TestSchemaEphemeralResource_NumberAttribute(t *testing.T) { number_attribute = 1234.5 }`), ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("number_attribute"), knownvalue.NumberExact(big.NewFloat(1234.5))), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("bool_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("dynamic_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float32_attribute"), knownvalue.Null()), @@ -668,7 +669,6 @@ func TestSchemaEphemeralResource_NumberAttribute(t *testing.T) { statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("list_nested_block"), knownvalue.ListSizeExact(0)), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("map_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("map_nested_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("number_attribute"), knownvalue.NumberExact(big.NewFloat(1234.5))), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("object_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("object_attribute_with_dynamic"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("set_attribute"), knownvalue.Null()), @@ -705,6 +705,13 @@ func TestSchemaEphemeralResource_ObjectAttribute(t *testing.T) { } }`), ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("object_attribute"), + knownvalue.ObjectExact( + map[string]knownvalue.Check{ + "object_attribute_attribute": knownvalue.StringExact("value1"), + }, + ), + ), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("bool_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("dynamic_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float32_attribute"), knownvalue.Null()), @@ -717,13 +724,6 @@ func TestSchemaEphemeralResource_ObjectAttribute(t *testing.T) { statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("map_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("map_nested_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("number_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("object_attribute"), - knownvalue.ObjectExact( - map[string]knownvalue.Check{ - "object_attribute_attribute": knownvalue.StringExact("value1"), - }, - ), - ), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("object_attribute_with_dynamic"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("set_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("set_nested_attribute"), knownvalue.Null()), @@ -764,19 +764,6 @@ func TestSchemaEphemeralResource_ObjectAttributeWithDynamic(t *testing.T) { } }`), ConfigStateChecks: []statecheck.StateCheck{ - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("bool_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("dynamic_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float32_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float64_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("int32_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("int64_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("list_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("list_nested_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("list_nested_block"), knownvalue.ListSizeExact(0)), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("map_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("map_nested_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("number_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("object_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("object_attribute_with_dynamic"), knownvalue.ObjectExact( map[string]knownvalue.Check{ @@ -796,6 +783,19 @@ func TestSchemaEphemeralResource_ObjectAttributeWithDynamic(t *testing.T) { }, ), ), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("bool_attribute"), knownvalue.Null()), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("dynamic_attribute"), knownvalue.Null()), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float32_attribute"), knownvalue.Null()), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float64_attribute"), knownvalue.Null()), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("int32_attribute"), knownvalue.Null()), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("int64_attribute"), knownvalue.Null()), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("list_attribute"), knownvalue.Null()), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("list_nested_attribute"), knownvalue.Null()), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("list_nested_block"), knownvalue.ListSizeExact(0)), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("map_attribute"), knownvalue.Null()), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("map_nested_attribute"), knownvalue.Null()), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("number_attribute"), knownvalue.Null()), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("object_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("set_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("set_nested_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("set_nested_block"), knownvalue.ListSizeExact(0)), @@ -828,6 +828,13 @@ func TestSchemaEphemeralResource_SetAttribute(t *testing.T) { set_attribute = ["value1"] }`), ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("set_attribute"), + knownvalue.SetExact( + []knownvalue.Check{ + knownvalue.StringExact("value1"), + }, + ), + ), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("bool_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("dynamic_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float32_attribute"), knownvalue.Null()), @@ -842,13 +849,6 @@ func TestSchemaEphemeralResource_SetAttribute(t *testing.T) { statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("number_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("object_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("object_attribute_with_dynamic"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("set_attribute"), - knownvalue.SetExact( - []knownvalue.Check{ - knownvalue.StringExact("value1"), - }, - ), - ), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("set_nested_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("set_nested_block"), knownvalue.ListSizeExact(0)), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("single_nested_attribute"), knownvalue.Null()), @@ -884,6 +884,15 @@ func TestSchemaEphemeralResource_SetNestedAttribute(t *testing.T) { ] }`), ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("set_nested_attribute"), + knownvalue.SetExact( + []knownvalue.Check{ + knownvalue.ObjectExact(map[string]knownvalue.Check{ + "set_nested_attribute_attribute": knownvalue.StringExact("value1"), + }), + }, + ), + ), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("bool_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("dynamic_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float32_attribute"), knownvalue.Null()), @@ -899,15 +908,6 @@ func TestSchemaEphemeralResource_SetNestedAttribute(t *testing.T) { statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("object_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("object_attribute_with_dynamic"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("set_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("set_nested_attribute"), - knownvalue.SetExact( - []knownvalue.Check{ - knownvalue.ObjectExact(map[string]knownvalue.Check{ - "set_nested_attribute_attribute": knownvalue.StringExact("value1"), - }), - }, - ), - ), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("set_nested_block"), knownvalue.ListSizeExact(0)), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("single_nested_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("single_nested_attribute_with_dynamic"), knownvalue.Null()), @@ -940,6 +940,15 @@ func TestSchemaEphemeralResource_SetNestedBlock(t *testing.T) { } }`), ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("set_nested_block"), + knownvalue.SetExact( + []knownvalue.Check{ + knownvalue.ObjectExact(map[string]knownvalue.Check{ + "set_nested_block_attribute": knownvalue.StringExact("value1"), + }), + }, + ), + ), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("bool_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("dynamic_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float32_attribute"), knownvalue.Null()), @@ -956,15 +965,6 @@ func TestSchemaEphemeralResource_SetNestedBlock(t *testing.T) { statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("object_attribute_with_dynamic"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("set_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("set_nested_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("set_nested_block"), - knownvalue.SetExact( - []knownvalue.Check{ - knownvalue.ObjectExact(map[string]knownvalue.Check{ - "set_nested_block_attribute": knownvalue.StringExact("value1"), - }), - }, - ), - ), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("single_nested_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("single_nested_attribute_with_dynamic"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("single_nested_block"), knownvalue.Null()), @@ -996,6 +996,13 @@ func TestSchemaEphemeralResource_SingleNestedAttribute(t *testing.T) { } }`), ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("single_nested_attribute"), + knownvalue.ObjectExact( + map[string]knownvalue.Check{ + "single_nested_attribute_attribute": knownvalue.StringExact("value1"), + }, + ), + ), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("bool_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("dynamic_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float32_attribute"), knownvalue.Null()), @@ -1013,13 +1020,6 @@ func TestSchemaEphemeralResource_SingleNestedAttribute(t *testing.T) { statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("set_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("set_nested_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("set_nested_block"), knownvalue.ListSizeExact(0)), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("single_nested_attribute"), - knownvalue.ObjectExact( - map[string]knownvalue.Check{ - "single_nested_attribute_attribute": knownvalue.StringExact("value1"), - }, - ), - ), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("single_nested_attribute_with_dynamic"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("single_nested_block"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("single_nested_block_with_dynamic"), knownvalue.Null()), @@ -1055,24 +1055,6 @@ func TestSchemaEphemeralResource_SingleNestedAttributeWithDynamic(t *testing.T) } }`), ConfigStateChecks: []statecheck.StateCheck{ - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("bool_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("dynamic_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float32_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float64_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("int32_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("int64_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("list_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("list_nested_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("list_nested_block"), knownvalue.ListSizeExact(0)), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("map_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("map_nested_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("number_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("object_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("object_attribute_with_dynamic"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("set_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("set_nested_attribute"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("set_nested_block"), knownvalue.ListSizeExact(0)), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("single_nested_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("single_nested_attribute_with_dynamic"), knownvalue.ObjectExact( map[string]knownvalue.Check{ @@ -1092,6 +1074,24 @@ func TestSchemaEphemeralResource_SingleNestedAttributeWithDynamic(t *testing.T) }, ), ), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("bool_attribute"), knownvalue.Null()), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("dynamic_attribute"), knownvalue.Null()), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float32_attribute"), knownvalue.Null()), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float64_attribute"), knownvalue.Null()), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("int32_attribute"), knownvalue.Null()), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("int64_attribute"), knownvalue.Null()), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("list_attribute"), knownvalue.Null()), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("list_nested_attribute"), knownvalue.Null()), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("list_nested_block"), knownvalue.ListSizeExact(0)), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("map_attribute"), knownvalue.Null()), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("map_nested_attribute"), knownvalue.Null()), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("number_attribute"), knownvalue.Null()), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("object_attribute"), knownvalue.Null()), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("object_attribute_with_dynamic"), knownvalue.Null()), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("set_attribute"), knownvalue.Null()), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("set_nested_attribute"), knownvalue.Null()), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("set_nested_block"), knownvalue.ListSizeExact(0)), + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("single_nested_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("single_nested_block"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("single_nested_block_with_dynamic"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("string_attribute"), knownvalue.Null()), @@ -1121,6 +1121,13 @@ func TestSchemaEphemeralResource_SingleNestedBlock(t *testing.T) { } }`), ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("single_nested_block"), + knownvalue.ObjectExact( + map[string]knownvalue.Check{ + "single_nested_block_attribute": knownvalue.StringExact("value1"), + }, + ), + ), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("bool_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("dynamic_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float32_attribute"), knownvalue.Null()), @@ -1140,13 +1147,6 @@ func TestSchemaEphemeralResource_SingleNestedBlock(t *testing.T) { statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("set_nested_block"), knownvalue.ListSizeExact(0)), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("single_nested_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("single_nested_attribute_with_dynamic"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("single_nested_block"), - knownvalue.ObjectExact( - map[string]knownvalue.Check{ - "single_nested_block_attribute": knownvalue.StringExact("value1"), - }, - ), - ), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("single_nested_block_with_dynamic"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("string_attribute"), knownvalue.Null()), }, @@ -1180,6 +1180,25 @@ func TestSchemaEphemeralResource_SingleNestedBlockWithDynamic(t *testing.T) { } }`), ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("single_nested_block_with_dynamic"), + knownvalue.ObjectExact( + map[string]knownvalue.Check{ + "dynamic_attribute": knownvalue.ObjectExact( + map[string]knownvalue.Check{ + "attribute_one": knownvalue.StringExact("value1"), + "attribute_two": knownvalue.Bool(false), + "attribute_three": knownvalue.NumberExact(big.NewFloat(1234.5)), + "attribute_four": knownvalue.TupleExact( + []knownvalue.Check{ + knownvalue.Bool(true), + knownvalue.NumberExact(big.NewFloat(1234.5)), + }, + ), + }, + ), + }, + ), + ), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("bool_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("dynamic_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float32_attribute"), knownvalue.Null()), @@ -1200,25 +1219,6 @@ func TestSchemaEphemeralResource_SingleNestedBlockWithDynamic(t *testing.T) { statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("single_nested_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("single_nested_attribute_with_dynamic"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("single_nested_block"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("single_nested_block_with_dynamic"), - knownvalue.ObjectExact( - map[string]knownvalue.Check{ - "dynamic_attribute": knownvalue.ObjectExact( - map[string]knownvalue.Check{ - "attribute_one": knownvalue.StringExact("value1"), - "attribute_two": knownvalue.Bool(false), - "attribute_three": knownvalue.NumberExact(big.NewFloat(1234.5)), - "attribute_four": knownvalue.TupleExact( - []knownvalue.Check{ - knownvalue.Bool(true), - knownvalue.NumberExact(big.NewFloat(1234.5)), - }, - ), - }, - ), - }, - ), - ), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("string_attribute"), knownvalue.Null()), }, }, @@ -1244,6 +1244,7 @@ func TestSchemaEphemeralResource_StringAttribute(t *testing.T) { string_attribute = "value1" }`), ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("string_attribute"), knownvalue.StringExact("value1")), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("bool_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("dynamic_attribute"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("float32_attribute"), knownvalue.Null()), @@ -1265,7 +1266,6 @@ func TestSchemaEphemeralResource_StringAttribute(t *testing.T) { statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("single_nested_attribute_with_dynamic"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("single_nested_block"), knownvalue.Null()), statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("single_nested_block_with_dynamic"), knownvalue.Null()), - statecheck.ExpectKnownValue("echo.schema_test", echoDataPath.AtMapKey("string_attribute"), knownvalue.StringExact("value1")), }, }, },