Skip to content

Commit 20d49e4

Browse files
authored
[datadog_synthetics_test] Fix browser request_client_certificate (#2840)
* Fix browser request_client_certificate * fix indent * fix cassettes and test
1 parent 234f109 commit 20d49e4

File tree

106 files changed

+1699
-1679
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+1699
-1679
lines changed

datadog/resource_datadog_synthetics_test_.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2842,9 +2842,11 @@ func buildDatadogSyntheticsBrowserTest(d *schema.ResourceData) *datadogV1.Synthe
28422842
}
28432843

28442844
if attr, ok := d.GetOk("request_client_certificate"); ok {
2845-
requestClientCertificate := attr.(map[string]interface{})
2846-
clientCert, clientKey := getCertAndKeyFromMap(requestClientCertificate)
2847-
request.SetCertificate(buildDatadogRequestCertificates(clientCert["content"].(string), clientCert["filename"].(string), clientKey["content"].(string), clientKey["filename"].(string)))
2845+
if requestClientCertificates, ok := attr.([]interface{}); ok && len(requestClientCertificates) > 0 {
2846+
requestClientCertificate := requestClientCertificates[0].(map[string]interface{})
2847+
clientCert, clientKey := getCertAndKeyFromMap(requestClientCertificate)
2848+
request.SetCertificate(buildDatadogRequestCertificates(clientCert["content"].(string), clientCert["filename"].(string), clientKey["content"].(string), clientKey["filename"].(string)))
2849+
}
28482850
}
28492851

