-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathactions_datastores.feature
More file actions
247 lines (220 loc) · 12 KB
/
actions_datastores.feature
File metadata and controls
247 lines (220 loc) · 12 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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
@endpoint(actions-datastores) @endpoint(actions-datastores-v2)
Feature: Actions Datastores
Leverage the Actions Datastore API to create, modify, and delete items in
datastores owned by your organization.
Background:
Given a valid "apiKeyAuth" key in the system
And a valid "appKeyAuth" key in the system
And an instance of "ActionsDatastores" API
@team:DataDog/app-builder-backend
Scenario: Bulk delete datastore items returns "Bad Request" response
Given new "BulkDeleteDatastoreItems" request
And there is a valid "datastore" in the system
And request contains "datastore_id" parameter from "datastore.data.id"
And body with value {"data": {"attributes": {"item_keys": []}, "type": "items"}}
When the request is sent
Then the response status is 400 Bad Request
@team:DataDog/app-builder-backend
Scenario: Bulk delete datastore items returns "Not Found" response
Given new "BulkDeleteDatastoreItems" request
And request contains "datastore_id" parameter with value "c1eb5bb8-726a-4e59-9a61-ccbb26f95329"
And body with value {"data": {"attributes": {"item_keys": ["nonexistent"]}, "type": "items"}}
When the request is sent
Then the response status is 404 Not Found
@skip-typescript @team:DataDog/app-builder-backend
Scenario: Bulk delete datastore items returns "OK" response
Given new "BulkDeleteDatastoreItems" request
And there is a valid "datastore" in the system
And there is a valid "datastore_item" in the system
And request contains "datastore_id" parameter from "datastore.data.id"
And body with value {"data": {"attributes": {"item_keys": ["test-key"]}, "type": "items"}}
When the request is sent
Then the response status is 200 OK
@team:DataDog/app-builder-backend
Scenario: Bulk write datastore items returns "Bad Request" response
Given new "BulkWriteDatastoreItems" request
And there is a valid "datastore" in the system
And request contains "datastore_id" parameter from "datastore.data.id"
And body with value {"data": {"attributes": {"values": [{"id": "cust_3141", "name": "Johnathan"}, {"badPrimaryKey": "key2", "name": "Johnathan"}]}, "type": "items"}}
When the request is sent
Then the response status is 400 Bad Request
And the response "errors" has length 1
And the response "errors[0].title" is equal to "item key missing or invalid"
@team:DataDog/app-builder-backend
Scenario: Bulk write datastore items returns "Not Found" response
Given new "BulkWriteDatastoreItems" request
And request contains "datastore_id" parameter with value "70b87c26-886f-497a-bd9d-09f53bc9b40c"
And body with value {"data": {"attributes": {"values": [{"id": "cust_3141", "name": "Johnathan"}, {"id": "cust_3142", "name": "Mary"}]}, "type": "items"}}
When the request is sent
Then the response status is 404 Not Found
And the response "errors" has length 1
And the response "errors[0].title" is equal to "datastore not found"
@team:DataDog/app-builder-backend
Scenario: Bulk write datastore items returns "OK" response
Given new "BulkWriteDatastoreItems" request
And there is a valid "datastore" in the system
And request contains "datastore_id" parameter from "datastore.data.id"
And body with value {"data": {"attributes": {"values": [{"id": "cust_3141", "name": "Johnathan"}, {"id": "cust_3142", "name": "Mary"}]}, "type": "items"}}
When the request is sent
Then the response status is 200 OK
And the response "data" has length 2
@team:DataDog/app-builder-backend
Scenario: Create datastore returns "Bad Request" response
Given new "CreateDatastore" request
And body with value {"data": {"attributes": {"name": "datastore-name", "primary_column_name": "0invalid_key"}, "type": "datastores"}}
When the request is sent
Then the response status is 400 Bad Request
And the response "errors" has length 1
And the response "errors[0].title" is equal to "datastore configuration invalid"
@team:DataDog/app-builder-backend
Scenario: Create datastore returns "OK" response
Given new "CreateDatastore" request
And body with value {"data": {"attributes": {"name": "datastore-name", "primary_column_name": "primaryKey"}, "type": "datastores"}}
When the request is sent
Then the response status is 200 OK
@team:DataDog/app-builder-backend
Scenario: Delete datastore item returns "Bad Request" response
Given new "DeleteDatastoreItem" request
And request contains "datastore_id" parameter with value "invalid-uuid"
And body with value {"data": {"attributes": {"item_key": "primaryKey"}, "type": "items"}}
When the request is sent
Then the response status is 400 Bad Request
And the response "errors" has length 1
And the response "errors[0].title" is equal to "invalid path parameter"
@team:DataDog/app-builder-backend
Scenario: Delete datastore item returns "Not Found" response
Given new "DeleteDatastoreItem" request
And request contains "datastore_id" parameter with value "70b87c26-886f-497a-bd9d-09f53bc9b40c"
And body with value {"data": {"attributes": {"item_key": "primaryKey"}, "type": "items"}}
When the request is sent
Then the response status is 404 Not Found
And the response "errors" has length 1
And the response "errors[0].title" is equal to "datastore not found"
@skip-typescript @team:DataDog/app-builder-backend
Scenario: Delete datastore item returns "OK" response
Given new "DeleteDatastoreItem" request
And there is a valid "datastore" in the system
And there is a valid "datastore_item" in the system
And request contains "datastore_id" parameter from "datastore.data.id"
And body with value {"data": {"attributes": {"item_key": "test-key"}, "type": "items" }}
When the request is sent
Then the response status is 200 OK
@team:DataDog/app-builder-backend
Scenario: Delete datastore returns "Bad Request" response
Given new "DeleteDatastore" request
And request contains "datastore_id" parameter with value "invalid-uuid"
When the request is sent
Then the response status is 400 Bad Request
And the response "errors" has length 1
And the response "errors[0].title" is equal to "invalid path parameter"
@skip-typescript @skip-validation @team:DataDog/app-builder-backend
Scenario: Delete datastore returns "OK" response
Given new "DeleteDatastore" request
And there is a valid "datastore" in the system
And request contains "datastore_id" parameter from "datastore.data.id"
When the request is sent
Then the response status is 200 OK
@team:DataDog/app-builder-backend
Scenario: Get datastore returns "Bad Request" response
Given new "GetDatastore" request
And request contains "datastore_id" parameter with value "invalid-uuid"
When the request is sent
Then the response status is 400 Bad Request
And the response "errors" has length 1
And the response "errors[0].title" is equal to "invalid path parameter"
@team:DataDog/app-builder-backend
Scenario: Get datastore returns "Not Found" response
Given new "GetDatastore" request
And request contains "datastore_id" parameter with value "5bf53b3f-b230-4b35-ab1a-b39f2633eb22"
When the request is sent
Then the response status is 404 Not Found
And the response "errors" has length 1
And the response "errors[0].title" is equal to "datastore not found"
@team:DataDog/app-builder-backend
Scenario: Get datastore returns "OK" response
Given new "GetDatastore" request
And there is a valid "datastore" in the system
And request contains "datastore_id" parameter from "datastore.data.id"
When the request is sent
Then the response status is 200 OK
And the response "data.id" is equal to "{{datastore.data.id}}"
@team:DataDog/app-builder-backend
Scenario: List datastore items returns "Bad Request" response
Given new "ListDatastoreItems" request
And request contains "datastore_id" parameter with value "invalid-uuid"
When the request is sent
Then the response status is 400 Bad Request
And the response "errors" has length 1
And the response "errors[0].title" is equal to "invalid path parameter"
@team:DataDog/app-builder-backend
Scenario: List datastore items returns "Not Found" response
Given new "ListDatastoreItems" request
And request contains "datastore_id" parameter with value "3cfdd0b8-c490-4969-8d51-69add64a70ea"
When the request is sent
Then the response status is 404 Not Found
And the response "errors" has length 1
And the response "errors[0].title" is equal to "datastore not found"
@skip-typescript @team:DataDog/app-builder-backend
Scenario: List datastore items returns "OK" response
Given new "ListDatastoreItems" request
And there is a valid "datastore" in the system
And there is a valid "datastore_item" in the system
And request contains "datastore_id" parameter from "datastore.data.id"
When the request is sent
Then the response status is 200 OK
And the response "data" has length 1
@team:DataDog/app-builder-backend
Scenario: List datastores returns "OK" response
Given new "ListDatastores" request
When the request is sent
Then the response status is 200 OK
@team:DataDog/app-builder-backend
Scenario: Update datastore item returns "Bad Request" response
Given new "UpdateDatastoreItem" request
And request contains "datastore_id" parameter with value "invalid-uuid"
And body with value {"data": {"attributes": {"item_changes": {}, "item_key": ""}, "type": "items"}}
When the request is sent
Then the response status is 400 Bad Request
@team:DataDog/app-builder-backend
Scenario: Update datastore item returns "Not Found" response
Given new "UpdateDatastoreItem" request
And request contains "datastore_id" parameter with value "3cfdd0b8-c490-4969-8d51-69add64a70ea"
And body with value {"data": {"attributes": {"item_changes": {}, "item_key": "itemKey"}, "type": "items"}}
When the request is sent
Then the response status is 404 Not Found
@skip-typescript @team:DataDog/app-builder-backend
Scenario: Update datastore item returns "OK" response
Given new "UpdateDatastoreItem" request
And there is a valid "datastore" in the system
And there is a valid "datastore_item" in the system
And request contains "datastore_id" parameter from "datastore.data.id"
And body with value {"data": {"attributes": {"item_changes": {}, "item_key": "test-key"}, "type": "items"}}
When the request is sent
Then the response status is 200 OK
@team:DataDog/app-builder-backend
Scenario: Update datastore returns "Bad Request" response
Given new "UpdateDatastore" request
And request contains "datastore_id" parameter with value "invalid-uuid"
And body with value {"data": {"attributes": {}, "type": "datastores", "id": "invalid-uuid"}}
When the request is sent
Then the response status is 400 Bad Request
And the response "errors" has length 1
And the response "errors[0].title" is equal to "invalid path parameter"
@team:DataDog/app-builder-backend
Scenario: Update datastore returns "Not Found" response
Given new "UpdateDatastore" request
And request contains "datastore_id" parameter with value "c1eb5bb8-726a-4e59-9a61-ccbb26f95329"
And body with value {"data": {"attributes": {"name": "updated name"}, "type": "datastores", "id": "c1eb5bb8-726a-4e59-9a61-ccbb26f95329"}}
When the request is sent
Then the response status is 404 Not Found
And the response "errors" has length 1
And the response "errors[0].title" is equal to "datastore not found"
@team:DataDog/app-builder-backend
Scenario: Update datastore returns "OK" response
Given new "UpdateDatastore" request
And there is a valid "datastore" in the system
And request contains "datastore_id" parameter from "datastore.data.id"
And body with value {"data": {"attributes": {"name": "updated name"}, "type": "datastores", "id": "{{datastore.data.id}}"}}
When the request is sent
Then the response status is 200 OK
And the response "data.attributes.name" is equal to "updated name"