-
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
Support changing provider configurations during test steps #779
Comments
Reference: #253 Reference: #628 Reference: #779 Provider developers can now select whether to configure providers for acceptance testing at the `TestCase` or `TestStep` level. Only one level may be used in this current implementation, however it may be possible to allow merged `TestCase` and `TestStep` configuration with additional validation logic to ensure a single provider is not specified multiple times across the merge result of all fields. This change also introduces some upfront `TestCase` and `TestStep` configuration validation when calling any of the `Test` functions, failing the test early if a problem is detected. There are other validations that are possible, however these are considered out of scope.
Reference: #253 Reference: #628 Reference: #779 Provider developers can now select whether to configure providers for acceptance testing at the `TestCase` or `TestStep` level. Only one level may be used in this current implementation, however it may be possible to allow merged `TestCase` and `TestStep` configuration with additional validation logic to ensure a single provider is not specified multiple times across the merge result of all fields. This change also introduces some upfront `TestCase` and `TestStep` configuration validation when calling any of the `Test` functions, failing the test early if a problem is detected. There are other validations that are possible, however these are considered out of scope.
The acceptance testing framework (helper/resource) in v2.17.0 now allows provider developers to specify providers at the resource.Test(t, resource.TestCase{
Steps: []resource.TestStep{
{
ExternalProviders: map[string]resource.ExternalProvider{
"random": {
VersionConstraint: "...", // last version of old schema version
Source: "example-namespace/example",
},
},
Config: "...",
Check: /* ... */,
},
{
ProviderFactories: testAccProviders,
Config: "...",
Check: /* ... */,
},
},
}) |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
SDK version
Use-cases
To be able to test upgrading providers between different versions, it would be helpful if we could specify a different set of providers per test step, not just in the test case.
Attempted Solutions
Proposal
Adding the
ProviderFactories
,ProtoV5ProviderFactories
,ProtoV6ProviderFactories
, andExternalProviders
properties fromresource.TestCase
toresource.TestStep
.References
The text was updated successfully, but these errors were encountered: