-
Notifications
You must be signed in to change notification settings - Fork 210
chore: Updates advanced_cluster migration tests to primarily use TPF #3555
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: Updates advanced_cluster migration tests to primarily use TPF #3555
Conversation
| package advancedcluster_test | ||
|
|
||
| import ( | ||
| "fmt" |
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.
internal/service/advancedcluster/resource_advanced_cluster_migration_test.go and internal/service/advancedcluster/resource_advanced_cluster_test.go will be moved to tpf package in follow-up PRs
| Config: configGeoShardedOldSchema(t, projectID, clusterName, 2, 2, false, isSDKv2), | ||
| Check: resource.ComposeAggregateTestCheckFunc( | ||
| checkGeoShardedOldSchema(usePreviewProvider, clusterName, 2, 2, true, false), | ||
| checkGeoShardedOldSchema(isTPF, clusterName, 2, 2, true, false), |
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 migration tests run for both SDK & TPF, I've not updated the check methods but have removed usages of acc.ConvertAdvancedClusterToPreviewProviderV2()
internal/service/advancedcluster/resource_advanced_cluster_migration_test.go
Show resolved
Hide resolved
EspenAlbert
left a comment
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.
What is the migration testing strategy for 1.x.x --> 2.x.x.
Will we test:
- SDKv2 implementation --> v2 implementation
- TPF implementation --> v2 implementation
I am assuming both?
| { | ||
| ExternalProviders: acc.ExternalProviders(versionBeforeTPFGARelease), | ||
| Config: configShardedTransitionOldToNewSchema(t, false, projectID, clusterName, true, false), | ||
| Check: checkShardedTransitionOldToNewSchema(false, true), | ||
| }, |
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.
q: Where you able to confirm this intermediate step of removing num_shards is necessary before 2.x upgrade?
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.
I ran TestMigAdvancedCluster_geoShardedMigrationFromOldToNewSchema without the second step & it did work. Should we update the guide or leave it as is?
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.
I would be more inclined to adjusting the guide. Can we bring this up in the technical sync so we align and make sure we are not missing anything?
| } | ||
|
|
||
| func configShardedNewSchema(t *testing.T, usePreviewProvider bool, orgID, projectName, name string, diskSizeGB int, firstInstanceSize, lastInstanceSize string, firstDiskIOPS, lastDiskIOPS *int, includeMiddleSpec, increaseDiskSizeShard2 bool) string { | ||
| func configShardedNewSchema(t *testing.T, orgID, projectName, name string, diskSizeGB int, firstInstanceSize, lastInstanceSize string, firstDiskIOPS, lastDiskIOPS *int, includeMiddleSpec, increaseDiskSizeShard2 bool, useSDKv2 ...bool) string { |
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.
why do we pass useSDKv2 as a boolean list?
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.
to keep it as an optional parameter, so not every caller has to use/specify it, only the migration functions
| name = %[3]q | ||
| backup_enabled = false | ||
| cluster_type = "SHARDED" | ||
| dataSourcesConfig := ` |
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.
Thinking if for cases where we need both SDK v2 and TPF syntax configs (believe it would only be migration tests), we continue leveraging a conversion function similar to ConvertAdvancedClusterToPreviewProviderV2 to avoid duplicating configs. Maybe this is only for select number of tests and not needed.
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.
yeah that's why for now I chose to duplicate the configs and handle migration tests separately. If we see a need for much such test cases arising then we can consider a conversion function but at this point I don't think that's required
| const versionBeforeISSRelease = "1.17.6" | ||
|
|
||
| // last version that supported mongodbatlas_advanced_cluster SDKv2 resource | ||
| const versionBeforeTPFGARelease = "1.39.0" |
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.
based on the q-plan, we'll still have until 1.41.0
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.
updated the workflow to use MONGODB_ATLAS_LAST_1X_VERSION env var instead of hardcoding, lmk WYT
…34497-disable_adv_clusterSDKv2-b-make-tpf-primary
…34497-disable_adv_clusterSDKv2-b-make-tpf-primary
| - name: Acceptance Tests | ||
| env: | ||
| MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} | ||
| MONGODB_ATLAS_LAST_1X_VERSION: ${{ inputs.mongodb_atlas_last_1x_version }} |
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.
Would it make sense to create a advanced_cluster_tpf_mig_from_tpf? This way we will have a clean separation between acc/mig tests?
| uses: ./.github/workflows/acceptance-tests.yml | ||
| with: | ||
| reduced_tests: true | ||
| reduced_tests: false |
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.
Is this for debugging? Shouldn't it be true by default?
|
|
||
| resource.ParallelTest(t, resource.TestCase{ | ||
| PreCheck: func() { mig.PreCheckBasic(t) }, | ||
| PreCheck: func() { mig.PreCheckBasic(t); mig.PreCheckLast1XVersion(t) }, |
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.
I see this pre check only in 2 migration tests. Do we plan on using it in more?
I guess, all mig tests will use the latests version, but as soon as we release 2.0 we will only have two tests covering this.
An alternative would be to use a different test group for testing 1.x --> 2.latest and pass LAST_VERSION env-var explicilty using the MONGODB_ATLAS_LAST_1X_VERSION
| } | ||
|
|
||
| func TestCheckResourceAttrPreviewProviderV2(usePreviewProvider bool, name, key, value string) resource.TestCheckFunc { | ||
| func TestCheckResourceAttrTPF(usePreviewProvider bool, name, key, value string) resource.TestCheckFunc { |
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.
I'm struggling a bit to understand this function now.
We are using TPF in the name, but arguments and calls uses previewProvider.
Any way to simplify this? Can we remove previewProvider everywhere?
df5313f
into
CLOUDP-334497-disable_adv_clusterSDKv2-b
Description
Updates advanced_cluster migration tests to primarily use TPF. This is a follow-up to #3547
Link to any related issue(s): CLOUDP-334497
Type of change:
Required Checklist:
Further comments