-
Notifications
You must be signed in to change notification settings - Fork 15
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
Add Deferred Action Testing #253
Conversation
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.
Overall looks good! Just left some considerations for you.
func NewDeferredActionResource() resource.Resource { | ||
return &DeferredActionResource{ | ||
typeName: "_deferred_action", | ||
planModification: false, | ||
} | ||
} | ||
|
||
func NewDeferredActionPlanModificationResource() resource.Resource { | ||
return &DeferredActionResource{ | ||
typeName: "_deferred_action_plan_modification", | ||
planModification: true, | ||
} | ||
} | ||
|
||
// DeferredActionResource is for testing all schema types. | ||
type DeferredActionResource struct { | ||
typeName string | ||
planModification bool | ||
} |
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.
Nice setup 👍
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.
Great work! Left a couple additional comments but nothing blocking 🚀
This PR introduces Deferred Action tests for the
framework5provider
,framework6provider
,sdkv2provider
,protocolprovider
, andprotocolv6provider
.The Framework providers test both automatic provider deferrals and manual deferrals for resource
Read()
,ImportState()
, andModifyPlan()
methods.The SDKv2 providers test automatic provider deferrals with plan modification behavior enabled and disabled.
The terraform-plugin-go providers test the "Error: Invalid Deferred Response" error that is thrown when a provider indicates a deferral without the necessary client capability.