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

chore: Uses advanced_cluster instead of cluster in tests #2392

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -273,41 +273,65 @@ const (
replication_specs {
zone_name = "US"
num_shards = 1
regions_config {
region_configs {
auto_scaling {
disk_gb_enabled = false
}
region_name = "US_EAST_1"
electable_nodes = 3
provider_name = "AWS"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you planning to move rep specs to testutil packages in following PRs?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

priority = 7
read_only_nodes = 0
electable_specs {
instance_size = "M10"
node_count = 3
}
}
}
replication_specs {
zone_name = "EU"
num_shards = 1
regions_config {
region_configs {
auto_scaling {
disk_gb_enabled = false
}
region_name = "EU_WEST_1"
electable_nodes = 3
provider_name = "AWS"
priority = 7
read_only_nodes = 0
electable_specs {
instance_size = "M10"
node_count = 3
}
}
}
replication_specs {
zone_name = "DE"
num_shards = 1
regions_config {
region_configs {
auto_scaling {
disk_gb_enabled = false
}
region_name = "EU_NORTH_1"
electable_nodes = 3
provider_name = "AWS"
priority = 7
read_only_nodes = 0
electable_specs {
instance_size = "M10"
node_count = 3
}
}
}
replication_specs {
zone_name = "JP"
num_shards = 1
regions_config {
region_configs {
auto_scaling {
disk_gb_enabled = false
}
region_name = "AP_NORTHEAST_1"
electable_nodes = 3
provider_name = "AWS"
priority = 7
read_only_nodes = 0
electable_specs {
instance_size = "M10"
node_count = 3
}
}
}
`
Expand Down
28 changes: 16 additions & 12 deletions internal/testutil/acc/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,23 +61,27 @@ func GetClusterInfo(tb testing.TB, req *ClusterRequest) ClusterInfo {
`, req.ResourceDependencyName)
}
clusterTerraformStr := fmt.Sprintf(`
resource "mongodbatlas_cluster" "test_cluster" {
resource "mongodbatlas_advanced_cluster" "test_cluster" {
project_id = %[1]q
name = %[2]q
cloud_backup = %[3]t
auto_scaling_disk_gb_enabled = false
provider_name = %[4]q
provider_instance_size_name = "M10"

cluster_type = %[5]q
backup_enabled = %[3]t
cluster_type = %[5]q

replication_specs {
num_shards = 1
zone_name = "Zone 1"
regions_config {
region_name = "US_WEST_2"
electable_nodes = 3
region_configs {
auto_scaling {
disk_gb_enabled = false
}
provider_name = %[4]q
region_name = "US_WEST_2"
priority = 7
read_only_nodes = 0

electable_specs {
instance_size = "M10"
node_count = 3
}
}
}
%[6]s
Expand All @@ -88,7 +92,7 @@ func GetClusterInfo(tb testing.TB, req *ClusterRequest) ClusterInfo {
ProjectIDStr: fmt.Sprintf("%q", projectID),
ProjectID: projectID,
ClusterName: clusterName,
ClusterNameStr: "mongodbatlas_cluster.test_cluster.name",
ClusterNameStr: "mongodbatlas_advanced_cluster.test_cluster.name",
ClusterTerraformStr: clusterTerraformStr,
}
}
Expand Down