Skip to content

Commit

Permalink
note about casette generation
Browse files Browse the repository at this point in the history
  • Loading branch information
diab42 committed Nov 6, 2024
1 parent 98e4cf5 commit 467db0f
Show file tree
Hide file tree
Showing 3 changed files with 120 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024-11-01T11:24:51.162193-04:00
2024-11-06T12:01:45.413918-05: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: 206.149625ms
duration: 179.44725ms
- id: 1
request:
proto: HTTP/1.1
Expand Down Expand Up @@ -67,14 +67,122 @@ interactions:
content_length: -1
uncompressed: true
body: |
{"data":{"type":"domain_allowlist","attributes":{"enabled":true,"domains":[]}}}
{"data":{"type":"domain_allowlist","attributes":{"enabled":true,"domains":["@test.com","@datadoghq.com"]}}}
headers:
Content-Type:
- application/json
status: 200 OK
code: 200
duration: 99.865875ms
duration: 74.813583ms
- id: 2
request:
proto: HTTP/1.1
proto_major: 1
proto_minor: 1
content_length: 0
transfer_encoding: []
trailer: {}
host: api.datadoghq.com
remote_addr: ""
request_uri: ""
body: ""
form: {}
headers:
Accept:
- application/json
url: https://api.datadoghq.com/api/v2/domain_allowlist
method: GET
response:
proto: HTTP/1.1
proto_major: 1
proto_minor: 1
transfer_encoding:
- chunked
trailer: {}
content_length: -1
uncompressed: true
body: |
{"data":{"type":"domain_allowlist","attributes":{"enabled":true,"domains":["@test.com","@datadoghq.com"]}}}
headers:
Content-Type:
- application/json
status: 200 OK
code: 200
duration: 84.83025ms
- id: 3
request:
proto: HTTP/1.1
proto_major: 1
proto_minor: 1
content_length: 110
transfer_encoding: []
trailer: {}
host: api.datadoghq.com
remote_addr: ""
request_uri: ""
body: |
{"data":{"attributes":{"domains":["@gmail.com","@datadoghq.com"],"enabled":false},"type":"domain_allowlist"}}
form: {}
headers:
Accept:
- application/json
Content-Type:
- application/json
url: https://api.datadoghq.com/api/v2/domain_allowlist
method: PATCH
response:
proto: HTTP/1.1
proto_major: 1
proto_minor: 1
transfer_encoding:
- chunked
trailer: {}
content_length: -1
uncompressed: true
body: |
{"data":{"type":"domain_allowlist","attributes":{"enabled":false,"domains":["@gmail.com","@datadoghq.com"]}}}
headers:
Content-Type:
- application/json
status: 200 OK
code: 200
duration: 149.79325ms
- id: 4
request:
proto: HTTP/1.1
proto_major: 1
proto_minor: 1
content_length: 0
transfer_encoding: []
trailer: {}
host: api.datadoghq.com
remote_addr: ""
request_uri: ""
body: ""
form: {}
headers:
Accept:
- application/json
url: https://api.datadoghq.com/api/v2/domain_allowlist
method: GET
response:
proto: HTTP/1.1
proto_major: 1
proto_minor: 1
transfer_encoding:
- chunked
trailer: {}
content_length: -1
uncompressed: true
body: |
{"data":{"type":"domain_allowlist","attributes":{"enabled":false,"domains":["@gmail.com","@datadoghq.com"]}}}
headers:
Content-Type:
- application/json
status: 200 OK
code: 200
duration: 87.818833ms
- id: 5
request:
proto: HTTP/1.1
proto_major: 1
Expand Down Expand Up @@ -105,14 +213,14 @@ interactions:
content_length: -1
uncompressed: true
body: |
{"data":{"type":"domain_allowlist","attributes":{"enabled":true,"domains":[]}}}
{"data":{"type":"domain_allowlist","attributes":{"enabled":false,"domains":[]}}}
headers:
Content-Type:
- application/json
status: 200 OK
code: 200
duration: 130.390042ms
- id: 3
duration: 146.024083ms
- id: 6
request:
proto: HTTP/1.1
proto_major: 1
Expand Down Expand Up @@ -140,10 +248,10 @@ interactions:
content_length: -1
uncompressed: true
body: |
{"data":{"type":"domain_allowlist","attributes":{"enabled":true,"domains":[]}}}
{"data":{"type":"domain_allowlist","attributes":{"enabled":false,"domains":[]}}}
headers:
Content-Type:
- application/json
status: 200 OK
code: 200
duration: 103.107417ms
duration: 86.334041ms
6 changes: 3 additions & 3 deletions datadog/tests/resource_datadog_domain_allowlist_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"fmt"
"testing"
"time"

"github.com/hashicorp/terraform-plugin-testing/helper/resource"
"github.com/hashicorp/terraform-plugin-testing/terraform"
Expand All @@ -17,6 +16,8 @@ func TestAccDatadogDomainAllowlist_CreateUpdate(t *testing.T) {

_, providers, accProviders := testAccFrameworkMuxProviders(context.Background(), t)

// When generating the casette, it may be necessary to add sleep functions before the check
// The endpoint has a zonal cache with a ttl of 2 second
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ProtoV5ProviderFactories: accProviders,
Expand All @@ -31,8 +32,7 @@ func TestAccDatadogDomainAllowlist_CreateUpdate(t *testing.T) {
),
},
{
PreConfig: func() { time.Sleep(time.Second) },
Config: testAccCheckDatadogDomainAllowlistConfigUpdated(),
Config: testAccCheckDatadogDomainAllowlistConfigUpdated(),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("datadog_domain_allowlist.foo", "domains.0", "@gmail.com"),
resource.TestCheckResourceAttr("datadog_domain_allowlist.foo", "domains.1", "@datadoghq.com"),
Expand Down

0 comments on commit 467db0f

Please sign in to comment.