-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathreference_tables.feature
More file actions
121 lines (105 loc) · 7.69 KB
/
Copy pathreference_tables.feature
File metadata and controls
121 lines (105 loc) · 7.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
@endpoint(reference-tables) @endpoint(reference-tables-v2)
Feature: Reference Tables
View and manage Reference Tables in your organization.
Background:
Given a valid "apiKeyAuth" key in the system
And a valid "appKeyAuth" key in the system
And an instance of "ReferenceTables" API
@generated @skip @team:DataDog/redapl-experiences
Scenario: Create reference table returns "Bad Request" response
Given new "CreateReferenceTable" request
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"}}
When the request is sent
Then the response status is 400 Bad Request
@generated @skip @team:DataDog/redapl-experiences
Scenario: Create reference table returns "Created" response
Given new "CreateReferenceTable" request
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"}}
When the request is sent
Then the response status is 201 Created
@generated @skip @team:DataDog/redapl-experiences
Scenario: Create reference table upload returns "Bad Request" response
Given new "CreateReferenceTableUpload" request
And body with value {"data": {"attributes": {"headers": ["field_1", "field_2"], "part_count": 3, "part_size": 10000000, "table_name": ""}, "type": "upload"}}
When the request is sent
Then the response status is 400 Bad Request
@skip @team:DataDog/redapl-experiences
Scenario: Create reference table upload returns "Created" response
Given new "CreateReferenceTableUpload" request
And body with value {"data": {"attributes": {"headers": ["id", "name", "value"], "table_name": "test_upload_table_{{ unique }}", "part_count": 1, "part_size": 1024}, "type": "upload"}}
When the request is sent
Then the response status is 201 Created
And the response "data.type" is equal to "upload"
And the response "data.attributes.table_name" is equal to "test_upload_table_{{ unique }}"
@skip @team:DataDog/redapl-experiences
Scenario: Create reference table with upload returns "Created" response
Given new "CreateReferenceTable" request
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"}}
When the request is sent
Then the response status is 201 Created
And the response "data.type" is equal to "reference_table"
And the response "data.attributes.table_name" is equal to "test_reference_table_{{ unique }}"
@team:DataDog/redapl-experiences
Scenario: Create reference table without upload or access details returns "Bad Request" response
Given new "CreateReferenceTable" request
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"}}
When the request is sent
Then the response status is 400 Bad Request
@generated @skip @team:DataDog/redapl-experiences
Scenario: Delete table returns "Not Found" response
Given new "DeleteTable" request
And request contains "id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found
@generated @skip @team:DataDog/redapl-experiences
Scenario: Delete table returns "OK" response
Given new "DeleteTable" request
And request contains "id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 200 OK
@generated @skip @team:DataDog/redapl-experiences
Scenario: Get rows by id returns "Not Found" response
Given new "GetRowsByID" request
And request contains "id" parameter from "REPLACE.ME"
And request contains "row_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found
@generated @skip @team:DataDog/redapl-experiences
Scenario: Get rows by id returns "Some or all requested rows were found." response
Given new "GetRowsByID" request
And request contains "id" parameter from "REPLACE.ME"
And request contains "row_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 200 Some or all requested rows were found.
@generated @skip @team:DataDog/redapl-experiences
Scenario: Get table returns "Not Found" response
Given new "GetTable" request
And request contains "id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found
@generated @skip @team:DataDog/redapl-experiences
Scenario: Get table returns "OK" response
Given new "GetTable" request
And request contains "id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 200 OK
@skip @team:DataDog/redapl-experiences
Scenario: List tables returns "OK" response
Given new "ListTables" request
When the request is sent
Then the response status is 200 OK
And the response "data" has length 1
@generated @skip @team:DataDog/redapl-experiences
Scenario: Update reference table returns "Bad Request" response
Given new "UpdateReferenceTable" request
And request contains "id" parameter from "REPLACE.ME"
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"]}, "type": "reference_table"}}
When the request is sent
Then the response status is 400 Bad Request
@generated @skip @team:DataDog/redapl-experiences
Scenario: Update reference table returns "OK" response
Given new "UpdateReferenceTable" request
And request contains "id" parameter from "REPLACE.ME"
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"]}, "type": "reference_table"}}
When the request is sent
Then the response status is 200 OK