Skip to content

Commit

Permalink
Added tests for /_validate/query. (opensearch-project#739)
Browse files Browse the repository at this point in the history
* Added tests for /_validate/query.

Signed-off-by: dblock <[email protected]>

* Added retry for opensearch-project#738.

Signed-off-by: dblock <[email protected]>

---------

Signed-off-by: dblock <[email protected]>
  • Loading branch information
dblock authored and nathaliellenaa committed Dec 17, 2024
1 parent 0f2c91f commit 5d7569f
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 18 deletions.
17 changes: 17 additions & 0 deletions tests/default/_core/validate/query.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
$schema: ../../../../json_schemas/test_story.schema.yaml

description: Test validating queries.
chapters:
- synopsis: Validate a query.
path: /_validate/query
method:
- GET
- POST
request:
payload:
query:
match_all: {}
response:
status: 200
payload:
valid: true
23 changes: 5 additions & 18 deletions tests/default/indices/validate/query.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
$schema: ../../../../json_schemas/test_story.schema.yaml

description: Test validating queries for a specific index using both GET and POST methods.
description: Test validating queries for a specific index.
epilogues:
- path: /movies
method: DELETE
Expand All @@ -18,9 +18,11 @@ prologues:
- {create: {_index: movies, _id: movie2}}
- {director: Nicolas Winding Refn, title: Drive, year: 1960}
chapters:
- synopsis: Validate a match query (GET).
- synopsis: Validate a match query.
path: /{index}/_validate/query
method: GET
method:
- GET
- POST
parameters:
index: movies
request:
Expand All @@ -32,18 +34,3 @@ chapters:
status: 200
payload:
valid: true

- synopsis: Validate a match query (POST).
path: /{index}/_validate/query
method: POST
parameters:
index: movies
request:
payload:
query:
match:
title: Drive
response:
status: 200
payload:
valid: true
2 changes: 2 additions & 0 deletions tests/plugins/security/api/nodesdn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ chapters:
payload:
nodes_dn:
- CN=cluster.example.com
retry:
count: 3
response:
status: 201
payload:
Expand Down

0 comments on commit 5d7569f

Please sign in to comment.