Skip to content

Conversation

austinvalle
Copy link
Member

@austinvalle austinvalle commented Sep 22, 2025

Related Issue

Supersedes #367, fixes for hashicorp/terraform-plugin-framework#1193

Description

The identity that is part of the MoveResourceState state test was reliant on the data passing through ReadResource without erroring. Earlier versions of Terraform that don't support identity were not sending this data, which resulted in the Read for the resource returning a null identity.

As of hashicorp/terraform-plugin-framework#1193, that is no longer valid. Resources must always produce an identity during Read, typically using the state and a remote system.

Since the move resource test is really just taking data from state and putting it into identity, we can just do this during Read as well, since we have no remote system. The check for null is really just to respect that the underlying test assertions in MoveResourceState_identity want to test the logic of MoveResourceState and not ReadResource, but we don't want to do a "no-refresh" test step.

Rollback Plan

  • If a change needs to be reverted, we will roll out an update to the code within 7 days.

Changes to Security Controls

No

@austinvalle austinvalle requested a review from a team as a code owner September 22, 2025 19:52
@austinvalle austinvalle changed the title fix tests + update dependencies framework: Fix MoveResourceState tests and update dependencies Sep 22, 2025
@austinvalle austinvalle changed the title framework: Fix MoveResourceState tests and update dependencies framework: Fix MoveResourceState tests Sep 22, 2025
@austinvalle austinvalle force-pushed the av/identity-test-fixes branch from 7011729 to d5519fd Compare September 22, 2025 20:05
@austinvalle
Copy link
Member Author

austinvalle commented Sep 22, 2025

Commit 7cc14dc shows the tests passing with the recent framework changes in hashicorp/terraform-plugin-framework#1193 . I don't think the commit hash need to make it into the terraform-provider-corner go mod, so I'm going to revert it to merge this PR.


This PR is ready for review 👍🏻

return
}

// Unlike normal resources, this resource can't produce it's identity during read, but it's the same value
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: I understand this comment but it does feel a little like a pronoun game

@rainkwan rainkwan merged commit 5102809 into main Sep 22, 2025
111 checks passed
@rainkwan rainkwan deleted the av/identity-test-fixes branch September 22, 2025 22:29
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.

2 participants