-
Notifications
You must be signed in to change notification settings - Fork 178
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
chore: Unifies SDK connection getting in tests #1864
Conversation
@@ -311,7 +310,7 @@ func TestAccConfigRSAlertConfiguration_importBasic(t *testing.T) { | |||
ImportStateIdFunc: importStateProjectIDFunc(resourceName), | |||
ImportState: true, | |||
ImportStateVerify: true, | |||
ImportStateVerifyIgnore: []string{"project_id"}, | |||
ImportStateVerifyIgnore: []string{"project_id", "updated"}, |
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.
fix flaky test where updated attribute sometimes differ in a second
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!!
…ot differ in a second. example: error= | ImportStateVerify attributes not equivalent. Difference is shown below. The - symbol indicates attributes missing after import. | | \u00a0\u00a0map[string]string{ | -\u00a0\t"updated": "2024-01-23T01:33:43Z", | +\u00a0\t"updated": "2024-01-23T01:33:42Z", | \u00a0\u00a0}
306bacd
to
c8e6874
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.
LGTM, small comment
internal/provider/provider.go
Outdated
// muxedProviderFactoryFn creates mux provider using existing sdk v2 provider passed as parameter and creating new instance of framework provider. | ||
// Used in testing where existing sdk v2 provider has to be used. | ||
func MuxedProviderFactoryFn(sdkV2Provider *sdkv2schema.Provider) func() tfprotov6.ProviderServer { | ||
func muxedProviderFactoryFn(sdkV2Provider *sdkv2schema.Provider) func() tfprotov6.ProviderServer { |
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.
Since this function receiving an existing sdkV2Provider is no longer needed, could we define this logic directly in MuxedProviderFactory()
and remove this function?
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.
thx, good idea, done
Description
Unifies SDK connection getting in tests.
Before this PR, SDK connection in tests is got in different ways, not all of them work for migration tests. Here we get the connection in the same way independently of the test type.
Link to any related issue(s): https://jira.mongodb.org/browse/CLOUDP-224848
Type of change:
Required Checklist:
Further comments