Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

framework: Add semantic equality tests for set bug fix #297

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

austinvalle
Copy link
Member

@austinvalle austinvalle commented Jan 17, 2025

Ref: hashicorp/terraform-plugin-framework#1061
Ref: hashicorp/terraform-plugin-framework#1064

This PR adds a test + resource that recreates the linked bug and tests the fix from framework in the linked PR.

Test failures without the fix (v5, but v6 are the same error messages):

https://github.com/hashicorp/terraform-provider-corner/actions/runs/12830667560/job/35779457519?pr=297

CLI Output
=== RUN   TestSetSemanticEqualityResource
    set_semantic_equality_resource_test.go:18: Step 1/3 error: Error running apply: exit status 1
        
        Error: Provider produced inconsistent result after apply
        
        When applying changes to framework_set_semantic_equality.test, provider
        "provider[\"registry.terraform.io/hashicorp/framework\"]" produced an
        unexpected new value: .set_of_ipv6: planned set element
        cty.StringVal("0:0:0:0:0:0:0:0") does not correlate with any element in
        actual.
        
        This is a bug in the provider, which should be reported in the provider's own
        issue tracker.
        
        Error: Provider produced inconsistent result after apply
        
        When applying changes to framework_set_semantic_equality.test, provider
        "provider[\"registry.terraform.io/hashicorp/framework\"]" produced an
        unexpected new value: .set_of_ipv6: planned set element
        cty.StringVal("0:0:0:0:0:0:0:101") does not correlate with any element in
        actual.
        
        This is a bug in the provider, which should be reported in the provider's own
        issue tracker.
        
        Error: Provider produced inconsistent result after apply
        
        When applying changes to framework_set_semantic_equality.test, provider
        "provider[\"registry.terraform.io/hashicorp/framework\"]" produced an
        unexpected new value: .set_of_ipv6: planned set element
        cty.StringVal("0:0:0:0:0:FFFF:192.168.255.255") does not correlate with any
        element in actual.
        
        This is a bug in the provider, which should be reported in the provider's own
        issue tracker.
        
        Error: Provider produced inconsistent result after apply
        
        When applying changes to framework_set_semantic_equality.test, provider
        "provider[\"registry.terraform.io/hashicorp/framework\"]" produced an
        unexpected new value: .set_of_ipv6: planned set element
        cty.StringVal("2001:0DB8:0000:0000:0008:0800:200C:417A") does not correlate
        with any element in actual.
        
        This is a bug in the provider, which should be reported in the provider's own
        issue tracker.
        
        Error: Provider produced inconsistent result after apply
        
        When applying changes to framework_set_semantic_equality.test, provider
        "provider[\"registry.terraform.io/hashicorp/framework\"]" produced an
        unexpected new value: .set_nested_block: planned set element
        cty.ObjectVal(map[string]cty.Value{"ipv6":cty.StringVal("2001:db8::8:800:200c:417a")})
        does not correlate with any element in actual.
        
        This is a bug in the provider, which should be reported in the provider's own
        issue tracker.
        
        Error: Provider produced inconsistent result after apply
        
        When applying changes to framework_set_semantic_equality.test, provider
        "provider[\"registry.terraform.io/hashicorp/framework\"]" produced an
        unexpected new value: .set_nested_block: planned set element
        cty.ObjectVal(map[string]cty.Value{"ipv6":cty.StringVal("FF01:0:0:0:0:0:0:0")})
        does not correlate with any element in actual.
        
        This is a bug in the provider, which should be reported in the provider's own
        issue tracker.

go.mod Outdated
@@ -5,9 +5,11 @@ go 1.22.7
require (
github.com/hashicorp/go-memdb v1.3.4
github.com/hashicorp/terraform-json v0.24.0
github.com/hashicorp/terraform-plugin-framework v1.13.0
github.com/hashicorp/terraform-plugin-framework v1.13.1-0.20250117124025-7e7910eadc9c
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: Update with released framework version, currently pointing to commit from linked PR

@austinvalle austinvalle marked this pull request as ready for review January 17, 2025 16:03
@austinvalle austinvalle requested a review from a team as a code owner January 17, 2025 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant