hashicorp / terraform-plugin-framework

A next-generation framework for building Terraform providers.
https://developer.hashicorp.com/terraform/plugin/framework
Mozilla Public License 2.0
305 stars 93 forks source link

docs: Miscellaneous doc fixes in attribute + unit tests #1027

Closed austinvalle closed 2 months ago

austinvalle commented 3 months ago

Just some cleaning up I found while working on something else.


FYI, for the unit tests being uncommented, they were originally failing because collection types with missing element types are considered invalid, and thus not equal: https://github.com/hashicorp/terraform-plugin-framework/blob/91edd79716f11d776a12427a8d49a6a15e0566b9/types/basetypes/list_type.go#L112-L115

Since all these custom type tests were embedding the underlying collection type, the element type was nil, thus failing the cmp.Diff in all the tests with a confusing diff 😆

--- FAIL: TestMapNestedAttributeGetType (0.00s)
    --- FAIL: TestMapNestedAttributeGetType/custom-type (0.00s)
        /Users/austin.valle/code/terraform-plugin-framework/resource/schema/map_nested_attribute_test.go:411: unexpected difference:   testtypes.MapType(
            -   {},
            +   {},
              )

The int64/int32/float64/float32/object unit tests were never failing, but likely just commented out on accident 👍🏻

austinvalle commented 3 months ago

~Also contains the linter fixes for go 1.23 😆~

Edit: Framework linting fixes are in main now!