From c625277abc5be0b0ea840fc1f3cd54e3a5c0cb41 Mon Sep 17 00:00:00 2001 From: The Magician Date: Mon, 16 Oct 2023 15:46:27 -0700 Subject: [PATCH] Fix test TestAccDataprocClusterLabelsMigration_withRemoval (#9245) (#6515) [upstream:7e230fd4fdc8986472f2cdf9b335c3f00d974783] Signed-off-by: Modular Magician --- .changelog/9245.txt | 3 ++ .../resource_dataproc_cluster_upgrade_test.go | 51 ------------------- 2 files changed, 3 insertions(+), 51 deletions(-) create mode 100644 .changelog/9245.txt diff --git a/.changelog/9245.txt b/.changelog/9245.txt new file mode 100644 index 0000000000..8ec013c069 --- /dev/null +++ b/.changelog/9245.txt @@ -0,0 +1,3 @@ +```release-note:none + +``` diff --git a/google-beta/services/dataproc/resource_dataproc_cluster_upgrade_test.go b/google-beta/services/dataproc/resource_dataproc_cluster_upgrade_test.go index 1eba7d7c8d..2b42ce7cb1 100644 --- a/google-beta/services/dataproc/resource_dataproc_cluster_upgrade_test.go +++ b/google-beta/services/dataproc/resource_dataproc_cluster_upgrade_test.go @@ -163,54 +163,3 @@ func TestAccDataprocClusterLabelsMigration_withUpdate(t *testing.T) { }, }) } - -// This test fails in the nightly test. The reason to keep it is that -// it could tell if the new model is broken later. -func TestAccDataprocClusterLabelsMigration_withRemoval(t *testing.T) { - acctest.SkipIfVcr(t) - t.Parallel() - - rnd := acctest.RandString(t, 10) - var cluster dataproc.Cluster - oldVersion := map[string]resource.ExternalProvider{ - "google": { - VersionConstraint: "4.65.0", // a version that doesn't separate user defined labels and system labels - Source: "registry.terraform.io/hashicorp/google", - }, - } - - acctest.VcrTest(t, resource.TestCase{ - PreCheck: func() { acctest.AccTestPreCheck(t) }, - CheckDestroy: testAccCheckDataprocClusterDestroy(t), - Steps: []resource.TestStep{ - { - Config: testAccDataprocCluster_withLabels(rnd), - ExternalProviders: oldVersion, - }, - { - Config: testAccDataprocCluster_withoutLabels(rnd), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), - Check: resource.ComposeTestCheckFunc( - testAccCheckDataprocClusterExists(t, "google_dataproc_cluster.with_labels", &cluster), - - resource.TestCheckNoResourceAttr("google_dataproc_cluster.with_labels", "labels.%"), - // GCP adds three and goog-dataproc-autozone is added internally, so expect 4. - resource.TestCheckResourceAttr("google_dataproc_cluster.with_labels", "effective_labels.%", "4"), - ), - }, - { - Config: testAccDataprocCluster_withLabels(rnd), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), - Check: resource.ComposeTestCheckFunc( - testAccCheckDataprocClusterExists(t, "google_dataproc_cluster.with_labels", &cluster), - - resource.TestCheckResourceAttr("google_dataproc_cluster.with_labels", "labels.%", "1"), - resource.TestCheckResourceAttr("google_dataproc_cluster.with_labels", "labels.key1", "value1"), - // We only provide one, but GCP adds three and goog-dataproc-autozone is added internally, so expect 5. - resource.TestCheckResourceAttr("google_dataproc_cluster.with_labels", "effective_labels.%", "5"), - resource.TestCheckResourceAttr("google_dataproc_cluster.with_labels", "effective_labels.key1", "value1"), - ), - }, - }, - }) -}