Skip to content

Commit

Permalink
add integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
trinity-1686a committed Nov 8, 2024
1 parent 2f5ad21 commit 14ecacb
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@ endpoint: indexes/test-index
---
method: DELETE
api_root: http://localhost:7280/api/v1/
endpoint: indexes/test-index-pattern-777
---
method: DELETE
api_root: http://localhost:7280/api/v1/
endpoint: templates/test-index-template
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# This tests a simple request with no queries.
endpoint: empty-string/search
params:
query: "str:''"
expected:
num_hits: 2
---
endpoint: empty-string/search
params:
query: "str_array:''"
expected:
num_hits: 2
---
endpoint: empty-string/search
params:
query: "dyn_str:''"
expected:
num_hits: 2
---
endpoint: empty-string/search
params:
query: "dyn_str_array:''"
expected:
num_hits: 2
---
endpoint: empty-string/search
params:
query: "str:'' AND str_array:ghi"
expected:
num_hits: 1
---
endpoint: empty-string/search
params:
query: "str_array:'' AND str_array:ghi"
expected:
num_hits: 1
---
endpoint: empty-string/search
params:
query: "dyn_str:'' AND str_array:ghi"
expected:
num_hits: 1
---
endpoint: empty-string/search
params:
query: "dyn_str_array:'' AND str_array:ghi"
expected:
num_hits: 1
---
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,32 @@ params:
commit: force
ndjson:
- {"seq": 4, "tag": 1}
---
method: DELETE
endpoint: indexes/empty-string
status_code: null
---
# Create index
method: POST
endpoint: indexes/
json:
version: "0.7"
index_id: empty-string
doc_mapping:
mode: dynamic
field_mappings:
- name: str
type: text
- name: str_array
type: array<text>
---
# Ingest documents
method: POST
endpoint: empty-string/ingest
params:
commit: force
ndjson:
- {"str": "abc", "str_array": ["abc", "def"], "dyn_str": "abc", "dyn_str_array": ["abc", "def"]}
- {"str": "", "str_array": [""], "dyn_str": "", "dyn_str_array": [""]}
- {"str": "", "str_array": ["ghi", ""], "dyn_str": "", "dyn_str_array": ["ghi", ""]}
- {"str_array": [], "dyn_str_array": []}
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ endpoint: indexes/simple
---
method: DELETE
endpoint: indexes/tagged
---
method: DELETE
endpoint: indexes/empty-string

0 comments on commit 14ecacb

Please sign in to comment.