Skip to content

Commit

Permalink
tests: acc tests mark missing tiers correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
gersonsosa committed Nov 15, 2024
1 parent c4a5295 commit 51d8163
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 73 deletions.
33 changes: 17 additions & 16 deletions ec/acc/deployment_basic_defaults_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,7 @@ func TestAccDeployment_basic_defaults_first(t *testing.T) {
resource.TestCheckResourceAttr(resName, "kibana.size", "1g"),
resource.TestCheckResourceAttr(resName, "kibana.size_resource", "memory"),
resource.TestCheckResourceAttr(resName, "kibana.zone_count", "1"),
resource.TestCheckResourceAttrSet(resName, "apm.instance_configuration_id"),
resource.TestCheckResourceAttr(resName, "apm.size", "1g"),
resource.TestCheckResourceAttr(resName, "apm.size_resource", "memory"),
resource.TestCheckResourceAttr(resName, "apm.zone_count", "1"),
resource.TestCheckNoResourceAttr(resName, "apm"),
resource.TestCheckResourceAttrSet(resName, "enterprise_search.instance_configuration_id"),
resource.TestCheckResourceAttr(resName, "enterprise_search.size", "2g"),
resource.TestCheckResourceAttr(resName, "enterprise_search.size_resource", "memory"),
Expand Down Expand Up @@ -142,9 +139,19 @@ func TestAccDeployment_basic_defaults_hw(t *testing.T) {
resource.TestCheckResourceAttr(resName, "elasticsearch.hot.size_resource", "memory"),
resource.TestCheckResourceAttrSet(resName, "elasticsearch.hot.node_roles.#"),
resource.TestCheckResourceAttr(resName, "elasticsearch.hot.zone_count", "2"),
resource.TestCheckNoResourceAttr(resName, "kibana"),
resource.TestCheckNoResourceAttr(resName, "apm"),
resource.TestCheckNoResourceAttr(resName, "enterprise_search"),

resource.TestCheckResourceAttrSet(resName, "kibana.instance_configuration_id"),
resource.TestCheckResourceAttr(resName, "kibana.size", "1g"),
resource.TestCheckResourceAttr(resName, "kibana.size_resource", "memory"),
resource.TestCheckResourceAttr(resName, "kibana.zone_count", "1"),
resource.TestCheckResourceAttr(resName, "apm.size", "2g"),
resource.TestCheckResourceAttrSet(resName, "apm.instance_configuration_id"),
resource.TestCheckResourceAttr(resName, "apm.size_resource", "memory"),
resource.TestCheckResourceAttr(resName, "apm.zone_count", "1"),
resource.TestCheckResourceAttrSet(resName, "enterprise_search.instance_configuration_id"),
resource.TestCheckResourceAttr(resName, "enterprise_search.size", "2g"),
resource.TestCheckResourceAttr(resName, "enterprise_search.size_resource", "memory"),
resource.TestCheckResourceAttr(resName, "enterprise_search.zone_count", "1"),
),
},
{
Expand All @@ -162,18 +169,12 @@ func TestAccDeployment_basic_defaults_hw(t *testing.T) {
resource.TestCheckResourceAttr(resName, "elasticsearch.hot.zone_count", "2"),
resource.TestCheckResourceAttrSet(resName, "elasticsearch.warm.node_roles.#"),
resource.TestCheckResourceAttr(resName, "elasticsearch.warm.zone_count", "2"),
resource.TestCheckResourceAttr(resName, "kibana.size", "1g"),
resource.TestCheckResourceAttrSet(resName, "kibana.instance_configuration_id"),
resource.TestCheckResourceAttr(resName, "kibana.size", "1g"),
resource.TestCheckResourceAttr(resName, "kibana.size_resource", "memory"),
resource.TestCheckResourceAttr(resName, "kibana.zone_count", "1"),
resource.TestCheckResourceAttr(resName, "apm.size", "2g"),
resource.TestCheckResourceAttrSet(resName, "apm.instance_configuration_id"),
resource.TestCheckResourceAttr(resName, "apm.size_resource", "memory"),
resource.TestCheckResourceAttr(resName, "apm.zone_count", "1"),
resource.TestCheckResourceAttrSet(resName, "enterprise_search.instance_configuration_id"),
resource.TestCheckResourceAttr(resName, "enterprise_search.size", "2g"),
resource.TestCheckResourceAttr(resName, "enterprise_search.size_resource", "memory"),
resource.TestCheckResourceAttr(resName, "enterprise_search.zone_count", "1"),
resource.TestCheckNoResourceAttr(resName, "apm"),
resource.TestCheckNoResourceAttr(resName, "enterprise_search"),
),
},
},
Expand Down
9 changes: 1 addition & 8 deletions ec/acc/deployment_cpu_optimized_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,7 @@ func TestAccDeployment_cpuOptimized(t *testing.T) {
resource.TestCheckResourceAttr(resName, "kibana.size", "1g"),
resource.TestCheckResourceAttr(resName, "kibana.size_resource", "memory"),
resource.TestCheckNoResourceAttr(resName, "apm"),
resource.TestCheckResourceAttr(resName, "apm.zone_count", "1"),
resource.TestCheckResourceAttrSet(resName, "apm.instance_configuration_id"),
resource.TestCheckResourceAttr(resName, "apm.size", "1g"),
resource.TestCheckResourceAttr(resName, "apm.size_resource", "memory"),
resource.TestCheckResourceAttr(resName, "enterprise_search.zone_count", "1"),
resource.TestCheckResourceAttrSet(resName, "enterprise_search.instance_configuration_id"),
resource.TestCheckResourceAttr(resName, "enterprise_search.size", "1g"),
resource.TestCheckResourceAttr(resName, "enterprise_search.size_resource", "memory"),
resource.TestCheckNoResourceAttr(resName, "enterprise_search"),
),
},
{
Expand Down
40 changes: 8 additions & 32 deletions ec/acc/deployment_general_purpose_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,22 +54,10 @@ func TestAccDeployment_general_purpose(t *testing.T) {
resource.TestCheckResourceAttrSet(resName, "elasticsearch.warm.node_roles.#"),
resource.TestCheckResourceAttr(resName, "elasticsearch.warm.zone_count", "2"),

resource.TestCheckResourceAttrSet(resName, "kibana.instance_configuration_id"),
resource.TestCheckResourceAttr(resName, "kibana.size", "1g"),
resource.TestCheckResourceAttr(resName, "kibana.size_resource", "memory"),
resource.TestCheckResourceAttr(resName, "kibana.zone_count", "1"),
resource.TestCheckResourceAttr(resName, "apm.size", "2g"),
resource.TestCheckResourceAttrSet(resName, "apm.instance_configuration_id"),
resource.TestCheckResourceAttr(resName, "apm.size_resource", "memory"),
resource.TestCheckResourceAttr(resName, "apm.zone_count", "1"),
resource.TestCheckResourceAttrSet(resName, "enterprise_search.instance_configuration_id"),
resource.TestCheckResourceAttr(resName, "enterprise_search.size", "2g"),
resource.TestCheckResourceAttr(resName, "enterprise_search.size_resource", "memory"),
resource.TestCheckResourceAttr(resName, "enterprise_search.zone_count", "1"),
resource.TestCheckResourceAttrSet(resName, "integrations_server.instance_configuration_id"),
resource.TestCheckResourceAttr(resName, "integrations_server.size", "2g"),
resource.TestCheckResourceAttr(resName, "integrations_server.size_resource", "memory"),
resource.TestCheckResourceAttr(resName, "integrations_server.zone_count", "1"),
resource.TestCheckNoResourceAttr(resName, "kibana"),
resource.TestCheckNoResourceAttr(resName, "apm"),
resource.TestCheckNoResourceAttr(resName, "enterprise_search"),
resource.TestCheckNoResourceAttr(resName, "integrations_server"),
),
},
{
Expand All @@ -89,22 +77,10 @@ func TestAccDeployment_general_purpose(t *testing.T) {
resource.TestCheckResourceAttrSet(resName, "elasticsearch.hot.node_roles.#"),
resource.TestCheckResourceAttrSet(resName, "elasticsearch.warm.node_roles.#"),

resource.TestCheckResourceAttrSet(resName, "kibana.instance_configuration_id"),
resource.TestCheckResourceAttr(resName, "kibana.size", "1g"),
resource.TestCheckResourceAttr(resName, "kibana.size_resource", "memory"),
resource.TestCheckResourceAttr(resName, "kibana.zone_count", "1"),
resource.TestCheckResourceAttr(resName, "apm.size", "2g"),
resource.TestCheckResourceAttrSet(resName, "apm.instance_configuration_id"),
resource.TestCheckResourceAttr(resName, "apm.size_resource", "memory"),
resource.TestCheckResourceAttr(resName, "apm.zone_count", "1"),
resource.TestCheckResourceAttrSet(resName, "enterprise_search.instance_configuration_id"),
resource.TestCheckResourceAttr(resName, "enterprise_search.size", "2g"),
resource.TestCheckResourceAttr(resName, "enterprise_search.size_resource", "memory"),
resource.TestCheckResourceAttr(resName, "enterprise_search.zone_count", "1"),
resource.TestCheckResourceAttrSet(resName, "integrations_server.instance_configuration_id"),
resource.TestCheckResourceAttr(resName, "integrations_server.size", "2g"),
resource.TestCheckResourceAttr(resName, "integrations_server.size_resource", "memory"),
resource.TestCheckResourceAttr(resName, "integrations_server.zone_count", "1"),
resource.TestCheckNoResourceAttr(resName, "kibana"),
resource.TestCheckNoResourceAttr(resName, "apm"),
resource.TestCheckNoResourceAttr(resName, "enterprise_search"),
resource.TestCheckNoResourceAttr(resName, "integrations_server"),
),
},
},
Expand Down
2 changes: 1 addition & 1 deletion ec/acc/deployment_template_migration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func TestAccDeployment_template_migration(t *testing.T) {
randomName := prefix + acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum)
basicCfg := "testdata/deployment_cpu_optimized_1.tf"
region := getRegion()
cfg := fixtureAccDeploymentResourceBasicDefaults(t, basicCfg, randomName, region, cpuOpTemplate)
cfg := fixtureAccDeploymentResourceBasicDefaults(t, basicCfg, randomName, region, cpuOpFasterTemplate)
generalPurposeOptCfg := fixtureAccDeploymentResourceBasicDefaults(t, basicCfg, randomName, region, generalPurposeTemplate)

