Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,18 @@ This project contains BDD tests.
__Never__ run the test suite against an organization with production data.

Tests can be executed via [`cucumber`](https://cucumber.io/docs/guides/).
You can optionally add `features/v<NUMBER>/<FILENAME>.feature:<LINE_NUMBER>` to filter individual tests.

Generated SDKs include the language-neutral request plans and replay server
under `features/generated`. Run them without an API spec checkout or generator
tooling:

```shell
./run-bdd-tests.sh
```

The Ruby Cucumber runner still invokes the generated SDK method and validates
its response. Request bodies and parameters come from the generated scenario
plan, while recorded HTTP interactions are replayed by the shared server.

By default integration tests use recorded API responses stored in cassettes. To record new API responses run the tests with `RECORD=true`. To run integration tests against API without recording cassettes, run the tests with `RECORD=none`.

Expand All @@ -39,4 +50,4 @@ generated code, only commit test files being updated and any updated cassettes.
### CI

In rare ocassions, the test suite may fail due to a corrupted cache in `ruby/setup-ruby` action.
Please update `CACHE_VERSION` secret in https://github.com/DataDog/datadog-api-client-ruby/settings/secrets/actions/CACHE_VERSION with a new unique value.
Please update `CACHE_VERSION` secret in https://github.com/DataDog/datadog-api-client-ruby/settings/secrets/actions/CACHE_VERSION with a new unique value.
125 changes: 125 additions & 0 deletions features/generated/test-runner-data/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
{
"scenarios": [
{
"feature": "Action Connection",
"file": "v2/action-connection/create-a-new-action-connection-returns-bad-request-response.json",
"scenario": "Create a new Action Connection returns \"Bad Request\" response",
"version": "v2"
},
{
"feature": "Action Connection",
"file": "v2/action-connection/create-a-new-action-connection-returns-successfully-created-action-connection-response.json",
"scenario": "Create a new Action Connection returns \"Successfully created Action Connection\" response",
"version": "v2"
},
{
"feature": "Action Connection",
"file": "v2/action-connection/delete-an-existing-action-connection-returns-not-found-response.json",
"scenario": "Delete an existing Action Connection returns \"Not Found\" response",
"version": "v2"
},
{
"feature": "Action Connection",
"file": "v2/action-connection/delete-an-existing-action-connection-returns-the-resource-was-deleted-successfully-response.json",
"scenario": "Delete an existing Action Connection returns \"The resource was deleted successfully.\" response",
"version": "v2"
},
{
"feature": "Action Connection",
"file": "v2/action-connection/get-an-existing-action-connection-returns-bad-request-response.json",
"scenario": "Get an existing Action Connection returns \"Bad Request\" response",
"version": "v2"
},
{
"feature": "Action Connection",
"file": "v2/action-connection/get-an-existing-action-connection-returns-not-found-response.json",
"scenario": "Get an existing Action Connection returns \"Not Found\" response",
"version": "v2"
},
{
"feature": "Action Connection",
"file": "v2/action-connection/get-an-existing-action-connection-returns-successfully-get-action-connection-response.json",
"scenario": "Get an existing Action Connection returns \"Successfully get Action Connection\" response",
"version": "v2"
},
{
"feature": "Action Connection",
"file": "v2/action-connection/get-an-existing-app-key-registration-returns-bad-request-response.json",
"scenario": "Get an existing App Key Registration returns \"Bad request\" response",
"version": "v2"
},
{
"feature": "Action Connection",
"file": "v2/action-connection/get-an-existing-app-key-registration-returns-not-found-response.json",
"scenario": "Get an existing App Key Registration returns \"Not found\" response",
"version": "v2"
},
{
"feature": "Action Connection",
"file": "v2/action-connection/get-an-existing-app-key-registration-returns-ok-response.json",
"scenario": "Get an existing App Key Registration returns \"OK\" response",
"version": "v2"
},
{
"feature": "Action Connection",
"file": "v2/action-connection/list-app-key-registrations-returns-bad-request-response.json",
"scenario": "List App Key Registrations returns \"Bad request\" response",
"version": "v2"
},
{
"feature": "Action Connection",
"file": "v2/action-connection/list-app-key-registrations-returns-ok-response.json",
"scenario": "List App Key Registrations returns \"OK\" response",
"version": "v2"
},
{
"feature": "Action Connection",
"file": "v2/action-connection/register-a-new-app-key-returns-bad-request-response.json",
"scenario": "Register a new App Key returns \"Bad request\" response",
"version": "v2"
},
{
"feature": "Action Connection",
"file": "v2/action-connection/register-a-new-app-key-returns-created-response.json",
"scenario": "Register a new App Key returns \"Created\" response",
"version": "v2"
},
{
"feature": "Action Connection",
"file": "v2/action-connection/unregister-an-app-key-returns-bad-request-response.json",
"scenario": "Unregister an App Key returns \"Bad request\" response",
"version": "v2"
},
{
"feature": "Action Connection",
"file": "v2/action-connection/unregister-an-app-key-returns-no-content-response.json",
"scenario": "Unregister an App Key returns \"No Content\" response",
"version": "v2"
},
{
"feature": "Action Connection",
"file": "v2/action-connection/unregister-an-app-key-returns-not-found-response.json",
"scenario": "Unregister an App Key returns \"Not found\" response",
"version": "v2"
},
{
"feature": "Action Connection",
"file": "v2/action-connection/update-an-existing-action-connection-returns-bad-request-response.json",
"scenario": "Update an existing Action Connection returns \"Bad Request\" response",
"version": "v2"
},
{
"feature": "Action Connection",
"file": "v2/action-connection/update-an-existing-action-connection-returns-not-found-response.json",
"scenario": "Update an existing Action Connection returns \"Not Found\" response",
"version": "v2"
},
{
"feature": "Action Connection",
"file": "v2/action-connection/update-an-existing-action-connection-returns-successfully-updated-action-connection-response.json",
"scenario": "Update an existing Action Connection returns \"Successfully updated Action Connection\" response",
"version": "v2"
}
],
"schema_version": 1
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"api": "ActionConnection",
"expected_status": 400,
"feature": "Action Connection",
"id": "v2/Action Connection/Create a new Action Connection returns \"Bad Request\" response",
"operation_id": "CreateActionConnection",
"request": {
"body": {
"schema": {
"format": null,
"ref": "CreateActionConnectionRequest",
"type": "object"
},
"source": "inline",
"value": {
"data": {
"attributes": {
"integration": {
"credentials": {
"account_id": "1",
"role": "MyRoleUpdated",
"type": "AWSAssumeRole"
},
"type": "AWS"
},
"name": "Cassette Connection"
},
"type": "action_connection"
}
}
},
"content_type": "application/json",
"method": "POST",
"pagination": false,
"parameters": [],
"path": "/api/v2/actions/connections"
},
"scenario": "Create a new Action Connection returns \"Bad Request\" response",
"schema_version": 1,
"version": "v2"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"api": "ActionConnection",
"expected_status": 201,
"feature": "Action Connection",
"id": "v2/Action Connection/Create a new Action Connection returns \"Successfully created Action Connection\" response",
"operation_id": "CreateActionConnection",
"request": {
"body": {
"schema": {
"format": null,
"ref": "CreateActionConnectionRequest",
"type": "object"
},
"source": "inline",
"value": {
"data": {
"attributes": {
"integration": {
"credentials": {
"account_id": "123456789123",
"role": "MyRoleUpdated",
"type": "AWSAssumeRole"
},
"type": "AWS"
},
"name": "Cassette Connection {{ unique_lower_alnum }}"
},
"type": "action_connection"
}
}
},
"content_type": "application/json",
"method": "POST",
"pagination": false,
"parameters": [],
"path": "/api/v2/actions/connections"
},
"scenario": "Create a new Action Connection returns \"Successfully created Action Connection\" response",
"schema_version": 1,
"version": "v2"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"api": "ActionConnection",
"expected_status": 404,
"feature": "Action Connection",
"id": "v2/Action Connection/Delete an existing Action Connection returns \"Not Found\" response",
"operation_id": "DeleteActionConnection",
"request": {
"body": null,
"content_type": null,
"method": "DELETE",
"pagination": false,
"parameters": [
{
"in": "path",
"name": "connection_id",
"schema": {
"format": null,
"ref": null,
"type": "string"
},
"source": {
"type": "literal",
"value": "aaa11111-aa11-aa11-aaaa-aaaaaa111111"
}
}
],
"path": "/api/v2/actions/connections/{connection_id}"
},
"scenario": "Delete an existing Action Connection returns \"Not Found\" response",
"schema_version": 1,
"version": "v2"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"api": "ActionConnection",
"expected_status": 204,
"feature": "Action Connection",
"id": "v2/Action Connection/Delete an existing Action Connection returns \"The resource was deleted successfully.\" response",
"operation_id": "DeleteActionConnection",
"request": {
"body": null,
"content_type": null,
"method": "DELETE",
"pagination": false,
"parameters": [
{
"in": "path",
"name": "connection_id",
"schema": {
"format": null,
"ref": null,
"type": "string"
},
"source": {
"path": "action_connection.data.id",
"type": "fixture"
}
}
],
"path": "/api/v2/actions/connections/{connection_id}"
},
"scenario": "Delete an existing Action Connection returns \"The resource was deleted successfully.\" response",
"schema_version": 1,
"version": "v2"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"api": "ActionConnection",
"expected_status": 400,
"feature": "Action Connection",
"id": "v2/Action Connection/Get an existing Action Connection returns \"Bad Request\" response",
"operation_id": "GetActionConnection",
"request": {
"body": null,
"content_type": null,
"method": "GET",
"pagination": false,
"parameters": [
{
"in": "path",
"name": "connection_id",
"schema": {
"format": null,
"ref": null,
"type": "string"
},
"source": {
"type": "literal",
"value": "bad-format"
}
}
],
"path": "/api/v2/actions/connections/{connection_id}"
},
"scenario": "Get an existing Action Connection returns \"Bad Request\" response",
"schema_version": 1,
"version": "v2"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"api": "ActionConnection",
"expected_status": 404,
"feature": "Action Connection",
"id": "v2/Action Connection/Get an existing Action Connection returns \"Not Found\" response",
"operation_id": "GetActionConnection",
"request": {
"body": null,
"content_type": null,
"method": "GET",
"pagination": false,
"parameters": [
{
"in": "path",
"name": "connection_id",
"schema": {
"format": null,
"ref": null,
"type": "string"
},
"source": {
"type": "literal",
"value": "aaa11111-aa11-aa11-aaaa-aaaaaa111111"
}
}
],
"path": "/api/v2/actions/connections/{connection_id}"
},
"scenario": "Get an existing Action Connection returns \"Not Found\" response",
"schema_version": 1,
"version": "v2"
}
Loading
Loading