Skip to content

Commit a2afe56

Browse files
Tokeshdblock
andauthored
adding missing tests (#749)
* adding missing tests Signed-off-by: Tokesh <[email protected]> * fixing validate ci, links, added node failure in specs Signed-off-by: Tokesh <[email protected]> * adding node failures to changelog, fixing path in specs of update by query and small fix in response of query group tests Signed-off-by: Tokesh <[email protected]> * Support combining multiple output variables. (#737) * Support combining multiple output variables. Signed-off-by: dblock <[email protected]> Signed-off-by: Tokesh <[email protected]> * hotfix of method in snapshots Signed-off-by: Tokesh <[email protected]> * hotfix with snapshot tests Signed-off-by: Tokesh <[email protected]> * hotfix race condition Signed-off-by: Tokesh <[email protected]> * adding chapter in snapshot tests Signed-off-by: Tokesh <[email protected]> * correcting path to repository in snapshot tests Signed-off-by: Tokesh <[email protected]> * adding verbose to check ci Signed-off-by: Tokesh <[email protected]> * deleting verbose Signed-off-by: Tokesh <[email protected]> * added retry to status in snapshots Signed-off-by: Tokesh <[email protected]> * added retry to correct place Signed-off-by: Tokesh <[email protected]> * adding verbose to check Signed-off-by: Tokesh <[email protected]> * renaming to avoid race condition Signed-off-by: Tokesh <[email protected]> * refactoring folder organization, adding retries, fixing naming Signed-off-by: Tokesh <[email protected]> --------- Signed-off-by: Tokesh <[email protected]> Signed-off-by: dblock <[email protected]> Signed-off-by: Niyazbek Torekeldi <[email protected]> Co-authored-by: Daniel (dB.) Doubrovkine <[email protected]>
1 parent 4231dad commit a2afe56

File tree

7 files changed

+103
-5
lines changed

7 files changed

+103
-5
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
3838
- Added missing `cancelled` and `resource_stats` to `/_reindex/{task_id}/_rethrottle` ([#740](https://github.com/opensearch-project/opensearch-api-specification/pull/740))
3939
- Added missing `cancellation_time_millis` to `POST /_tasks/_cancel` ([#747](https://github.com/opensearch-project/opensearch-api-specification/pull/747))
4040
- Added support for combining output variables ([#737](https://github.com/opensearch-project/opensearch-api-specification/pull/737))
41+
- Added 404 response to `/_search/scroll` ([#749](https://github.com/opensearch-project/opensearch-api-specification/pull/749))
42+
- Added `node_failures` to `DELETE /_search/scroll` and `DELETE /_search/scroll/{scroll_id}` ([#749](https://github.com/opensearch-project/opensearch-api-specification/pull/749))
4143

4244
### Removed
4345
- Removed unsupported `_common.mapping:SourceField`'s `mode` field and associated `_common.mapping:SourceFieldMode` enum ([#652](https://github.com/opensearch-project/opensearch-api-specification/pull/652))

spec/namespaces/_core.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -898,6 +898,8 @@ paths:
898898
responses:
899899
'200':
900900
$ref: '#/components/responses/clear_scroll@200'
901+
'404':
902+
$ref: '#/components/responses/clear_scroll@404'
901903
/_search/scroll/{scroll_id}:
902904
get:
903905
operationId: scroll.2
@@ -956,6 +958,8 @@ paths:
956958
responses:
957959
'200':
958960
$ref: '#/components/responses/clear_scroll@200'
961+
'404':
962+
$ref: '#/components/responses/clear_scroll@404'
959963
/_search/template:
960964
get:
961965
operationId: search_template.0
@@ -2868,6 +2872,20 @@ components:
28682872
required:
28692873
- num_freed
28702874
- succeeded
2875+
clear_scroll@404:
2876+
content:
2877+
application/json:
2878+
schema:
2879+
type: object
2880+
properties:
2881+
succeeded:
2882+
type: boolean
2883+
num_freed:
2884+
type: integer
2885+
format: int32
2886+
required:
2887+
- num_freed
2888+
- succeeded
28712889
count@200:
28722890
content:
28732891
application/json:
@@ -3370,6 +3388,10 @@ components:
33703388
type: object
33713389
additionalProperties:
33723390
$ref: '../schemas/_core.update_by_query_rethrottle.yaml#/components/schemas/UpdateByQueryRethrottleNode'
3391+
node_failures:
3392+
type: array
3393+
items:
3394+
$ref: '../schemas/_common.yaml#/components/schemas/ErrorCause'
33733395
required:
33743396
- nodes
33753397
parameters:

tests/default/_core/search/scroll.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,3 +105,11 @@ chapters:
105105
path: /_search/scroll/{scroll_id}
106106
parameters:
107107
scroll_id: ${scroll.scroll_id}
108+
- synopsis: Deleting a non-existent scroll.
109+
method: DELETE
110+
path: /_search/scroll
111+
request:
112+
payload:
113+
scroll_id: ${scroll.scroll_id}
114+
response:
115+
status: 404
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
$schema: ../../../../json_schemas/test_story.schema.yaml
2+
3+
description: Test Update By Query rethrottle endpoint.
4+
prologues:
5+
- path: /books/_update_by_query
6+
id: task
7+
method: POST
8+
parameters:
9+
refresh: true
10+
conflicts: proceed
11+
wait_for_completion: false
12+
request:
13+
payload:
14+
query:
15+
match_all: {}
16+
output:
17+
id: payload.task
18+
chapters:
19+
- synopsis: Update by query.
20+
path: /_update_by_query/{task_id}/_rethrottle
21+
method: POST
22+
parameters:
23+
task_id: ${task.id}
24+
requests_per_second: 10
25+

tests/plugins/workload-management/wlm/query_group.yaml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,16 @@ chapters:
1313
resource_limits:
1414
memory: 0.1
1515
resiliency_mode: monitor
16+
- synopsis: Update a QueryGroup by name.
17+
path: /_wlm/query_group/{name}
18+
method: PUT
19+
parameters:
20+
name: analytics
21+
request:
22+
payload:
23+
resource_limits:
24+
memory: 0.2
25+
resiliency_mode: soft
1626
- synopsis: Get the QueryGroup by name.
1727
path: /_wlm/query_group/{name}
1828
method: GET
@@ -24,11 +34,19 @@ chapters:
2434
query_groups:
2535
- name: analytics
2636
resource_limits:
27-
memory: 0.1
28-
resiliency_mode: monitor
37+
memory: 0.2
38+
resiliency_mode: soft
2939
- synopsis: Get all QueryGroups.
3040
path: /_wlm/query_group
3141
method: GET
42+
response:
43+
status: 200
44+
payload:
45+
query_groups:
46+
- name: analytics
47+
resource_limits:
48+
memory: 0.2
49+
resiliency_mode: soft
3250
- synopsis: Delete a QueryGroup.
3351
path: /_wlm/query_group/{name}
3452
parameters:

tests/snapshot/snapshot/snapshot.yaml

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ epilogues:
88
parameters:
99
repository: my-fs-repository
1010
snapshot: my-test-snapshot
11+
- path: /_snapshot/{repository}/{snapshot}
12+
method: DELETE
13+
status: [200, 404]
14+
parameters:
15+
repository: my-fs-repository
16+
snapshot: my-second-snapshot
1117
- path: /_snapshot/{repository}
1218
method: DELETE
1319
status: [200, 404]
@@ -65,7 +71,22 @@ chapters:
6571
status: 200
6672
payload:
6773
snapshot:
68-
snapshot: my-test-snapshot
74+
snapshot: my-test-snapshot
75+
- synopsis: Create a second snapshot.
76+
path: /_snapshot/{repository}/{snapshot}
77+
method: POST
78+
parameters:
79+
repository: my-fs-repository
80+
snapshot: my-second-snapshot
81+
wait_for_completion: true
82+
request:
83+
payload:
84+
indices: '*'
85+
response:
86+
status: 200
87+
payload:
88+
snapshot:
89+
snapshot: my-second-snapshot
6990
- synopsis: Get information about a snapshot.
7091
path: /_snapshot/{repository}/{snapshot}
7192
method: GET
@@ -82,13 +103,13 @@ chapters:
82103
method: GET
83104
parameters:
84105
repository: my-fs-repository
85-
snapshot: my-test-snapshot
106+
snapshot: my-second-snapshot
86107
human: true
87108
response:
88109
status: 200
89110
payload:
90111
snapshots:
91-
- snapshot: my-test-snapshot
112+
- snapshot: my-second-snapshot
92113
- synopsis: Delete a snapshot.
93114
path: /_snapshot/{repository}/{snapshot}
94115
method: DELETE

tests/snapshot/snapshot/status.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ prologues:
3434
ignore_unavailable: true
3535
include_global_state: false
3636
partial: true
37+
retry:
38+
count: 3
3739
chapters:
3840
- synopsis: Get status of all running snapshots.
3941
path: /_snapshot/_status

0 commit comments

Comments
 (0)