resource.ParallelTest(t, resource.TestCase{
Expand Down
28 changes: 12 additions & 16 deletions ec/acc/deployment_vector_search_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,27 +74,25 @@ func TestAccDeployment_vector_search(t *testing.T) {
resource.TestCheckNoResourceAttr(vectorSearchResName, "elasticsearch.hot.node_type_ml"),
resource.TestCheckResourceAttrSet(vectorSearchResName, "elasticsearch.hot.node_roles.#"),
resource.TestCheckResourceAttr(vectorSearchResName, "elasticsearch.hot.zone_count", "2"),
resource.TestCheckResourceAttr(vectorSearchResName, "elasticsearch.hot.node_type_data", "true"),
resource.TestCheckResourceAttr(vectorSearchResName, "elasticsearch.hot.node_type_ingest", "true"),
resource.TestCheckResourceAttr(vectorSearchResName, "elasticsearch.hot.node_type_master", "true"),
resource.TestCheckResourceAttr(vectorSearchResName, "elasticsearch.hot.node_type_ml", "true"),
resource.TestCheckNoResourceAttr(sourceResName, "kibana"),
resource.TestCheckNoResourceAttr(sourceResName, "apm"),
resource.TestCheckNoResourceAttr(sourceResName, "enterprise_search"),

// Source Checks
resource.TestCheckResourceAttrSet(sourceResName, "elasticsearch.hot.instance_configuration_id"),
resource.TestCheckResourceAttr(sourceResName, "elasticsearch.hot.size", "1g"),
resource.TestCheckResourceAttr(sourceResName, "elasticsearch.hot.size_resource", "memory"),
resource.TestCheckResourceAttrSet(sourceResName, "elasticsearch.hot.node_roles.#"),
resource.TestCheckResourceAttr(sourceResName, "elasticsearch.hot.zone_count", "1"),
resource.TestCheckNoResourceAttr(sourceResName, "elasticsearch.hot.node_type_data"),
resource.TestCheckNoResourceAttr(sourceResName, "elasticsearch.hot.node_type_ingest"),
resource.TestCheckNoResourceAttr(sourceResName, "elasticsearch.hot.node_type_master"),
resource.TestCheckNoResourceAttr(sourceResName, "elasticsearch.hot.node_type_ml"),
resource.TestCheckResourceAttrSet(sourceResName, "elasticsearch.hot.node_roles.#"),

resource.TestCheckNoResourceAttr(sourceResName, "kibana"),
resource.TestCheckNoResourceAttr(sourceResName, "apm"),
resource.TestCheckNoResourceAttr(sourceResName, "enterprise_search"),
resource.TestCheckResourceAttrSet(sourceResName, "kibana.instance_configuration_id"),
resource.TestCheckResourceAttr(sourceResName, "kibana.size", "1g"),
resource.TestCheckResourceAttr(sourceResName, "kibana.size_resource", "memory"),
resource.TestCheckResourceAttr(sourceResName, "apm.size", "1g"),
resource.TestCheckResourceAttr(sourceResName, "apm.size_resource", "memory"),
resource.TestCheckResourceAttr(sourceResName, "enterprise_search.size", "1g"),
resource.TestCheckResourceAttr(sourceResName, "enterprise_search.size_resource", "memory"),
),
},
{
Expand All @@ -116,14 +114,12 @@ func TestAccDeployment_vector_search(t *testing.T) {

resource.TestCheckResourceAttrSet(vectorSearchResName, "elasticsearch.hot.node_roles.#"),
resource.TestCheckResourceAttr(vectorSearchResName, "elasticsearch.hot.zone_count", "1"),
resource.TestCheckResourceAttr(vectorSearchResName, "kibana.zone_count", "1"),

resource.TestCheckResourceAttrSet(vectorSearchResName, "kibana.instance_configuration_id"),
resource.TestCheckResourceAttr(vectorSearchResName, "kibana.size", "1g"),
resource.TestCheckResourceAttr(vectorSearchResName, "kibana.size_resource", "memory"),
resource.TestCheckResourceAttr(vectorSearchResName, "apm.size", "1g"),
resource.TestCheckResourceAttr(vectorSearchResName, "apm.size_resource", "memory"),
resource.TestCheckResourceAttr(vectorSearchResName, "enterprise_search.size", "1g"),
resource.TestCheckResourceAttr(vectorSearchResName, "enterprise_search.size_resource", "memory"),
resource.TestCheckNoResourceAttr(vectorSearchResName, "apm"),
resource.TestCheckNoResourceAttr(vectorSearchResName, "enterprise_search"),
),
},
},
Expand Down

0 comments on commit 51d8163

Please sign in to comment.