Skip to content

Commit

Permalink
Make `TestAccDataprocMetastoreService_dataprocMetastoreServiceAutosca…
Browse files Browse the repository at this point in the history
…lingNoLimitConfigExample` beta-only (#11111) (#18691)

[upstream:19e0c3ede2b509b767d13ae4eac4635eabbbb056]

Signed-off-by: Modular Magician <magic-modules@google.com>
  • Loading branch information
modular-magician authored Jul 10, 2024
1 parent 12f3731 commit e43c7fc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 48 deletions.
3 changes: 3 additions & 0 deletions .changelog/11111.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:none

```
Original file line number Diff line number Diff line change
Expand Up @@ -643,54 +643,6 @@ resource "google_dataproc_metastore_service" "test_resource" {
`, context)
}

func TestAccDataprocMetastoreService_dataprocMetastoreServiceAutoscalingNoLimitConfigExample(t *testing.T) {
t.Parallel()

context := map[string]interface{}{
"random_suffix": acctest.RandString(t, 10),
}

acctest.VcrTest(t, resource.TestCase{
PreCheck: func() { acctest.AccTestPreCheck(t) },
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
CheckDestroy: testAccCheckDataprocMetastoreServiceDestroyProducer(t),
Steps: []resource.TestStep{
{
Config: testAccDataprocMetastoreService_dataprocMetastoreServiceAutoscalingNoLimitConfigExample(context),
},
{
ResourceName: "google_dataproc_metastore_service.test_resource",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"labels", "location", "service_id", "terraform_labels"},
},
},
})
}

func testAccDataprocMetastoreService_dataprocMetastoreServiceAutoscalingNoLimitConfigExample(context map[string]interface{}) string {
return acctest.Nprintf(`
resource "google_dataproc_metastore_service" "test_resource" {
service_id = "tf-test-test-service%{random_suffix}"
location = "us-central1"
# DPMS 2 requires SPANNER database type, and does not require
# a maintenance window.
database_type = "SPANNER"
hive_metastore_config {
version = "3.1.2"
}
scaling_config {
autoscaling_config {
autoscaling_enabled = true
}
}
}
`, context)
}

func testAccCheckDataprocMetastoreServiceDestroyProducer(t *testing.T) func(s *terraform.State) error {
return func(s *terraform.State) error {
for name, rs := range s.RootModule().Resources {
Expand Down
1 change: 1 addition & 0 deletions website/docs/r/dataproc_metastore_service.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ resource "google_dataproc_metastore_service" "test_resource" {

```hcl
resource "google_dataproc_metastore_service" "test_resource" {
provider = google-beta
service_id = "test-service"
location = "us-central1"
Expand Down

0 comments on commit e43c7fc

Please sign in to comment.