28502852
if attr, ok := d.GetOk("request_proxy"); ok {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2025-01-23T13:49:36.79629+01:00
1+
2025-02-18T10:48:27.904765+01:00

datadog/tests/cassettes/TestAccDatadogSyntheticsAPITest_AdvancedScheduling.yaml

Lines changed: 20 additions & 20 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2025-02-17T10:58:00.33525+01:00
1+
2025-02-18T10:48:27.904342+01:00

datadog/tests/cassettes/TestAccDatadogSyntheticsAPITest_Basic.yaml

Lines changed: 34 additions & 34 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2025-02-17T10:58:00.335259+01:00
1+
2025-02-18T10:48:27.913261+01:00

datadog/tests/cassettes/TestAccDatadogSyntheticsAPITest_BasicNewAssertionsOptions.yaml

Lines changed: 34 additions & 34 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2025-02-17T10:57:41.321409+01:00
1+
2025-02-18T10:48:27.919398+01:00

datadog/tests/cassettes/TestAccDatadogSyntheticsAPITest_Updated.yaml

Lines changed: 59 additions & 59 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2025-02-17T10:57:41.321405+01:00
1+
2025-02-18T10:48:27.882062+01:00

datadog/tests/cassettes/TestAccDatadogSyntheticsAPITest_UpdatedNewAssertionsOptions.yaml

Lines changed: 59 additions & 59 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2025-02-17T10:56:23.57307+01:00
1+
2025-02-18T10:48:45.363578+01:00

datadog/tests/cassettes/TestAccDatadogSyntheticsAPITest_importBasic.yaml

Lines changed: 37 additions & 37 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2025-01-23T13:49:30.266354+01:00
1+
2025-02-18T10:49:15.639632+01:00

datadog/tests/cassettes/TestAccDatadogSyntheticsApiTest_FileUpload.yaml

Lines changed: 54 additions & 54 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2025-02-11T17:32:54.776336+01:00
1+
2025-02-18T10:48:56.567242+01:00

datadog/tests/cassettes/TestAccDatadogSyntheticsBrowserTestBrowserNewBrowserStep_Basic.yaml

Lines changed: 40 additions & 40 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2025-01-23T13:49:49.104047+01:00
1+
2025-02-18T10:48:58.963229+01:00

datadog/tests/cassettes/TestAccDatadogSyntheticsBrowserTestBrowserVariables_Basic.yaml

Lines changed: 20 additions & 20 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2025-02-11T10:21:05.923213+01:00
1+
2025-02-18T10:48:49.477264+01:00

datadog/tests/cassettes/TestAccDatadogSyntheticsBrowserTest_Basic.yaml

Lines changed: 21 additions & 21 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2025-02-11T10:21:45.40912+01:00
1+
2025-02-18T10:48:27.908287+01:00

datadog/tests/cassettes/TestAccDatadogSyntheticsBrowserTest_Updated.yaml

Lines changed: 40 additions & 40 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2025-02-11T10:22:07.217786+01:00
1+
2025-02-18T10:48:54.371506+01:00

datadog/tests/cassettes/TestAccDatadogSyntheticsBrowserTest_Updated_RumSettings.yaml

Lines changed: 59 additions & 59 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2025-02-11T10:22:29.817657+01:00
1+
2025-02-18T10:48:38.478102+01:00

datadog/tests/cassettes/TestAccDatadogSyntheticsBrowserTest_importBasic.yaml

Lines changed: 24 additions & 24 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2025-01-23T13:49:30.256988+01:00
1+
2025-02-18T10:48:27.901906+01:00

datadog/tests/cassettes/TestAccDatadogSyntheticsBrowser_UpdateStepsWithLocalML.yaml

Lines changed: 39 additions & 39 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2025-01-23T13:49:30.24392+01:00
1+
2025-02-18T10:48:27.890538+01:00

datadog/tests/cassettes/TestAccDatadogSyntheticsBrowser_UpdateStepsWithRemoteML.yaml

Lines changed: 61 additions & 61 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2025-01-23T13:49:54.360719+01:00
1+
2025-02-18T10:49:11.689709+01:00

datadog/tests/cassettes/TestAccDatadogSyntheticsConcurrencyCap.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ interactions:
3838
- application/json
3939
status: 200 OK
4040
code: 200
41-
duration: 209.5535ms
41+
duration: 160.127375ms
4242
- id: 1
4343
request:
4444
proto: HTTP/1.1
@@ -73,4 +73,4 @@ interactions:
7373
- application/json
7474
status: 200 OK
7575
code: 200
76-
duration: 141.337208ms
76+
duration: 133.981625ms
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2025-01-23T13:50:02.985436+01:00
1+
2025-02-18T10:48:49.009975+01:00

datadog/tests/cassettes/TestAccDatadogSyntheticsDNSTest_Basic.yaml

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ interactions:
1313
remote_addr: ""
1414
request_uri: ""
1515
body: |
16-
{"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-1737636602","options":{"httpVersion":"any","min_location_failed":1,"tick_every":60},"status":"paused","subtype":"dns","tags":["foo:bar","baz"],"type":"api"}
16+
{"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-1739872129","options":{"httpVersion":"any","min_location_failed":1,"tick_every":60},"status":"paused","subtype":"dns","tags":["foo:bar","baz"],"type":"api"}
1717
form: {}
1818
headers:
1919
Accept:
@@ -32,13 +32,13 @@ interactions:
3232
content_length: -1
3333
uncompressed: true
3434
body: |
35-
{"public_id":"ncg-4dv-pnm","name":"tf-TestAccDatadogSyntheticsDNSTest_Basic-local-1737636602","status":"paused","type":"api","subtype":"dns","tags":["foo:bar","baz"],"created_at":"2025-01-23T12:50:04.588761+00:00","modified_at":"2025-01-23T12:50:04.588761+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":"frog","handle":"[email protected]","email":"[email protected]"},"deleted_at":null,"monitor_id":163275987,"org_id":321813,"modified_by":{"name":"frog","handle":"[email protected]","email":"[email protected]"}}
35+
{"public_id":"s4y-6hm-baf","name":"tf-TestAccDatadogSyntheticsDNSTest_Basic-local-1739872129","status":"paused","type":"api","subtype":"dns","tags":["foo:bar","baz"],"created_at":"2025-02-18T09:48:52.372947+00:00","modified_at":"2025-02-18T09:48:52.372947+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":"frog","handle":"[email protected]","email":"[email protected]"},"deleted_at":null,"monitor_id":164880854,"org_id":321813,"modified_by":{"name":"frog","handle":"[email protected]","email":"[email protected]"}}
3636
headers:
3737
Content-Type:
3838
- application/json
3939
status: 200 OK
4040
code: 200
41-
duration: 422.855917ms
41+
duration: 1.827471292s
4242
- id: 1
4343
request:
4444
proto: HTTP/1.1
@@ -55,7 +55,7 @@ interactions:
5555
headers:
5656
Accept:
5757
- application/json
58-
url: https://api.datadoghq.com/api/v1/synthetics/tests/api/ncg-4dv-pnm
58+
url: https://api.datadoghq.com/api/v1/synthetics/tests/api/s4y-6hm-baf
5959
method: GET
6060
response:
6161
proto: HTTP/1.1
@@ -67,13 +67,13 @@ interactions:
6767
content_length: -1
6868
uncompressed: true
6969
body: |
70-
{"public_id":"ncg-4dv-pnm","name":"tf-TestAccDatadogSyntheticsDNSTest_Basic-local-1737636602","status":"paused","type":"api","subtype":"dns","tags":["foo:bar","baz"],"created_at":"2025-01-23T12:50:04.588761+00:00","modified_at":"2025-01-23T12:50:04.588761+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":163275987,"creator":{"name":"frog","handle":"[email protected]","email":"[email protected]"}}
70+
{"public_id":"s4y-6hm-baf","name":"tf-TestAccDatadogSyntheticsDNSTest_Basic-local-1739872129","status":"paused","type":"api","subtype":"dns","tags":["foo:bar","baz"],"created_at":"2025-02-18T09:48:52.372947+00:00","modified_at":"2025-02-18T09:48:52.372947+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":164880854,"creator":{"name":"frog","handle":"[email protected]","email":"[email protected]"}}
7171
headers:
7272
Content-Type:
7373
- application/json
7474
status: 200 OK
7575
code: 200
76-
duration: 183.917625ms
76+
duration: 211.853709ms
7777
- id: 2
7878
request:
7979
proto: HTTP/1.1
@@ -90,7 +90,7 @@ interactions:
9090
headers:
9191
Accept:
9292
- application/json
93-
url: https://api.datadoghq.com/api/v1/synthetics/tests/ncg-4dv-pnm
93+
url: https://api.datadoghq.com/api/v1/synthetics/tests/s4y-6hm-baf
9494
method: GET
9595
response:
9696
proto: HTTP/1.1
@@ -102,13 +102,13 @@ interactions:
102102
content_length: -1
103103
uncompressed: true
104104
body: |
105-
{"public_id":"ncg-4dv-pnm","name":"tf-TestAccDatadogSyntheticsDNSTest_Basic-local-1737636602","status":"paused","type":"api","subtype":"dns","tags":["foo:bar","baz"],"created_at":"2025-01-23T12:50:04.588761+00:00","modified_at":"2025-01-23T12:50:04.588761+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":163275987,"creator":{"name":"frog","handle":"[email protected]","email":"[email protected]"}}
105+
{"public_id":"s4y-6hm-baf","name":"tf-TestAccDatadogSyntheticsDNSTest_Basic-local-1739872129","status":"paused","type":"api","subtype":"dns","tags":["foo:bar","baz"],"created_at":"2025-02-18T09:48:52.372947+00:00","modified_at":"2025-02-18T09:48:52.372947+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":164880854,"creator":{"name":"frog","handle":"[email protected]","email":"[email protected]"}}
106106
headers:
107107
Content-Type:
108108
- application/json
109109
status: 200 OK
110110
code: 200
111-
duration: 148.999084ms
111+
duration: 179.275125ms
112112
- id: 3
113113
request:
114114
proto: HTTP/1.1
@@ -125,7 +125,7 @@ interactions:
125125
headers:
126126
Accept:
127127
- application/json
128-
url: https://api.datadoghq.com/api/v1/synthetics/tests/ncg-4dv-pnm
128+
url: https://api.datadoghq.com/api/v1/synthetics/tests/s4y-6hm-baf
129129
method: GET
130130
response:
131131
proto: HTTP/1.1
@@ -137,13 +137,13 @@ interactions:
137137
content_length: -1
138138
uncompressed: true
139139
body: |
140-
{"public_id":"ncg-4dv-pnm","name":"tf-TestAccDatadogSyntheticsDNSTest_Basic-local-1737636602","status":"paused","type":"api","subtype":"dns","tags":["foo:bar","baz"],"created_at":"2025-01-23T12:50:04.588761+00:00","modified_at":"2025-01-23T12:50:04.588761+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":163275987,"creator":{"name":"frog","handle":"[email protected]","email":"[email protected]"}}
140+
{"public_id":"s4y-6hm-baf","name":"tf-TestAccDatadogSyntheticsDNSTest_Basic-local-1739872129","status":"paused","type":"api","subtype":"dns","tags":["foo:bar","baz"],"created_at":"2025-02-18T09:48:52.372947+00:00","modified_at":"2025-02-18T09:48:52.372947+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":164880854,"creator":{"name":"frog","handle":"[email protected]","email":"[email protected]"}}
141141
headers:
142142
Content-Type:
143143
- application/json
144144
status: 200 OK
145145
code: 200
146-
duration: 220.500834ms
146+
duration: 462.735458ms
147147
- id: 4
148148
request:
149149
proto: HTTP/1.1
@@ -160,7 +160,7 @@ interactions:
160160
headers:
161161
Accept:
162162
- application/json
163-
url: https://api.datadoghq.com/api/v1/synthetics/tests/api/ncg-4dv-pnm
163+
url: https://api.datadoghq.com/api/v1/synthetics/tests/api/s4y-6hm-baf
164164
method: GET
165165
response:
166166
proto: HTTP/1.1
@@ -172,13 +172,13 @@ interactions:
172172
content_length: -1
173173
uncompressed: true
174174
body: |
175-
{"public_id":"ncg-4dv-pnm","name":"tf-TestAccDatadogSyntheticsDNSTest_Basic-local-1737636602","status":"paused","type":"api","subtype":"dns","tags":["foo:bar","baz"],"created_at":"2025-01-23T12:50:04.588761+00:00","modified_at":"2025-01-23T12:50:04.588761+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":163275987,"creator":{"name":"frog","handle":"[email protected]","email":"[email protected]"}}
175+
{"public_id":"s4y-6hm-baf","name":"tf-TestAccDatadogSyntheticsDNSTest_Basic-local-1739872129","status":"paused","type":"api","subtype":"dns","tags":["foo:bar","baz"],"created_at":"2025-02-18T09:48:52.372947+00:00","modified_at":"2025-02-18T09:48:52.372947+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":164880854,"creator":{"name":"frog","handle":"[email protected]","email":"[email protected]"}}
176176
headers:
177177
Content-Type:
178178
- application/json
179179
status: 200 OK
180180
code: 200
181-
duration: 260.21625ms
181+
duration: 220.773625ms
182182
- id: 5
183183
request:
184184
proto: HTTP/1.1
@@ -191,7 +191,7 @@ interactions:
191191
remote_addr: ""
192192
request_uri: ""
193193
body: |
194-
{"public_ids":["ncg-4dv-pnm"]}
194+
{"public_ids":["s4y-6hm-baf"]}
195195
form: {}
196196
headers:
197197
Accept:
@@ -210,13 +210,13 @@ interactions:
210210
content_length: -1
211211
uncompressed: true
212212
body: |
213-
{"deleted_tests":[{"public_id":"ncg-4dv-pnm","deleted_at":"2025-01-23T12:50:07.940374+00:00"}]}
213+
{"deleted_tests":[{"public_id":"s4y-6hm-baf","deleted_at":"2025-02-18T09:48:58.328778+00:00"}]}
214214
headers:
215215
Content-Type:
216216
- application/json
217217
status: 200 OK
218218
code: 200
219-
duration: 774.568208ms
219+
duration: 1.036219792s
220220
- id: 6
221221
request:
222222
proto: HTTP/1.1
@@ -233,7 +233,7 @@ interactions:
233233
headers:
234234
Accept:
235235
- application/json
236-
url: https://api.datadoghq.com/api/v1/synthetics/tests/ncg-4dv-pnm
236+
url: https://api.datadoghq.com/api/v1/synthetics/tests/s4y-6hm-baf
237237
method: GET
238238
response:
239239
proto: HTTP/1.1
@@ -250,4 +250,4 @@ interactions:
250250
- application/json
251251
status: 404 Not Found
252252
code: 404
253-
duration: 127.202209ms
253+
duration: 354.995542ms
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2025-01-23T13:49:57.07342+01:00
1+
2025-02-18T10:48:54.360614+01:00

0 commit comments

Comments
 (0)