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

Add Deferred Action Testing #253

Merged
merged 9 commits into from
Jun 6, 2024
Merged

Add Deferred Action Testing #253

merged 9 commits into from
Jun 6, 2024

Conversation

SBGoods
Copy link
Contributor

@SBGoods SBGoods commented Jun 4, 2024

This PR introduces Deferred Action tests for the framework5provider, framework6provider, sdkv2provider, protocolprovider, and protocolv6provider.

The Framework providers test both automatic provider deferrals and manual deferrals for resource Read(), ImportState(), and ModifyPlan() 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.

@SBGoods SBGoods requested a review from a team as a code owner June 4, 2024 21:42
Copy link
Contributor

@bflad bflad left a 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.

Comment on lines +19 to +37
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
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice setup 👍

internal/framework5provider/deferred_action_resource.go Outdated Show resolved Hide resolved
Copy link
Member

@austinvalle austinvalle left a 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 🚀

internal/framework5provider/deferred_action_resource.go Outdated Show resolved Hide resolved
internal/framework5provider/deferred_action_resource.go Outdated Show resolved Hide resolved
internal/sdkv2provider/resource_deferred_action_test.go Outdated Show resolved Hide resolved
@SBGoods SBGoods merged commit c961b06 into main Jun 6, 2024
75 checks passed
@SBGoods SBGoods deleted the SBGoods/dfa-testing branch June 6, 2024 18:13
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants