|
| 1 | +@endpoint(reference-tables) @endpoint(reference-tables-v2) |
| 2 | +Feature: Reference Tables |
| 3 | + Auto-generated tag Reference Tables |
| 4 | + |
| 5 | + Background: |
| 6 | + Given a valid "apiKeyAuth" key in the system |
| 7 | + And a valid "appKeyAuth" key in the system |
| 8 | + And an instance of "ReferenceTables" API |
| 9 | + |
| 10 | + @generated @skip @team:DataDog/redapl-experiences |
| 11 | + Scenario: Create reference table returns "Bad Request" response |
| 12 | + Given new "CreateReferenceTable" request |
| 13 | + And body with value {"data": {"attributes": {"description": "this is a cloud table generated via a cloud bucket sync", "file_metadata": {"access_details": {"aws_detail": {"aws_account_id": "test-account-id", "aws_bucket_name": "test-bucket", "file_path": "test_rt.csv"}}, "sync_enabled": true}, "schema": {"fields": [{"name": "name", "type": "STRING"}, {"name": "account_id", "type": "STRING"}], "primary_keys": ["account_id"]}, "source": "S3", "table_name": "test_reference_table", "tags": ["test_tag"]}, "type": "reference_table"}} |
| 14 | + When the request is sent |
| 15 | + Then the response status is 400 Bad Request |
| 16 | + |
| 17 | + @generated @skip @team:DataDog/redapl-experiences |
| 18 | + Scenario: Create reference table returns "Created" response |
| 19 | + Given new "CreateReferenceTable" request |
| 20 | + And body with value {"data": {"attributes": {"description": "this is a cloud table generated via a cloud bucket sync", "file_metadata": {"access_details": {"aws_detail": {"aws_account_id": "test-account-id", "aws_bucket_name": "test-bucket", "file_path": "test_rt.csv"}}, "sync_enabled": true}, "schema": {"fields": [{"name": "name", "type": "STRING"}, {"name": "account_id", "type": "STRING"}], "primary_keys": ["account_id"]}, "source": "S3", "table_name": "test_reference_table", "tags": ["test_tag"]}, "type": "reference_table"}} |
| 21 | + When the request is sent |
| 22 | + Then the response status is 201 Created |
| 23 | + |
| 24 | + @generated @skip @team:DataDog/redapl-experiences |
| 25 | + Scenario: Create reference table upload returns "Bad Request" response |
| 26 | + Given new "CreateReferenceTableUpload" request |
| 27 | + And body with value {"data": {"attributes": {"headers": [""], "part_count": 3, "part_size": 10000000, "table_name": ""}, "type": "upload"}} |
| 28 | + When the request is sent |
| 29 | + Then the response status is 400 Bad Request |
| 30 | + |
| 31 | + @skip @team:DataDog/redapl-experiences |
| 32 | + Scenario: Create reference table upload returns "Created" response |
| 33 | + Given new "CreateReferenceTableUpload" request |
| 34 | + And body with value {"data": {"attributes": {"headers": ["id", "name", "value"], "table_name": "test_upload_table_{{ unique }}", "part_count": 1, "part_size": 1024}, "type": "upload"}} |
| 35 | + When the request is sent |
| 36 | + Then the response status is 201 Created |
| 37 | + And the response "data.type" is equal to "upload" |
| 38 | + And the response "data.attributes.table_name" is equal to "test_upload_table_{{ unique }}" |
| 39 | + |
| 40 | + @skip @team:DataDog/redapl-experiences |
| 41 | + Scenario: Create reference table with upload returns "Created" response |
| 42 | + Given new "CreateReferenceTable" request |
| 43 | + And body with value {"data": {"attributes": {"description": "Test reference table created via BDD test {{ unique }}", "source": "LOCAL_FILE", "file_metadata": {"upload_id": "test-upload-id-{{ unique }}"}, "schema": {"fields": [{"name": "id", "type": "STRING"}, {"name": "name", "type": "STRING"}, {"name": "value", "type": "INT32"}], "primary_keys": ["id"]}, "table_name": "test_reference_table_{{ unique }}", "tags": ["test_tag"]}, "type": "reference_table"}} |
| 44 | + When the request is sent |
| 45 | + Then the response status is 201 Created |
| 46 | + And the response "data.type" is equal to "reference_table" |
| 47 | + And the response "data.attributes.table_name" is equal to "test_reference_table_{{ unique }}" |
| 48 | + |
| 49 | + @team:DataDog/redapl-experiences |
| 50 | + Scenario: Create reference table without upload or access details returns "Bad Request" response |
| 51 | + Given new "CreateReferenceTable" request |
| 52 | + And body with value {"data": {"attributes": {"description": "Test reference table without upload or access details", "source": "LOCAL_FILE", "schema": {"fields": [{"name": "id", "type": "STRING"}], "primary_keys": ["id"]}, "table_name": "test_invalid_table_{{ unique }}", "tags": ["test_tag"]}, "type": "reference_table"}} |
| 53 | + When the request is sent |
| 54 | + Then the response status is 400 Bad Request |
| 55 | + |
| 56 | + @generated @skip @team:DataDog/redapl-experiences |
| 57 | + Scenario: Delete table returns "Not Found" response |
| 58 | + Given new "DeleteTable" request |
| 59 | + And request contains "id" parameter from "REPLACE.ME" |
| 60 | + When the request is sent |
| 61 | + Then the response status is 404 Not Found |
| 62 | + |
| 63 | + @generated @skip @team:DataDog/redapl-experiences |
| 64 | + Scenario: Delete table returns "OK" response |
| 65 | + Given new "DeleteTable" request |
| 66 | + And request contains "id" parameter from "REPLACE.ME" |
| 67 | + When the request is sent |
| 68 | + Then the response status is 200 OK |
| 69 | + |
| 70 | + @generated @skip @team:DataDog/redapl-experiences |
| 71 | + Scenario: Get rows by id returns "Not Found" response |
| 72 | + Given new "GetRowsByID" request |
| 73 | + And request contains "row_id" parameter from "REPLACE.ME" |
| 74 | + And request contains "id" parameter from "REPLACE.ME" |
| 75 | + When the request is sent |
| 76 | + Then the response status is 404 Not Found |
| 77 | + |
| 78 | + @generated @skip @team:DataDog/redapl-experiences |
| 79 | + Scenario: Get rows by id returns "Some or all requested rows were found." response |
| 80 | + Given new "GetRowsByID" request |
| 81 | + And request contains "row_id" parameter from "REPLACE.ME" |
| 82 | + And request contains "id" parameter from "REPLACE.ME" |
| 83 | + When the request is sent |
| 84 | + Then the response status is 200 Some or all requested rows were found. |
| 85 | + |
| 86 | + @generated @skip @team:DataDog/redapl-experiences |
| 87 | + Scenario: Get table returns "Not Found" response |
| 88 | + Given new "GetTable" request |
| 89 | + And request contains "id" parameter from "REPLACE.ME" |
| 90 | + When the request is sent |
| 91 | + Then the response status is 404 Not Found |
| 92 | + |
| 93 | + @generated @skip @team:DataDog/redapl-experiences |
| 94 | + Scenario: Get table returns "OK" response |
| 95 | + Given new "GetTable" request |
| 96 | + And request contains "id" parameter from "REPLACE.ME" |
| 97 | + When the request is sent |
| 98 | + Then the response status is 200 OK |
| 99 | + |
| 100 | + @skip @team:DataDog/redapl-experiences |
| 101 | + Scenario: List tables returns "OK" response |
| 102 | + Given new "ListTables" request |
| 103 | + When the request is sent |
| 104 | + Then the response status is 200 OK |
| 105 | + And the response "data" has length 1 |
| 106 | + |
| 107 | + @generated @skip @team:DataDog/redapl-experiences |
| 108 | + Scenario: Update reference table returns "Bad Request" response |
| 109 | + Given new "UpdateReferenceTable" request |
| 110 | + And request contains "id" parameter from "REPLACE.ME" |
| 111 | + And body with value {"data": {"attributes": {"description": "this is a cloud table generated via a cloud bucket sync", "file_metadata": {"access_details": {"aws_detail": {"aws_account_id": "test-account-id", "aws_bucket_name": "test-bucket", "file_path": "test_rt.csv"}}, "sync_enabled": true}, "schema": {"fields": [{"name": "id", "type": "INT32"}, {"name": "name", "type": "STRING"}], "primary_keys": ["id"]}, "sync_enabled": false, "tags": ["test_tag"]}, "id": "00000000-0000-0000-0000-000000000000", "type": "reference_table"}} |
| 112 | + When the request is sent |
| 113 | + Then the response status is 400 Bad Request |
| 114 | + |
| 115 | + @generated @skip @team:DataDog/redapl-experiences |
| 116 | + Scenario: Update reference table returns "OK" response |
| 117 | + Given new "UpdateReferenceTable" request |
| 118 | + And request contains "id" parameter from "REPLACE.ME" |
| 119 | + And body with value {"data": {"attributes": {"description": "this is a cloud table generated via a cloud bucket sync", "file_metadata": {"access_details": {"aws_detail": {"aws_account_id": "test-account-id", "aws_bucket_name": "test-bucket", "file_path": "test_rt.csv"}}, "sync_enabled": true}, "schema": {"fields": [{"name": "id", "type": "INT32"}, {"name": "name", "type": "STRING"}], "primary_keys": ["id"]}, "sync_enabled": false, "tags": ["test_tag"]}, "id": "00000000-0000-0000-0000-000000000000", "type": "reference_table"}} |
| 120 | + When the request is sent |
| 121 | + Then the response status is 200 OK |
0 commit comments