-
Notifications
You must be signed in to change notification settings - Fork 15
framework: Fix MoveResourceState tests
#382
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
Conversation
MoveResourceState tests and update dependencies
MoveResourceState tests and update dependenciesMoveResourceState tests
7011729 to
d5519fd
Compare
…rm-provider-corner into av/identity-test-fixes
|
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 This PR is ready for review 👍🏻 |
This reverts commit 7cc14dc.
| return | ||
| } | ||
|
|
||
| // Unlike normal resources, this resource can't produce it's identity during read, but it's the same value |
There was a problem hiding this comment.
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
Related Issue
Supersedes #367, fixes for hashicorp/terraform-plugin-framework#1193
Description
The identity that is part of the
MoveResourceStatestate test was reliant on the data passing throughReadResourcewithout erroring. Earlier versions of Terraform that don't support identity were not sending this data, which resulted in theReadfor 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
Readas well, since we have no remote system. The check for null is really just to respect that the underlying test assertions inMoveResourceState_identitywant to test the logic ofMoveResourceStateand notReadResource, but we don't want to do a "no-refresh" test step.Rollback Plan
Changes to Security Controls
No