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

correct NewProtocol6ProviderServerWithError to match the sdkv2 defini… #303

Conversation

iwarapter
Copy link
Contributor

…tion for ProtoV6ProviderFactories

The SDKv2 TestCase ProtoV6ProviderFactories expects a slightly different function signature, which results in test provider definitions like:

"example": func() (tfprotov6.ProviderServer, error) {
		srv, err := tfsdk.NewProtocol6ProviderServerWithError(New())
		return srv(), err
	},

https://github.com/hashicorp/terraform-plugin-sdk/blob/main/helper/resource/testing.go#L343-L348

This change aligns the function signature to work as below:

	"example": tfsdk.NewProtocol6ProviderServerWithError(New("test")),

I have done some simple integration tests with the corner provider.

@iwarapter iwarapter requested a review from a team as a code owner April 24, 2022 20:01
@iwarapter iwarapter force-pushed the bug/NewProtocol6ProviderServerWithError-not-a-func branch from b5c3df6 to 9b6c996 Compare April 24, 2022 20:02
@bflad bflad added the bug Something isn't working label Apr 25, 2022
@bflad bflad added this to the v0.7.0 milestone Apr 25, 2022
@bflad bflad self-assigned this Apr 25, 2022
Copy link
Member

@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.

Hey @iwarapter 👋 Thanks for catching this. That was indeed the intention here. Since this hasn't been released yet, I'm going to drop the extra changelog entry so it doesn't confuse anyone, but I really appreciate you catching this and fixing it before it was released.

Aside: I'm not sure yet, but as part of #215, we may actually move these to a separate package (along with Serve() and ServeOpts), so we can help reduce the size of tfsdk and clarify the abstractions better as we move closer to a v1.0.0.

@bflad bflad merged commit 11730ba into hashicorp:main Apr 25, 2022
@iwarapter iwarapter deleted the bug/NewProtocol6ProviderServerWithError-not-a-func branch May 10, 2022 21:16
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants