Skip to content

Commit 58e1c94

Browse files
ojongeriusstack72
authored andcommitted
provider/datadog Add test for no_data_timeframe. (hashicorp#6765)
1 parent 6ec8fc8 commit 58e1c94

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

builtin/providers/datadog/resource_datadog_monitor_test.go

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func TestAccDatadogMonitor_Basic(t *testing.T) {
3030
resource.TestCheckResourceAttr(
3131
"datadog_monitor.foo", "query", "avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo} by {host} > 2"),
3232
resource.TestCheckResourceAttr(
33-
"datadog_monitor.foo", "notify_no_data", "true"),
33+
"datadog_monitor.foo", "notify_no_data", "false"),
3434
resource.TestCheckResourceAttr(
3535
"datadog_monitor.foo", "renotify_interval", "60"),
3636
resource.TestCheckResourceAttr(
@@ -70,7 +70,7 @@ func TestAccDatadogMonitor_Updated(t *testing.T) {
7070
resource.TestCheckResourceAttr(
7171
"datadog_monitor.foo", "type", "metric alert"),
7272
resource.TestCheckResourceAttr(
73-
"datadog_monitor.foo", "notify_no_data", "true"),
73+
"datadog_monitor.foo", "notify_no_data", "false"),
7474
resource.TestCheckResourceAttr(
7575
"datadog_monitor.foo", "renotify_interval", "60"),
7676
resource.TestCheckResourceAttr(
@@ -106,7 +106,9 @@ func TestAccDatadogMonitor_Updated(t *testing.T) {
106106
resource.TestCheckResourceAttr(
107107
"datadog_monitor.foo", "type", "metric alert"),
108108
resource.TestCheckResourceAttr(
109-
"datadog_monitor.foo", "notify_no_data", "false"),
109+
"datadog_monitor.foo", "notify_no_data", "true"),
110+
resource.TestCheckResourceAttr(
111+
"datadog_monitor.foo", "no_data_timeframe", "20"),
110112
resource.TestCheckResourceAttr(
111113
"datadog_monitor.foo", "renotify_interval", "40"),
112114
resource.TestCheckResourceAttr(
@@ -201,7 +203,7 @@ resource "datadog_monitor" "foo" {
201203
critical = 2
202204
}
203205
204-
notify_no_data = true
206+
notify_no_data = false
205207
renotify_interval = 60
206208
207209
notify_audit = false
@@ -227,7 +229,8 @@ resource "datadog_monitor" "foo" {
227229
critical = 3
228230
}
229231
230-
notify_no_data = false
232+
notify_no_data = true
233+
no_data_timeframe = 20
231234
renotify_interval = 40
232235
escalation_message = "the situation has escalated! @pagerduty"
233236
notify_audit = true

0 commit comments

Comments
 (0)