Skip to content

Commit

Permalink
remove duplicate value
Browse files Browse the repository at this point in the history
  • Loading branch information
zippolyte committed Apr 30, 2021
1 parent f354654 commit 4235817
Showing 1 changed file with 0 additions and 88 deletions.
88 changes: 0 additions & 88 deletions datadog/tests/resource_datadog_dashboard_query_value_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,68 +144,6 @@ resource "datadog_dashboard" "query_value_dashboard" {
}
`

const datadogDashboardQueryValueFormulaConfig = `
resource "datadog_dashboard" "query_value_dashboard" {
title = "{{uniq}}"
description = "Created using the Datadog provider in Terraform"
layout_type = "ordered"
is_read_only = "true"
widget {
query_value_definition {
request {
formula {
formula_expression = "query1 + query2"
limit {
count = 10
order = "asc"
}
}
query {
metric_query {
data_source = "metrics"
query = "avg:system.cpu.system{*} by {datacenter}"
name = "query1"
aggregator = "sum"
}
}
query {
metric_query {
data_source = "metrics"
query = "avg:system.load.1{*} by {datacenter}"
name = "query2"
aggregator = "sum"
}
}
}
}
}
widget {
query_value_definition {
request {
formula {
formula_expression = "query1"
limit {
count = 25
order = "desc"
}
}
query {
event_query {
data_source = "rum"
indexes = ["*"]
name = "query1"
compute {
aggregation = "count"
}
}
}
}
}
}
}
`

var datadogDashboardQueryValueAsserts = []string{
"widget.0.query_value_definition.0.request.0.conditional_formats.0.comparator = <",
"widget.0.query_value_definition.0.live_span = 1h",
Expand Down Expand Up @@ -269,32 +207,6 @@ var datadogDashboardQueryValueFormulaAsserts = []string{
"widget.1.query_value_definition.0.request.0.query.0.event_query.0.compute.0.aggregation = count",
}

var datadogDashboardQueryValueFormulaAsserts = []string{
"title = {{uniq}}",
"is_read_only = true",
"layout_type = ordered",
"description = Created using the Datadog provider in Terraform",
"widget.0.query_value_definition.0.request.0.formula.0.formula_expression = query1 + query2",
"widget.0.query_value_definition.0.request.0.formula.0.limit.0.count = 10",
"widget.0.query_value_definition.0.request.0.formula.0.limit.0.order = asc",
"widget.0.query_value_definition.0.request.0.query.0.metric_query.0.data_source = metrics",
"widget.0.query_value_definition.0.request.0.query.0.metric_query.0.query = avg:system.cpu.system{*} by {datacenter}",
"widget.0.query_value_definition.0.request.0.query.0.metric_query.0.name = query1",
"widget.0.query_value_definition.0.request.0.query.0.metric_query.0.aggregator = sum",
"widget.0.query_value_definition.0.request.0.query.1.metric_query.0.data_source = metrics",
"widget.0.query_value_definition.0.request.0.query.1.metric_query.0.query = avg:system.load.1{*} by {datacenter}",
"widget.0.query_value_definition.0.request.0.query.1.metric_query.0.name = query2",
"widget.0.query_value_definition.0.request.0.query.1.metric_query.0.aggregator = sum",
"widget.1.query_value_definition.0.request.0.formula.0.formula_expression = query1",
"widget.1.query_value_definition.0.request.0.formula.0.limit.0.count = 25",
"widget.1.query_value_definition.0.request.0.formula.0.limit.0.order = desc",
"widget.1.query_value_definition.0.request.0.query.0.event_query.0.data_source = rum",
"widget.1.query_value_definition.0.request.0.query.0.event_query.0.indexes.# = 1",
"widget.1.query_value_definition.0.request.0.query.0.event_query.0.indexes.0 = *",
"widget.1.query_value_definition.0.request.0.query.0.event_query.0.name = query1",
"widget.1.query_value_definition.0.request.0.query.0.event_query.0.compute.0.aggregation = count",
}

func TestAccDatadogDashboardQueryValue(t *testing.T) {
testAccDatadogDashboardWidgetUtil(t, datadogDashboardQueryValueConfig, "datadog_dashboard.query_value_dashboard", datadogDashboardQueryValueAsserts)
}
Expand Down

0 comments on commit 4235817

Please sign in to comment.