Skip to content

Commit

Permalink
move autoscaler tests to different test func
Browse files Browse the repository at this point in the history
  • Loading branch information
rahul2393 committed Oct 26, 2023
1 parent 149fcee commit 741ae59
Showing 1 changed file with 26 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,6 @@ func TestAccSpannerInstance_basic(t *testing.T) {
ImportState: true,
ImportStateVerify: true,
},
{
Config: testAccSpannerInstance_basicWithAutoscalerConfig(idName),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrSet("google_spanner_instance.basic", "state"),
),
},
{
ResourceName: "google_spanner_instance.basic",
ImportState: true,
ImportStateVerify: true,
},
},
})
}
Expand Down Expand Up @@ -153,6 +142,32 @@ func TestAccSpannerInstance_virtualUpdate(t *testing.T) {
})
}

func TestAccSpannerInstance_basicWithAutoscaler(t *testing.T) {
// Randomness
acctest.SkipIfVcr(t)
t.Parallel()

displayName := fmt.Sprintf("spanner-test-%s-dname", acctest.RandString(t, 10))
acctest.VcrTest(t, resource.TestCase{
PreCheck: func() { acctest.AccTestPreCheck(t) },
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
CheckDestroy: testAccCheckSpannerInstanceDestroyProducer(t),
Steps: []resource.TestStep{
{
Config: testAccSpannerInstance_basicWithAutoscalerConfig(displayName),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrSet("google_spanner_instance.basic", "state"),
),
},
{
ResourceName: "google_spanner_instance.basic",
ImportState: true,
ImportStateVerify: true,
},
},
})
}

func testAccSpannerInstance_basic(name string) string {
return fmt.Sprintf(`
resource "google_spanner_instance" "basic" {
Expand Down

0 comments on commit 741ae59

Please sign in to comment.