From ed67079bfbb7f7e4fd88c305122d50aa7c315488 Mon Sep 17 00:00:00 2001 From: skarimo <40482491+skarimo@users.noreply.github.com> Date: Fri, 24 May 2024 08:55:27 -0400 Subject: [PATCH] Remove 404 tests from metric metadata (#2506) * remove 404 tests for metric metadata * update tests --- tests/api/datadogV1/api_metrics_test.go | 2 - .../403_Forbidden.freeze | 2 +- .../403_Forbidden.yaml | 41 ++++++------ .../404_Not_Found.freeze | 1 - .../404_Not_Found.yaml | 62 ------------------- 5 files changed, 21 insertions(+), 87 deletions(-) delete mode 100644 tests/api/datadogV1/cassettes/TestMetricsMetadataGetErrors/404_Not_Found.freeze delete mode 100644 tests/api/datadogV1/cassettes/TestMetricsMetadataGetErrors/404_Not_Found.yaml diff --git a/tests/api/datadogV1/api_metrics_test.go b/tests/api/datadogV1/api_metrics_test.go index 19114a7e4d9..664165edda2 100644 --- a/tests/api/datadogV1/api_metrics_test.go +++ b/tests/api/datadogV1/api_metrics_test.go @@ -227,7 +227,6 @@ func TestMetricsMetadataGetErrors(t *testing.T) { ExpectedStatusCode int }{ "403 Forbidden": {WithFakeAuth, 403}, - "404 Not Found": {WithTestAuth, 404}, } for name, tc := range testCases { @@ -281,7 +280,6 @@ func TestMetricsMetadataUpdateErrors(t *testing.T) { ExpectedStatusCode int }{ "403 Forbidden": {WithFakeAuth, datadogV1.MetricMetadata{}, 403}, - "404 Not Found": {WithTestAuth, datadogV1.MetricMetadata{}, 404}, } for name, tc := range testCases { diff --git a/tests/api/datadogV1/cassettes/TestMetricsMetadataGetErrors/403_Forbidden.freeze b/tests/api/datadogV1/cassettes/TestMetricsMetadataGetErrors/403_Forbidden.freeze index 9441ba5c468..01a2abd78f2 100644 --- a/tests/api/datadogV1/cassettes/TestMetricsMetadataGetErrors/403_Forbidden.freeze +++ b/tests/api/datadogV1/cassettes/TestMetricsMetadataGetErrors/403_Forbidden.freeze @@ -1 +1 @@ -2021-04-12T11:53:36.419372+02:00 \ No newline at end of file +2024-05-23T16:32:35.783124-04:00 \ No newline at end of file diff --git a/tests/api/datadogV1/cassettes/TestMetricsMetadataGetErrors/403_Forbidden.yaml b/tests/api/datadogV1/cassettes/TestMetricsMetadataGetErrors/403_Forbidden.yaml index 1afca443261..2e6fee1b38e 100644 --- a/tests/api/datadogV1/cassettes/TestMetricsMetadataGetErrors/403_Forbidden.yaml +++ b/tests/api/datadogV1/cassettes/TestMetricsMetadataGetErrors/403_Forbidden.yaml @@ -3,13 +3,13 @@ version: 2 interactions: - id: 0 request: - proto: "" - proto_major: 0 - proto_minor: 0 + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 content_length: 0 transfer_encoding: [] trailer: {} - host: "" + host: api.datadoghq.com remote_addr: "" request_uri: "" body: "" @@ -18,38 +18,37 @@ interactions: Accept: - application/json User-Agent: - - datadog-api-client-go/1.0.0-beta.19+dev (go go1.15.7; os darwin; arch amd64) + - datadog-api-client-go/2.26.1+dev (go go1.21.0; os darwin; arch arm64) X-Datadog-Parent-Id: - - "6599909904091897528" + - "1147890079339465938" X-Datadog-Sampling-Priority: - - "1" + - "2" X-Datadog-Trace-Id: - - "7218965529160730359" + - "4998324798915125520" url: https://api.datadoghq.com/api/v1/metrics/ametric method: GET response: - proto: "" - proto_major: 0 - proto_minor: 0 + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 transfer_encoding: [] trailer: {} - content_length: 0 + content_length: 24 uncompressed: false - body: | - {"status":"error","code":403,"errors":["Forbidden"],"statuspage":"http://status.datadoghq.com","twitter":"http://twitter.com/datadogops","email":"support@datadoghq.com"} + body: '{"errors":["Forbidden"]}' headers: - Cache-Control: - - no-cache Connection: - keep-alive Content-Length: - - "170" + - "24" Content-Type: - application/json Date: - - Mon, 12 Apr 2021 09:53:36 GMT - Via: - - haproxy + - Thu, 23 May 2024 20:32:35 GMT + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + X-Content-Type-Options: + - nosniff status: 403 Forbidden code: 403 - duration: 0s + duration: 82.938083ms diff --git a/tests/api/datadogV1/cassettes/TestMetricsMetadataGetErrors/404_Not_Found.freeze b/tests/api/datadogV1/cassettes/TestMetricsMetadataGetErrors/404_Not_Found.freeze deleted file mode 100644 index 58a4ba18349..00000000000 --- a/tests/api/datadogV1/cassettes/TestMetricsMetadataGetErrors/404_Not_Found.freeze +++ /dev/null @@ -1 +0,0 @@ -2021-04-12T11:53:36.503955+02:00 \ No newline at end of file diff --git a/tests/api/datadogV1/cassettes/TestMetricsMetadataGetErrors/404_Not_Found.yaml b/tests/api/datadogV1/cassettes/TestMetricsMetadataGetErrors/404_Not_Found.yaml deleted file mode 100644 index 25f4417bd54..00000000000 --- a/tests/api/datadogV1/cassettes/TestMetricsMetadataGetErrors/404_Not_Found.yaml +++ /dev/null @@ -1,62 +0,0 @@ ---- -version: 2 -interactions: - - id: 0 - request: - proto: "" - proto_major: 0 - proto_minor: 0 - content_length: 0 - transfer_encoding: [] - trailer: {} - host: "" - remote_addr: "" - request_uri: "" - body: "" - form: {} - headers: - Accept: - - application/json - User-Agent: - - datadog-api-client-go/1.0.0-beta.19+dev (go go1.15.7; os darwin; arch amd64) - X-Datadog-Parent-Id: - - "669993683148187432" - X-Datadog-Sampling-Priority: - - "1" - X-Datadog-Trace-Id: - - "7218965529160730359" - url: https://api.datadoghq.com/api/v1/metrics/ametric - method: GET - response: - proto: "" - proto_major: 0 - proto_minor: 0 - transfer_encoding: [] - trailer: {} - content_length: 0 - uncompressed: false - body: '{"errors": ["metric_name not found"]}' - headers: - Cache-Control: - - no-cache - Connection: - - keep-alive - Content-Type: - - application/json - Date: - - Mon, 12 Apr 2021 09:53:36 GMT - Pragma: - - no-cache - Strict-Transport-Security: - - max-age=15724800; - Vary: - - Accept-Encoding - X-Content-Type-Options: - - nosniff - X-Dd-Version: - - "35.4287331" - X-Frame-Options: - - SAMEORIGIN - status: 404 Not Found - code: 404 - duration: 0s