path not found error for null
attributes in plancheck.ExpectUnknownValue
and plancheck.ExpectSensitiveValue
#188
Labels
bug
Something isn't working
Ref: hashicorp/terraform-plugin-framework#840 (comment)
The error message for an attribute that is null and being asserted as unknown or sensitive can be confusing for developers as it's the same error you'd receive if the attribute didn't exist in the schema.
--- FAIL: Test_ExpectUnknownValue_NullValue (233.24s) path not found: specified key string_attribute not found in map
terraform-plugin-testing version
Relevant provider source code
This recreation was done with the internal testing
plugin-go
provider in this Go module, but the same can be achieved with another TF SDK.Expected Behavior
Given the following test
I would expect an error message similar to other assertion fails, like:
Potential Solutions
This is occurring because
Change.AfterUnknown
andChange.AfterSensitive
don't have the attribute value if it'snil
. Perhaps we can cross-reference with theAfter
property to provide a better error message?The text was updated successfully, but these errors were encountered: