-
Notifications
You must be signed in to change notification settings - Fork 232
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 ProtoV6ProviderFactories to TestCase #761
Conversation
76188d6
to
a7e549f
Compare
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.
This all seems straightforward and like what I expected so far!
I think, ideally, we'd be able to test the version of Terraform we were using and throw a more helpful error if the factories in use weren't supported by that version of Terraform, and it would probably be helpful to have a built-in SkipFunc that skips tests based on Terraform versions, but neither of those are directly related to this PR, so we can tackle that work separately.
In order to support protocol v6 providers in the test suite, we add another field to TestCase along the same lines as ProtoV5ProviderFactories. This is plumbed through as yet another argument in runProviderCommand. We hope that by the time another protocol major version is released, a new, more flexible test framework will be available. plugin.ServeOpts and plugin.DebugServe also expected all provider servers to be v5 servers, so we also add the GRPCProviderV6Func field to ServeOpts to keep it backwards compatible. If both GRPCProviderFunc and GRPCProviderV6Func are set, the v6 server will be ignored.
a7e549f
to
6ba412a
Compare
Added hashicorp/terraform-plugin-testing#68 for the above suggestion, which I agree with. For now I have added a note to the docs for The tests in hashicorp/terraform-provider-corner#18 are passing and that PR will be updated once this one is merged and released. |
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.
Solid, yeah, let's do it!
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. |
In order to support protocol v6 providers in the test suite, we add another
field to
TestCase
along the same lines asProtoV5ProviderFactories
. This isplumbed through as yet another argument in
runProviderCommand
. We hope that bythe time another protocol major version is released, a new, more flexible test
framework will be available.
plugin.ServeOpts
andplugin.DebugServe
also expected all provider servers to bev5 servers, so we also add the
GRPCProviderV6Func
field toServeOpts
to keepit backwards compatible. If both
GRPCProviderFunc
andGRPCProviderV6Func
areset, the v6 server will be ignored.
Alternatively, we could panic if both are set.
fixes #737
needs hashicorp/terraform-exec#182
Tested with terraform-provider-corner at hashicorp/terraform-provider-corner#18.