Skip to content

Commit 1f48f77

Browse files
Fixed dataproc metastore service GA tests for a beta-only field (#12106) (#19987)
[upstream:28e20a248b9d45f3b5a9db5b632dc218d6fa9480] Signed-off-by: Modular Magician <[email protected]>
1 parent b7e4c82 commit 1f48f77

File tree

3 files changed

+6
-154
lines changed

3 files changed

+6
-154
lines changed

.changelog/12106.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:none
2+
3+
```

google/services/dataprocmetastore/resource_dataproc_metastore_service_generated_test.go

-154
Original file line numberDiff line numberDiff line change
@@ -581,160 +581,6 @@ resource "google_storage_bucket" "bucket" {
581581
`, context)
582582
}
583583

584-
func TestAccDataprocMetastoreService_dataprocMetastoreServiceAutoscalingMaxScalingFactorExample(t *testing.T) {
585-
t.Parallel()
586-
587-
context := map[string]interface{}{
588-
"random_suffix": acctest.RandString(t, 10),
589-
}
590-
591-
acctest.VcrTest(t, resource.TestCase{
592-
PreCheck: func() { acctest.AccTestPreCheck(t) },
593-
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
594-
CheckDestroy: testAccCheckDataprocMetastoreServiceDestroyProducer(t),
595-
Steps: []resource.TestStep{
596-
{
597-
Config: testAccDataprocMetastoreService_dataprocMetastoreServiceAutoscalingMaxScalingFactorExample(context),
598-
},
599-
{
600-
ResourceName: "google_dataproc_metastore_service.test_resource",
601-
ImportState: true,
602-
ImportStateVerify: true,
603-
ImportStateVerifyIgnore: []string{"labels", "location", "service_id", "terraform_labels"},
604-
},
605-
},
606-
})
607-
}
608-
609-
func testAccDataprocMetastoreService_dataprocMetastoreServiceAutoscalingMaxScalingFactorExample(context map[string]interface{}) string {
610-
return acctest.Nprintf(`
611-
resource "google_dataproc_metastore_service" "test_resource" {
612-
service_id = "tf-test-test-service%{random_suffix}"
613-
location = "us-central1"
614-
615-
# DPMS 2 requires SPANNER database type, and does not require
616-
# a maintenance window.
617-
database_type = "SPANNER"
618-
619-
hive_metastore_config {
620-
version = "3.1.2"
621-
}
622-
623-
scaling_config {
624-
autoscaling_config {
625-
autoscaling_enabled = true
626-
limit_config {
627-
max_scaling_factor = 1.0
628-
}
629-
}
630-
}
631-
}
632-
`, context)
633-
}
634-
635-
func TestAccDataprocMetastoreService_dataprocMetastoreServiceAutoscalingMinAndMaxScalingFactorExample(t *testing.T) {
636-
t.Parallel()
637-
638-
context := map[string]interface{}{
639-
"random_suffix": acctest.RandString(t, 10),
640-
}
641-
642-
acctest.VcrTest(t, resource.TestCase{
643-
PreCheck: func() { acctest.AccTestPreCheck(t) },
644-
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
645-
CheckDestroy: testAccCheckDataprocMetastoreServiceDestroyProducer(t),
646-
Steps: []resource.TestStep{
647-
{
648-
Config: testAccDataprocMetastoreService_dataprocMetastoreServiceAutoscalingMinAndMaxScalingFactorExample(context),
649-
},
650-
{
651-
ResourceName: "google_dataproc_metastore_service.test_resource",
652-
ImportState: true,
653-
ImportStateVerify: true,
654-
ImportStateVerifyIgnore: []string{"labels", "location", "service_id", "terraform_labels"},
655-
},
656-
},
657-
})
658-
}
659-
660-
func testAccDataprocMetastoreService_dataprocMetastoreServiceAutoscalingMinAndMaxScalingFactorExample(context map[string]interface{}) string {
661-
return acctest.Nprintf(`
662-
resource "google_dataproc_metastore_service" "test_resource" {
663-
service_id = "tf-test-test-service%{random_suffix}"
664-
location = "us-central1"
665-
666-
# DPMS 2 requires SPANNER database type, and does not require
667-
# a maintenance window.
668-
database_type = "SPANNER"
669-
670-
hive_metastore_config {
671-
version = "3.1.2"
672-
}
673-
674-
scaling_config {
675-
autoscaling_config {
676-
autoscaling_enabled = true
677-
limit_config {
678-
min_scaling_factor = 0.1
679-
max_scaling_factor = 1.0
680-
}
681-
}
682-
}
683-
}
684-
`, context)
685-
}
686-
687-
func TestAccDataprocMetastoreService_dataprocMetastoreServiceAutoscalingMinScalingFactorExample(t *testing.T) {
688-
t.Parallel()
689-
690-
context := map[string]interface{}{
691-
"random_suffix": acctest.RandString(t, 10),
692-
}
693-
694-
acctest.VcrTest(t, resource.TestCase{
695-
PreCheck: func() { acctest.AccTestPreCheck(t) },
696-
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
697-
CheckDestroy: testAccCheckDataprocMetastoreServiceDestroyProducer(t),
698-
Steps: []resource.TestStep{
699-
{
700-
Config: testAccDataprocMetastoreService_dataprocMetastoreServiceAutoscalingMinScalingFactorExample(context),
701-
},
702-
{
703-
ResourceName: "google_dataproc_metastore_service.test_resource",
704-
ImportState: true,
705-
ImportStateVerify: true,
706-
ImportStateVerifyIgnore: []string{"labels", "location", "service_id", "terraform_labels"},
707-
},
708-
},
709-
})
710-
}
711-
712-
func testAccDataprocMetastoreService_dataprocMetastoreServiceAutoscalingMinScalingFactorExample(context map[string]interface{}) string {
713-
return acctest.Nprintf(`
714-
resource "google_dataproc_metastore_service" "test_resource" {
715-
service_id = "tf-test-test-service%{random_suffix}"
716-
location = "us-central1"
717-
718-
# DPMS 2 requires SPANNER database type, and does not require
719-
# a maintenance window.
720-
database_type = "SPANNER"
721-
722-
hive_metastore_config {
723-
version = "3.1.2"
724-
}
725-
726-
scaling_config {
727-
autoscaling_config {
728-
autoscaling_enabled = true
729-
limit_config {
730-
min_scaling_factor = 0.1
731-
}
732-
}
733-
}
734-
}
735-
`, context)
736-
}
737-
738584
func testAccCheckDataprocMetastoreServiceDestroyProducer(t *testing.T) func(s *terraform.State) error {
739585
return func(s *terraform.State) error {
740586
for name, rs := range s.RootModule().Resources {

website/docs/r/dataproc_metastore_service.html.markdown

+3
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ resource "google_storage_bucket" "bucket" {
291291

292292
```hcl
293293
resource "google_dataproc_metastore_service" "test_resource" {
294+
provider = google-beta
294295
service_id = "test-service"
295296
location = "us-central1"
296297
@@ -322,6 +323,7 @@ resource "google_dataproc_metastore_service" "test_resource" {
322323

323324
```hcl
324325
resource "google_dataproc_metastore_service" "test_resource" {
326+
provider = google-beta
325327
service_id = "test-service"
326328
location = "us-central1"
327329
@@ -354,6 +356,7 @@ resource "google_dataproc_metastore_service" "test_resource" {
354356

355357
```hcl
356358
resource "google_dataproc_metastore_service" "test_resource" {
359+
provider = google-beta
357360
service_id = "test-service"
358361
location = "us-central1"
359362

0 commit comments

Comments
 (0)