Skip to content

Commit

Permalink
Check that we can update labels
Browse files Browse the repository at this point in the history
  • Loading branch information
julienduchesne committed Feb 13, 2024
1 parent 6953293 commit 298d8ee
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions internal/resources/cloud/resource_cloud_stack_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ func TestResourceStack_Basic(t *testing.T) {
resource.TestCheckResourceAttr("grafana_cloud_stack.test", "status", "active"),
resource.TestCheckResourceAttr("grafana_cloud_stack.test", "labels.tf", "true"),
resource.TestCheckResourceAttr("grafana_cloud_stack.test", "labels.source", "terraform"),
resource.TestCheckResourceAttr("grafana_cloud_stack.test", "labels.#", "2"),
resource.TestCheckResourceAttr("grafana_cloud_stack.test", "labels.to_delete", "true"),
resource.TestCheckResourceAttr("grafana_cloud_stack.test", "labels.#", "3"),
resource.TestCheckResourceAttr("grafana_cloud_stack.test", "prometheus_remote_endpoint", "https://prometheus-prod-01-eu-west-0.grafana.net/api/prom"),
resource.TestCheckResourceAttr("grafana_cloud_stack.test", "prometheus_remote_write_endpoint", "https://prometheus-prod-01-eu-west-0.grafana.net/api/prom/push"),
resource.TestCheckResourceAttrSet("grafana_cloud_stack.test", "prometheus_user_id"),
Expand Down Expand Up @@ -103,6 +104,9 @@ func TestResourceStack_Basic(t *testing.T) {
resource.TestCheckResourceAttr("grafana_cloud_stack.test", "slug", resourceName),
resource.TestCheckResourceAttr("grafana_cloud_stack.test", "description", stackDescription),
resource.TestCheckResourceAttr("grafana_cloud_stack.test", "status", "active"),
resource.TestCheckResourceAttr("grafana_cloud_stack.test", "labels.tf", "true"),
resource.TestCheckResourceAttr("grafana_cloud_stack.test", "labels.source", "terraform-updated"),
resource.TestCheckResourceAttr("grafana_cloud_stack.test", "labels.#", "2"),
),
},
// Test import from ID
Expand Down Expand Up @@ -190,8 +194,9 @@ func testAccStackConfigBasicWithCustomResourceName(name, slug, region, resourceN
region_slug = "%s"
description = "%s"
labels = {
tf = "true"
source = "terraform"
tf = "true"
source = "terraform"
to_delete = "true"
}
}
`, resourceName, name, slug, region, description)
Expand All @@ -204,6 +209,10 @@ func testAccStackConfigUpdate(name string, slug string, description string) stri
slug = "%s"
region_slug = "eu"
description = "%s"
labels = {
tf = "true"
source = "terraform-updated"
}
}
`, name, slug, description)
}
Expand Down

0 comments on commit 298d8ee

Please sign in to comment.