Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[datadog_synthetics_test] Add always_execute and exit_if_succeed to browser steps #2647

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion datadog/resource_datadog_synthetics_test_.go
Original file line number Diff line number Diff line change
Expand Up @@ -1002,6 +1002,16 @@ func syntheticsTestBrowserStep() *schema.Schema {
Type: schema.TypeBool,
Optional: true,
},
"always_execute": {
Description: "Determines whether or not to always execute this step even if the previous step failed or was skipped.",
Type: schema.TypeBool,
Optional: true,
},
"exit_if_succeed": {
Description: "Determines whether or not to exit the test if the step succeeds.",
Type: schema.TypeBool,
Optional: true,
},
"is_critical": {
Description: "Determines whether or not to consider the entire test as failed if this step fails. Can be used only if `allow_failure` is `true`.",
Type: schema.TypeBool,
Expand Down Expand Up @@ -1643,7 +1653,12 @@ func updateSyntheticsBrowserTestLocalState(d *schema.ResourceData, syntheticsTes
if allowFailure, ok := step.GetAllowFailureOk(); ok {
localStep["allow_failure"] = allowFailure
}

if alwaysExecute, ok := step.GetAlwaysExecuteOk(); ok {
localStep["always_execute"] = alwaysExecute
}
if exitIfSucceed, ok := step.GetExitIfSucceedOk(); ok {
localStep["exit_if_succeed"] = exitIfSucceed
}
if isCritical, ok := step.GetIsCriticalOk(); ok {
localStep["is_critical"] = isCritical
}
Expand Down Expand Up @@ -2312,6 +2327,8 @@ func buildDatadogSyntheticsBrowserTest(d *schema.ResourceData) *datadogV1.Synthe
step.SetName(stepMap["name"].(string))
step.SetType(datadogV1.SyntheticsStepType(stepMap["type"].(string)))
step.SetAllowFailure(stepMap["allow_failure"].(bool))
step.SetAlwaysExecute(stepMap["always_execute"].(bool))
step.SetExitIfSucceed(stepMap["exit_if_succeed"].(bool))
step.SetIsCritical(stepMap["is_critical"].(bool))
step.SetTimeout(int64(stepMap["timeout"].(int)))
step.SetNoScreenshot(stepMap["no_screenshot"].(bool))
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024-08-22T20:28:50.145606+02:00
2024-11-14T11:32:22.134944+01:00

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024-09-11T16:27:48.498745+02:00
2024-11-14T11:32:22.134078+01:00

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024-09-11T16:27:48.498854+02:00
2024-11-14T11:32:22.131511+01:00

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024-09-11T16:26:32.901369+02:00
2024-11-14T11:32:22.146624+01:00
118 changes: 59 additions & 59 deletions datadog/tests/cassettes/TestAccDatadogSyntheticsAPITest_Updated.yaml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024-09-11T16:26:32.902496+02:00
2024-11-14T11:32:22.131118+01:00

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024-09-11T16:29:08.367667+02:00
2024-11-14T11:32:42.387072+01:00

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024-08-22T20:29:18.433038+02:00
2024-11-14T11:32:58.107231+01:00

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024-08-22T20:29:01.39516+02:00
2024-11-14T11:33:04.395419+01:00

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024-08-22T20:29:02.244404+02:00
2024-11-14T11:33:01.86296+01:00

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024-08-22T20:29:06.496898+02:00
2024-11-14T11:33:02.793393+01:00

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024-08-22T20:29:03.593638+02:00
2024-11-14T11:33:05.005026+01:00

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024-08-22T20:29:03.045805+02:00
2024-11-14T11:32:59.395264+01:00

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024-08-22T20:29:15.536139+02:00
2024-11-14T11:32:33.335902+01:00

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024-08-22T20:28:50.15202+02:00
2024-11-14T11:32:45.84959+01:00

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024-08-22T20:29:20.597814+02:00
2024-11-14T11:32:34.34387+01:00
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ interactions:
- application/json
status: 200 OK
code: 200
duration: 225.606458ms
duration: 189.784541ms
- id: 1
request:
proto: HTTP/1.1
Expand Down Expand Up @@ -73,4 +73,4 @@ interactions:
- application/json
status: 200 OK
code: 200
duration: 145.100167ms
duration: 125.100084ms
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024-08-22T20:29:07.616982+02:00
2024-11-14T11:32:51.840448+01:00
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ interactions:
remote_addr: ""
request_uri: ""
body: |
{"config":{"assertions":[{"operator":"is","property":"A","target":"0.0.0.0","type":"recordSome"}],"configVariables":[],"request":{"dnsServer":"8.8.8.8","dnsServerPort":"120","host":"https://www.datadoghq.com"}},"locations":["aws:eu-central-1"],"message":"Notify @datadog.user","name":"tf-TestAccDatadogSyntheticsDNSTest_Basic-local-1724351347","options":{"httpVersion":"any","min_location_failed":1,"tick_every":60},"status":"paused","subtype":"dns","tags":["foo:bar","baz"],"type":"api"}
{"config":{"assertions":[{"operator":"is","property":"A","target":"0.0.0.0","type":"recordSome"}],"configVariables":[],"request":{"dnsServer":"8.8.8.8","dnsServerPort":"120","host":"https://www.datadoghq.com"}},"locations":["aws:eu-central-1"],"message":"Notify @datadog.user","name":"tf-TestAccDatadogSyntheticsDNSTest_Basic-local-1731580371","options":{"httpVersion":"any","min_location_failed":1,"tick_every":60},"status":"paused","subtype":"dns","tags":["foo:bar","baz"],"type":"api"}
form: {}
headers:
Accept:
Expand All @@ -32,13 +32,13 @@ interactions:
content_length: -1
uncompressed: true
body: |
{"public_id":"2fe-b3b-rpg","name":"tf-TestAccDatadogSyntheticsDNSTest_Basic-local-1724351347","status":"paused","type":"api","tags":["foo:bar","baz"],"created_at":"2024-08-22T18:29:09.532165+00:00","modified_at":"2024-08-22T18:29:09.532165+00:00","config":{"assertions":[{"operator":"is","property":"A","target":"0.0.0.0","type":"recordSome"}],"configVariables":[],"request":{"dnsServer":"8.8.8.8","dnsServerPort":"120","host":"https://www.datadoghq.com"}},"message":"Notify @datadog.user","options":{"httpVersion":"any","min_location_failed":1,"tick_every":60},"locations":["aws:eu-central-1"],"subtype":"dns","created_by":{"name":null,"handle":"[email protected]","email":"[email protected]"},"deleted_at":null,"monitor_id":152019604,"org_id":321813,"modified_by":{"name":null,"handle":"[email protected]","email":"[email protected]"}}
{"public_id":"83i-3hz-jmv","name":"tf-TestAccDatadogSyntheticsDNSTest_Basic-local-1731580371","status":"paused","type":"api","subtype":"dns","tags":["foo:bar","baz"],"created_at":"2024-11-14T10:32:54.447560+00:00","modified_at":"2024-11-14T10:32:54.447560+00:00","config":{"assertions":[{"operator":"is","property":"A","target":"0.0.0.0","type":"recordSome"}],"configVariables":[],"request":{"dnsServer":"8.8.8.8","dnsServerPort":"120","host":"https://www.datadoghq.com"}},"message":"Notify @datadog.user","options":{"httpVersion":"any","min_location_failed":1,"tick_every":60},"locations":["aws:eu-central-1"],"created_by":{"name":null,"handle":"[email protected]","email":"[email protected]"},"deleted_at":null,"monitor_id":158216141,"org_id":321813,"modified_by":{"name":null,"handle":"[email protected]","email":"[email protected]"}}
headers:
Content-Type:
- application/json
status: 200 OK
code: 200
duration: 667.511125ms
duration: 412.748208ms
- id: 1
request:
proto: HTTP/1.1
Expand All @@ -55,7 +55,7 @@ interactions:
headers:
Accept:
- application/json
url: https://api.datadoghq.com/api/v1/synthetics/tests/api/2fe-b3b-rpg
url: https://api.datadoghq.com/api/v1/synthetics/tests/api/83i-3hz-jmv
method: GET
response:
proto: HTTP/1.1
Expand All @@ -67,13 +67,13 @@ interactions:
content_length: -1
uncompressed: true
body: |
{"public_id":"2fe-b3b-rpg","name":"tf-TestAccDatadogSyntheticsDNSTest_Basic-local-1724351347","status":"paused","type":"api","tags":["foo:bar","baz"],"created_at":"2024-08-22T18:29:09.532165+00:00","modified_at":"2024-08-22T18:29:09.532165+00:00","config":{"assertions":[{"operator":"is","property":"A","target":"0.0.0.0","type":"recordSome"}],"configVariables":[],"request":{"dnsServer":"8.8.8.8","dnsServerPort":"120","host":"https://www.datadoghq.com"}},"message":"Notify @datadog.user","options":{"httpVersion":"any","min_location_failed":1,"tick_every":60},"locations":["aws:eu-central-1"],"subtype":"dns","monitor_id":152019604,"creator":{"name":null,"handle":"[email protected]","email":"[email protected]"}}
{"public_id":"83i-3hz-jmv","name":"tf-TestAccDatadogSyntheticsDNSTest_Basic-local-1731580371","status":"paused","type":"api","subtype":"dns","tags":["foo:bar","baz"],"created_at":"2024-11-14T10:32:54.447560+00:00","modified_at":"2024-11-14T10:32:54.447560+00:00","config":{"assertions":[{"operator":"is","property":"A","target":"0.0.0.0","type":"recordSome"}],"configVariables":[],"request":{"dnsServer":"8.8.8.8","dnsServerPort":"120","host":"https://www.datadoghq.com"}},"message":"Notify @datadog.user","options":{"httpVersion":"any","min_location_failed":1,"tick_every":60},"locations":["aws:eu-central-1"],"monitor_id":158216141,"creator":{"name":null,"handle":"[email protected]","email":"[email protected]"}}
headers:
Content-Type:
- application/json
status: 200 OK
code: 200
duration: 136.959458ms
duration: 267.36475ms
- id: 2
request:
proto: HTTP/1.1
Expand All @@ -90,7 +90,7 @@ interactions:
headers:
Accept:
- application/json
url: https://api.datadoghq.com/api/v1/synthetics/tests/2fe-b3b-rpg
url: https://api.datadoghq.com/api/v1/synthetics/tests/83i-3hz-jmv
method: GET
response:
proto: HTTP/1.1
Expand All @@ -102,13 +102,13 @@ interactions:
content_length: -1
uncompressed: true
body: |
{"public_id":"2fe-b3b-rpg","name":"tf-TestAccDatadogSyntheticsDNSTest_Basic-local-1724351347","status":"paused","type":"api","tags":["foo:bar","baz"],"created_at":"2024-08-22T18:29:09.532165+00:00","modified_at":"2024-08-22T18:29:09.532165+00:00","config":{"assertions":[{"operator":"is","property":"A","target":"0.0.0.0","type":"recordSome"}],"configVariables":[],"request":{"dnsServer":"8.8.8.8","dnsServerPort":"120","host":"https://www.datadoghq.com"}},"message":"Notify @datadog.user","options":{"httpVersion":"any","min_location_failed":1,"tick_every":60},"locations":["aws:eu-central-1"],"subtype":"dns","monitor_id":152019604,"creator":{"name":null,"handle":"[email protected]","email":"[email protected]"}}
{"public_id":"83i-3hz-jmv","name":"tf-TestAccDatadogSyntheticsDNSTest_Basic-local-1731580371","status":"paused","type":"api","subtype":"dns","tags":["foo:bar","baz"],"created_at":"2024-11-14T10:32:54.447560+00:00","modified_at":"2024-11-14T10:32:54.447560+00:00","config":{"assertions":[{"operator":"is","property":"A","target":"0.0.0.0","type":"recordSome"}],"configVariables":[],"request":{"dnsServer":"8.8.8.8","dnsServerPort":"120","host":"https://www.datadoghq.com"}},"message":"Notify @datadog.user","options":{"httpVersion":"any","min_location_failed":1,"tick_every":60},"locations":["aws:eu-central-1"],"monitor_id":158216141,"creator":{"name":null,"handle":"[email protected]","email":"[email protected]"}}
headers:
Content-Type:
- application/json
status: 200 OK
code: 200
duration: 157.261042ms
duration: 173.377084ms
- id: 3
request:
proto: HTTP/1.1
Expand All @@ -125,7 +125,7 @@ interactions:
headers:
Accept:
- application/json
url: https://api.datadoghq.com/api/v1/synthetics/tests/2fe-b3b-rpg
url: https://api.datadoghq.com/api/v1/synthetics/tests/83i-3hz-jmv
method: GET
response:
proto: HTTP/1.1
Expand All @@ -137,13 +137,13 @@ interactions:
content_length: -1
uncompressed: true
body: |
{"public_id":"2fe-b3b-rpg","name":"tf-TestAccDatadogSyntheticsDNSTest_Basic-local-1724351347","status":"paused","type":"api","tags":["foo:bar","baz"],"created_at":"2024-08-22T18:29:09.532165+00:00","modified_at":"2024-08-22T18:29:09.532165+00:00","config":{"assertions":[{"operator":"is","property":"A","target":"0.0.0.0","type":"recordSome"}],"configVariables":[],"request":{"dnsServer":"8.8.8.8","dnsServerPort":"120","host":"https://www.datadoghq.com"}},"message":"Notify @datadog.user","options":{"httpVersion":"any","min_location_failed":1,"tick_every":60},"locations":["aws:eu-central-1"],"subtype":"dns","monitor_id":152019604,"creator":{"name":null,"handle":"[email protected]","email":"[email protected]"}}
{"public_id":"83i-3hz-jmv","name":"tf-TestAccDatadogSyntheticsDNSTest_Basic-local-1731580371","status":"paused","type":"api","subtype":"dns","tags":["foo:bar","baz"],"created_at":"2024-11-14T10:32:54.447560+00:00","modified_at":"2024-11-14T10:32:54.447560+00:00","config":{"assertions":[{"operator":"is","property":"A","target":"0.0.0.0","type":"recordSome"}],"configVariables":[],"request":{"dnsServer":"8.8.8.8","dnsServerPort":"120","host":"https://www.datadoghq.com"}},"message":"Notify @datadog.user","options":{"httpVersion":"any","min_location_failed":1,"tick_every":60},"locations":["aws:eu-central-1"],"monitor_id":158216141,"creator":{"name":null,"handle":"[email protected]","email":"[email protected]"}}
headers:
Content-Type:
- application/json
status: 200 OK
code: 200
duration: 145.285083ms
duration: 296.76925ms
- id: 4
request:
proto: HTTP/1.1
Expand All @@ -160,7 +160,7 @@ interactions:
headers:
Accept:
- application/json
url: https://api.datadoghq.com/api/v1/synthetics/tests/api/2fe-b3b-rpg
url: https://api.datadoghq.com/api/v1/synthetics/tests/api/83i-3hz-jmv
method: GET
response:
proto: HTTP/1.1
Expand All @@ -172,13 +172,13 @@ interactions:
content_length: -1
uncompressed: true
body: |
{"public_id":"2fe-b3b-rpg","name":"tf-TestAccDatadogSyntheticsDNSTest_Basic-local-1724351347","status":"paused","type":"api","tags":["foo:bar","baz"],"created_at":"2024-08-22T18:29:09.532165+00:00","modified_at":"2024-08-22T18:29:09.532165+00:00","config":{"assertions":[{"operator":"is","property":"A","target":"0.0.0.0","type":"recordSome"}],"configVariables":[],"request":{"dnsServer":"8.8.8.8","dnsServerPort":"120","host":"https://www.datadoghq.com"}},"message":"Notify @datadog.user","options":{"httpVersion":"any","min_location_failed":1,"tick_every":60},"locations":["aws:eu-central-1"],"subtype":"dns","monitor_id":152019604,"creator":{"name":null,"handle":"[email protected]","email":"[email protected]"}}
{"public_id":"83i-3hz-jmv","name":"tf-TestAccDatadogSyntheticsDNSTest_Basic-local-1731580371","status":"paused","type":"api","subtype":"dns","tags":["foo:bar","baz"],"created_at":"2024-11-14T10:32:54.447560+00:00","modified_at":"2024-11-14T10:32:54.447560+00:00","config":{"assertions":[{"operator":"is","property":"A","target":"0.0.0.0","type":"recordSome"}],"configVariables":[],"request":{"dnsServer":"8.8.8.8","dnsServerPort":"120","host":"https://www.datadoghq.com"}},"message":"Notify @datadog.user","options":{"httpVersion":"any","min_location_failed":1,"tick_every":60},"locations":["aws:eu-central-1"],"monitor_id":158216141,"creator":{"name":null,"handle":"[email protected]","email":"[email protected]"}}
headers:
Content-Type:
- application/json
status: 200 OK
code: 200
duration: 143.547625ms
duration: 289.606333ms
- id: 5
request:
proto: HTTP/1.1
Expand All @@ -191,7 +191,7 @@ interactions:
remote_addr: ""
request_uri: ""
body: |
{"public_ids":["2fe-b3b-rpg"]}
{"public_ids":["83i-3hz-jmv"]}
form: {}
headers:
Accept:
Expand All @@ -210,13 +210,13 @@ interactions:
content_length: -1
uncompressed: true
body: |
{"deleted_tests":[{"public_id":"2fe-b3b-rpg","deleted_at":"2024-08-22T18:29:12.815840+00:00"}]}
{"deleted_tests":[{"public_id":"83i-3hz-jmv","deleted_at":"2024-11-14T10:32:59.052025+00:00"}]}
headers:
Content-Type:
- application/json
status: 200 OK
code: 200
duration: 708.96025ms
duration: 656.679916ms
- id: 6
request:
proto: HTTP/1.1
Expand All @@ -233,7 +233,7 @@ interactions:
headers:
Accept:
- application/json
url: https://api.datadoghq.com/api/v1/synthetics/tests/2fe-b3b-rpg
url: https://api.datadoghq.com/api/v1/synthetics/tests/83i-3hz-jmv
method: GET
response:
proto: HTTP/1.1
Expand All @@ -250,4 +250,4 @@ interactions:
- application/json
status: 404 Not Found
code: 404
duration: 213.11975ms
duration: 137.241667ms
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024-08-22T20:29:04.894311+02:00
2024-11-14T11:32:51.092012+01:00
Loading
Loading