From 98e4cf5713d36b6e6fa711c171ddea21ddc69433 Mon Sep 17 00:00:00 2001 From: Dianna Barry Date: Fri, 1 Nov 2024 11:26:17 -0400 Subject: [PATCH] save updates for debugging? --- ...DatadogDomainAllowlist_CreateUpdate.freeze | 2 +- ...ccDatadogDomainAllowlist_CreateUpdate.yaml | 124 ++---------------- .../resource_datadog_domain_allowlist_test.go | 4 +- 3 files changed, 12 insertions(+), 118 deletions(-) diff --git a/datadog/tests/cassettes/TestAccDatadogDomainAllowlist_CreateUpdate.freeze b/datadog/tests/cassettes/TestAccDatadogDomainAllowlist_CreateUpdate.freeze index 96b7cb3b42..13cc1e5ed0 100644 --- a/datadog/tests/cassettes/TestAccDatadogDomainAllowlist_CreateUpdate.freeze +++ b/datadog/tests/cassettes/TestAccDatadogDomainAllowlist_CreateUpdate.freeze @@ -1 +1 @@ -2024-10-31T17:29:08.05308-04:00 \ No newline at end of file +2024-11-01T11:24:51.162193-04:00 \ No newline at end of file diff --git a/datadog/tests/cassettes/TestAccDatadogDomainAllowlist_CreateUpdate.yaml b/datadog/tests/cassettes/TestAccDatadogDomainAllowlist_CreateUpdate.yaml index 41a71941a7..19c988c842 100644 --- a/datadog/tests/cassettes/TestAccDatadogDomainAllowlist_CreateUpdate.yaml +++ b/datadog/tests/cassettes/TestAccDatadogDomainAllowlist_CreateUpdate.yaml @@ -38,7 +38,7 @@ interactions: - application/json status: 200 OK code: 200 - duration: 245.557625ms + duration: 206.149625ms - id: 1 request: proto: HTTP/1.1 @@ -67,122 +67,14 @@ interactions: content_length: -1 uncompressed: true body: | - {"data":{"type":"domain_allowlist","attributes":{"enabled":true,"domains":["@test.com","@datadoghq.com"]}}} + {"data":{"type":"domain_allowlist","attributes":{"enabled":true,"domains":[]}}} headers: Content-Type: - application/json status: 200 OK code: 200 - duration: 79.644292ms + duration: 99.865875ms - 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: 91.414084ms - - 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: 168.003416ms - - 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: 78.078875ms - - id: 5 request: proto: HTTP/1.1 proto_major: 1 @@ -213,14 +105,14 @@ interactions: content_length: -1 uncompressed: true body: | - {"data":{"type":"domain_allowlist","attributes":{"enabled":false,"domains":["@gmail.com","@datadoghq.com"]}}} + {"data":{"type":"domain_allowlist","attributes":{"enabled":true,"domains":[]}}} headers: Content-Type: - application/json status: 200 OK code: 200 - duration: 146.356292ms - - id: 6 + duration: 130.390042ms + - id: 3 request: proto: HTTP/1.1 proto_major: 1 @@ -248,10 +140,10 @@ interactions: content_length: -1 uncompressed: true body: | - {"data":{"type":"domain_allowlist","attributes":{"enabled":false,"domains":[]}}} + {"data":{"type":"domain_allowlist","attributes":{"enabled":true,"domains":[]}}} headers: Content-Type: - application/json status: 200 OK code: 200 - duration: 104.246584ms + duration: 103.107417ms diff --git a/datadog/tests/resource_datadog_domain_allowlist_test.go b/datadog/tests/resource_datadog_domain_allowlist_test.go index 980282192c..3f1521e248 100644 --- a/datadog/tests/resource_datadog_domain_allowlist_test.go +++ b/datadog/tests/resource_datadog_domain_allowlist_test.go @@ -4,6 +4,7 @@ import ( "context" "fmt" "testing" + "time" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-plugin-testing/terraform" @@ -30,7 +31,8 @@ func TestAccDatadogDomainAllowlist_CreateUpdate(t *testing.T) { ), }, { - Config: testAccCheckDatadogDomainAllowlistConfigUpdated(), + PreConfig: func() { time.Sleep(time.Second) }, + 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"),