Skip to content

Commit b669e02

Browse files
Add namespacing on metric descriptor so tests can run in parallel (#3771) (#2293)
* Add namespacing on metric descriptor so tests can run in parallel * Add random generation to type Signed-off-by: Modular Magician <[email protected]>
1 parent 3b05642 commit b669e02

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

.changelog/3771.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:none
2+
3+
```

google-beta/resource_monitoring_metric_descriptor_generated_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ func testAccMonitoringMetricDescriptor_monitoringMetricDescriptorBasicExample(co
5252
return Nprintf(`
5353
resource "google_monitoring_metric_descriptor" "basic" {
5454
description = "Daily sales records from all branch stores."
55-
display_name = "Daily sales"
56-
type = "custom.googleapis.com/stores/daily_sales"
55+
display_name = "tf-test-metric-descriptor%{random_suffix}"
56+
type = "custom.googleapis.com/stores/tf_test_daily_sales%{random_suffix}"
5757
metric_kind = "GAUGE"
5858
value_type = "DOUBLE"
5959
unit = "{USD}"
@@ -100,15 +100,15 @@ func testAccMonitoringMetricDescriptor_monitoringMetricDescriptorAlertExample(co
100100
return Nprintf(`
101101
resource "google_monitoring_metric_descriptor" "with_alert" {
102102
description = "Daily sales records from all branch stores."
103-
display_name = "Daily sales"
104-
type = "custom.googleapis.com/stores/daily_sales"
103+
display_name = "tf-test-metric-descriptor%{random_suffix}"
104+
type = "custom.googleapis.com/stores/tf_test_daily_sales%{random_suffix}"
105105
metric_kind = "GAUGE"
106106
value_type = "DOUBLE"
107107
unit = "{USD}"
108108
}
109109
110110
resource "google_monitoring_alert_policy" "alert_policy" {
111-
display_name = "Alert on daily sales"
111+
display_name = "tf-test-metric-descriptor%{random_suffix}"
112112
combiner = "OR"
113113
conditions {
114114
display_name = "test condition"

website/docs/r/monitoring_metric_descriptor.html.markdown

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ To get more information about MetricDescriptor, see:
4242
```hcl
4343
resource "google_monitoring_metric_descriptor" "basic" {
4444
description = "Daily sales records from all branch stores."
45-
display_name = "Daily sales"
45+
display_name = "metric-descriptor"
4646
type = "custom.googleapis.com/stores/daily_sales"
4747
metric_kind = "GAUGE"
4848
value_type = "DOUBLE"
@@ -70,15 +70,15 @@ resource "google_monitoring_metric_descriptor" "basic" {
7070
```hcl
7171
resource "google_monitoring_metric_descriptor" "with_alert" {
7272
description = "Daily sales records from all branch stores."
73-
display_name = "Daily sales"
73+
display_name = "metric-descriptor"
7474
type = "custom.googleapis.com/stores/daily_sales"
7575
metric_kind = "GAUGE"
7676
value_type = "DOUBLE"
7777
unit = "{USD}"
7878
}
7979
8080
resource "google_monitoring_alert_policy" "alert_policy" {
81-
display_name = "Alert on daily sales"
81+
display_name = "metric-descriptor"
8282
combiner = "OR"
8383
conditions {
8484
display_name = "test condition"

0 commit comments

Comments
 (0)