Skip to content

Commit

Permalink
Add scenario for each error response code that isn't 401 or 403 (#653)
Browse files Browse the repository at this point in the history
* Add monitor cassette and update scenario to work with path params

* Fix index of new context key

* fmt

* Cleanup based on review

* Address review

* Remove extra error

* Regenerate client from commit 426d7a0 of spec repo

Co-authored-by: Nicholas Muesch <nicholas.muesch@datadoghq.com>
Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
  • Loading branch information
3 people authored Jan 13, 2021
1 parent 4c630bd commit 4303ec4
Show file tree
Hide file tree
Showing 39 changed files with 2,260 additions and 14 deletions.
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.4.1.dev2",
"regenerated": "2021-01-13 11:20:31.164517",
"spec_repo_commit": "166fecc"
"regenerated": "2021-01-13 15:26:40.504258",
"spec_repo_commit": "426d7a0"
},
"v2": {
"apigentools_version": "1.4.1.dev2",
"regenerated": "2021-01-13 11:20:37.215955",
"spec_repo_commit": "166fecc"
"regenerated": "2021-01-13 15:26:46.218881",
"spec_repo_commit": "426d7a0"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2021-01-08T14:02:50.164567-05:00
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
version: 1
interactions:
- request:
body: ""
form: {}
headers:
Accept:
- application/json
Dd-Operation-Id:
- GetMonitor
User-Agent:
- datadog-api-client-go/1.0.0-beta.14+dev (go go1.15.4; os darwin; arch amd64)
X-Datadog-Parent-Id:
- "7903827536385416972"
X-Datadog-Sampling-Priority:
- "1"
X-Datadog-Trace-Id:
- "5260392844676116825"
url: https://api.datadoghq.com/api/v1/monitor/12345
method: GET
response:
body: '{"errors":["Monitor not found"]}'
headers:
Cache-Control:
- no-cache
Connection:
- keep-alive
Content-Type:
- application/json
Date:
- Fri, 08 Jan 2021 18:59:01 GMT
Pragma:
- no-cache
Strict-Transport-Security:
- max-age=15724800;
Vary:
- Accept-Encoding
X-Content-Type-Options:
- nosniff
X-Dd-Version:
- "35.3668062"
X-Frame-Options:
- SAMEORIGIN
X-Ratelimit-Limit:
- "3000"
X-Ratelimit-Period:
- "10"
X-Ratelimit-Remaining:
- "2999"
X-Ratelimit-Reset:
- "9"
status: 404 Not Found
code: 404
duration: ""
75 changes: 75 additions & 0 deletions tests/api/v1/datadog/features/aws_integration.feature
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,78 @@ Feature: AWS Integration
And body {}
When the request is sent
Then the response status is 200 OK

@generated @skip
Scenario: Delete an AWS integration returns "Bad Request" response
Given new "DeleteAWSAccount" request
And body {}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip
Scenario: Delete an AWS integration returns "Conflict Error" response
Given new "DeleteAWSAccount" request
And body {}
When the request is sent
Then the response status is 409 Conflict Error

@generated @skip
Scenario: List all AWS integrations returns "Bad Request" response
Given new "ListAWSAccounts" request
When the request is sent
Then the response status is 400 Bad Request

@generated @skip
Scenario: Create an AWS integration returns "Bad Request" response
Given new "CreateAWSAccount" request
And body {}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip
Scenario: Create an AWS integration returns "Conflict Error" response
Given new "CreateAWSAccount" request
And body {}
When the request is sent
Then the response status is 409 Conflict Error

@generated @skip
Scenario: Update an AWS integration returns "Bad Request" response
Given new "UpdateAWSAccount" request
And body {}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip
Scenario: Update an AWS integration returns "Conflict Error" response
Given new "UpdateAWSAccount" request
And body {}
When the request is sent
Then the response status is 409 Conflict Error

@generated @skip
Scenario: Delete a tag filtering entry returns "Bad Request" response
Given new "DeleteAWSTagFilter" request
And body {}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip
Scenario: Get all AWS tag filters returns "Bad Request" response
Given new "ListAWSTagFilters" request
When the request is sent
Then the response status is 400 Bad Request

@generated @skip
Scenario: Set an AWS tag filter returns "Bad Request" response
Given new "CreateAWSTagFilter" request
And body {}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip
Scenario: Generate a new external ID returns "Bad Request" response
Given new "CreateNewAWSExternalID" request
And body {}
When the request is sent
Then the response status is 400 Bad Request
41 changes: 41 additions & 0 deletions tests/api/v1/datadog/features/aws_logs_integration.feature
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,44 @@ Feature: AWS Logs Integration
And body {}
When the request is sent
Then the response status is 200 OK

@generated @skip
Scenario: Delete an AWS Logs integration returns "Bad Request" response
Given new "DeleteAWSLambdaARN" request
And body {}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip
Scenario: List all AWS Logs integrations returns "Bad Request" response
Given new "ListAWSLogsIntegrations" request
When the request is sent
Then the response status is 400 Bad Request

@generated @skip
Scenario: Add AWS Log Lambda ARN returns "Bad Request" response
Given new "CreateAWSLambdaARN" request
And body {}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip
Scenario: Check that an AWS Lambda Function exists returns "Bad Request" response
Given new "CheckAWSLogsLambdaAsync" request
And body {}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip
Scenario: Enable an AWS Logs integration returns "Bad Request" response
Given new "EnableAWSLogServices" request
And body {}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip
Scenario: Check permissions for log services returns "Bad Request" response
Given new "CheckAWSLogsServicesAsync" request
And body {}
When the request is sent
Then the response status is 400 Bad Request
34 changes: 34 additions & 0 deletions tests/api/v1/datadog/features/azure_integration.feature
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,37 @@ Feature: Azure Integration
And body {}
When the request is sent
Then the response status is 200 OK

@generated @skip
Scenario: Delete an Azure integration returns "Bad Request" response
Given new "DeleteAzureIntegration" request
And body {}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip
Scenario: List all Azure integrations returns "Bad Request" response
Given new "ListAzureIntegration" request
When the request is sent
Then the response status is 400 Bad Request

@generated @skip
Scenario: Create an Azure integration returns "Bad Request" response
Given new "CreateAzureIntegration" request
And body {}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip
Scenario: Update an Azure integration returns "Bad Request" response
Given new "UpdateAzureIntegration" request
And body {}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip
Scenario: Update Azure integration host filters returns "Bad Request" response
Given new "UpdateAzureHostFilters" request
And body {}
When the request is sent
Then the response status is 400 Bad Request
37 changes: 37 additions & 0 deletions tests/api/v1/datadog/features/dashboard_lists.feature
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,40 @@ Feature: Dashboard Lists
And body {}
When the request is sent
Then the response status is 200 OK

@generated @skip
Scenario: Create a dashboard list returns "Bad Request" response
Given new "CreateDashboardList" request
And body {}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip
Scenario: Delete a dashboard list returns "Not Found" response
Given new "DeleteDashboardList" request
And request contains "list_id" parameter from "<PATH>"
When the request is sent
Then the response status is 404 Not Found

@generated @skip
Scenario: Get a dashboard list returns "Not Found" response
Given new "GetDashboardList" request
And request contains "list_id" parameter from "<PATH>"
When the request is sent
Then the response status is 404 Not Found

@generated @skip
Scenario: Update a dashboard list returns "Bad Request" response
Given new "UpdateDashboardList" request
And request contains "list_id" parameter from "<PATH>"
And body {}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip
Scenario: Update a dashboard list returns "Not Found" response
Given new "UpdateDashboardList" request
And request contains "list_id" parameter from "<PATH>"
And body {}
When the request is sent
Then the response status is 404 Not Found
37 changes: 37 additions & 0 deletions tests/api/v1/datadog/features/dashboards.feature
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,40 @@ Feature: Dashboards
And body {}
When the request is sent
Then the response status is 200 OK

@generated @skip
Scenario: Create a new dashboard returns "Bad Request" response
Given new "CreateDashboard" request
And body {}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip
Scenario: Delete a dashboard returns "Dashboards Not Found" response
Given new "DeleteDashboard" request
And request contains "dashboard_id" parameter from "<PATH>"
When the request is sent
Then the response status is 404 Dashboards Not Found

@generated @skip
Scenario: Get a dashboard returns "Item Not Found" response
Given new "GetDashboard" request
And request contains "dashboard_id" parameter from "<PATH>"
When the request is sent
Then the response status is 404 Item Not Found

@generated @skip
Scenario: Update a dashboard returns "Bad Request" response
Given new "UpdateDashboard" request
And request contains "dashboard_id" parameter from "<PATH>"
And body {}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip
Scenario: Update a dashboard returns "Item Not Found" response
Given new "UpdateDashboard" request
And request contains "dashboard_id" parameter from "<PATH>"
And body {}
When the request is sent
Then the response status is 404 Item Not Found
51 changes: 51 additions & 0 deletions tests/api/v1/datadog/features/downtimes.feature
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,54 @@ Feature: Downtimes
And body {}
When the request is sent
Then the response status is 200 OK

@generated @skip
Scenario: Schedule a downtime returns "Bad Request" response
Given new "CreateDowntime" request
And body {}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip
Scenario: Cancel downtimes by scope returns "Bad Request" response
Given new "CancelDowntimesByScope" request
And body {}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip
Scenario: Cancel downtimes by scope returns "Downtimes not found" response
Given new "CancelDowntimesByScope" request
And body {}
When the request is sent
Then the response status is 404 Downtimes not found

@generated @skip
Scenario: Cancel a downtime returns "Downtime not found" response
Given new "CancelDowntime" request
And request contains "downtime_id" parameter from "<PATH>"
When the request is sent
Then the response status is 404 Downtime not found

@generated @skip
Scenario: Get a downtime returns "Downtime not found" response
Given new "GetDowntime" request
And request contains "downtime_id" parameter from "<PATH>"
When the request is sent
Then the response status is 404 Downtime not found

@generated @skip
Scenario: Update a downtime returns "Bad Request" response
Given new "UpdateDowntime" request
And request contains "downtime_id" parameter from "<PATH>"
And body {}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip
Scenario: Update a downtime returns "Downtime not found" response
Given new "UpdateDowntime" request
And request contains "downtime_id" parameter from "<PATH>"
And body {}
When the request is sent
Then the response status is 404 Downtime not found
13 changes: 13 additions & 0 deletions tests/api/v1/datadog/features/events.feature
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,16 @@ Feature: Events
And request contains "event_id" parameter from "<PATH>"
When the request is sent
Then the response status is 200 OK

@generated @skip
Scenario: Query the event stream returns "Bad Request" response
Given new "ListEvents" request
When the request is sent
Then the response status is 400 Bad Request

@generated @skip
Scenario: Get an event returns "Item Not Found" response
Given new "GetEvent" request
And request contains "event_id" parameter from "<PATH>"
When the request is sent
Then the response status is 404 Item Not Found
Loading

0 comments on commit 4303ec4

Please sign in to comment.