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: Tries to reduce OUT_OF_CAPACITY during tests by moving cluster creation to other cloud providers #2206

Merged
merged 8 commits into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from 6 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

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ import (

func TestAccDataLakeDSPlural_basic(t *testing.T) {
var (
resourceName = "mongodbatlas_data_lake_pipeline.test"
dataSourceName = "data.mongodbatlas_data_lake_pipelines.testDataSource"
orgID = os.Getenv("MONGODB_ATLAS_ORG_ID")
firstClusterName = acc.RandomClusterName()
secondClusterName = acc.RandomClusterName()
firstPipelineName = acc.RandomName()
secondPipelineName = acc.RandomName()
projectName = acc.RandomProjectName()
resourceName = "mongodbatlas_data_lake_pipeline.test"
dataSourceName = "data.mongodbatlas_data_lake_pipeline.testDataSource"
pluralDataSourceName = "data.mongodbatlas_data_lake_pipelines.testDataSource"
orgID = os.Getenv("MONGODB_ATLAS_ORG_ID")
firstClusterName = acc.RandomClusterName()
secondClusterName = acc.RandomClusterName()
firstPipelineName = acc.RandomName()
secondPipelineName = acc.RandomName()
projectName = acc.RandomProjectName()
)

resource.ParallelTest(t, resource.TestCase{
Expand All @@ -30,7 +31,10 @@ func TestAccDataLakeDSPlural_basic(t *testing.T) {
Config: configDSPlural(orgID, projectName, firstClusterName, secondClusterName, firstPipelineName, secondPipelineName),
Check: resource.ComposeTestCheckFunc(
checkExists(resourceName),
resource.TestCheckResourceAttrSet(dataSourceName, "results.#"),
resource.TestCheckResourceAttrSet(dataSourceName, "project_id"),
resource.TestCheckResourceAttr(dataSourceName, "name", firstPipelineName),
resource.TestCheckResourceAttr(dataSourceName, "state", "ACTIVE"),
resource.TestCheckResourceAttrSet(pluralDataSourceName, "results.#"),
),
},
},
Expand All @@ -45,48 +49,47 @@ func configDSPlural(orgID, projectName, firstClusterName, secondClusterName, fir
name = %[2]q
}


resource "mongodbatlas_advanced_cluster" "aws_conf" {
resource "mongodbatlas_advanced_cluster" "azure_conf" {
project_id = mongodbatlas_project.project.id
name = %[3]q
cluster_type = "REPLICASET"

replication_specs {
region_configs {
electable_specs {
instance_size = "M10"
node_count = 3
region_configs {
electable_specs {
instance_size = "M10"
node_count = 3
}
provider_name = "AZURE"
priority = 7
region_name = "US_EAST_2"
}
provider_name = "AWS"
priority = 7
region_name = "US_EAST_1"
}
}
backup_enabled = true
}

resource "mongodbatlas_advanced_cluster" "aws_conf2" {
resource "mongodbatlas_advanced_cluster" "azure_conf2" {
project_id = mongodbatlas_project.project.id
name = %[4]q
cluster_type = "REPLICASET"

replication_specs {
region_configs {
electable_specs {
instance_size = "M10"
node_count = 3
region_configs {
electable_specs {
instance_size = "M10"
node_count = 3
}
provider_name = "AZURE"
priority = 7
region_name = "US_EAST_2"
}
provider_name = "AWS"
priority = 7
region_name = "US_EAST_1"
}
}
backup_enabled = true
}

resource "mongodbatlas_data_lake_pipeline" "test" {
project_id = mongodbatlas_project.project.id
name = %[5]q
project_id = mongodbatlas_project.project.id
name = %[5]q
sink {
type = "DLS"
partition_fields {
Expand All @@ -97,7 +100,7 @@ func configDSPlural(orgID, projectName, firstClusterName, secondClusterName, fir

source {
type = "ON_DEMAND_CPS"
cluster_name = mongodbatlas_advanced_cluster.aws_conf.name
cluster_name = mongodbatlas_advanced_cluster.azure_conf.name
database_name = "sample_airbnb"
collection_name = "listingsAndReviews"
}
Expand All @@ -121,7 +124,7 @@ func configDSPlural(orgID, projectName, firstClusterName, secondClusterName, fir

source {
type = "ON_DEMAND_CPS"
cluster_name = mongodbatlas_advanced_cluster.aws_conf2.name
cluster_name = mongodbatlas_advanced_cluster.azure_conf2.name
database_name = "sample_airbnb"
collection_name = "listingsAndReviews"
}
Expand All @@ -132,6 +135,10 @@ func configDSPlural(orgID, projectName, firstClusterName, secondClusterName, fir
}
}

data "mongodbatlas_data_lake_pipeline" "testDataSource" {
project_id = mongodbatlas_data_lake_pipeline.test.project_id
}

data "mongodbatlas_data_lake_pipelines" "testDataSource" {
project_id = mongodbatlas_data_lake_pipeline.test.project_id
}
Expand Down
Loading