mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-25 09:28:27 +00:00
Added tests for delete
This commit is contained in:
parent
051284c346
commit
262b047224
31
rest-api-spec/test/delete/10_basic.yaml
Normal file
31
rest-api-spec/test/delete/10_basic.yaml
Normal file
@ -0,0 +1,31 @@
|
||||
---
|
||||
"Basic":
|
||||
- do:
|
||||
catch: missing
|
||||
delete:
|
||||
index: test_1
|
||||
type: test
|
||||
id: 1
|
||||
|
||||
- do:
|
||||
delete:
|
||||
index: test_1
|
||||
type: test
|
||||
id: 1
|
||||
ignore_missing: 1
|
||||
|
||||
- do:
|
||||
index:
|
||||
index: test_1
|
||||
type: test
|
||||
id: 1
|
||||
body: { foo: bar }
|
||||
- ok: ok
|
||||
- match: { _version: 3}
|
||||
|
||||
- do:
|
||||
delete:
|
||||
index: test_1
|
||||
type: test
|
||||
id: 1
|
||||
- match: { _version: 4}
|
26
rest-api-spec/test/delete/20_internal_version.yaml
Normal file
26
rest-api-spec/test/delete/20_internal_version.yaml
Normal file
@ -0,0 +1,26 @@
|
||||
---
|
||||
"Internal version":
|
||||
- do:
|
||||
index:
|
||||
index: test_1
|
||||
type: test
|
||||
id: 1
|
||||
body: { foo: bar }
|
||||
- match: { _version: 1}
|
||||
|
||||
- do:
|
||||
catch: conflict
|
||||
delete:
|
||||
index: test_1
|
||||
type: test
|
||||
id: 1
|
||||
version: 2
|
||||
|
||||
- do:
|
||||
delete:
|
||||
index: test_1
|
||||
type: test
|
||||
id: 1
|
||||
version: 1
|
||||
|
||||
- match: { _version: 2 }
|
29
rest-api-spec/test/delete/25_external_version.yaml
Normal file
29
rest-api-spec/test/delete/25_external_version.yaml
Normal file
@ -0,0 +1,29 @@
|
||||
---
|
||||
"External version":
|
||||
- do:
|
||||
index:
|
||||
index: test_1
|
||||
type: test
|
||||
id: 1
|
||||
body: { foo: bar }
|
||||
version_type: external
|
||||
version: 5
|
||||
- match: { _version: 5}
|
||||
|
||||
- do:
|
||||
catch: conflict
|
||||
delete:
|
||||
index: test_1
|
||||
type: test
|
||||
id: 1
|
||||
version_type: external
|
||||
version: 4
|
||||
|
||||
- do:
|
||||
delete:
|
||||
index: test_1
|
||||
type: test
|
||||
id: 1
|
||||
version_type: external
|
||||
version: 6
|
||||
- match: { _version: 6}
|
27
rest-api-spec/test/delete/30_routing.yaml
Normal file
27
rest-api-spec/test/delete/30_routing.yaml
Normal file
@ -0,0 +1,27 @@
|
||||
---
|
||||
"Routing":
|
||||
- do:
|
||||
index:
|
||||
index: test_1
|
||||
type: test
|
||||
id: 1
|
||||
routing: 5
|
||||
body: { foo: bar }
|
||||
- do:
|
||||
cluster.health:
|
||||
wait_for_status: yellow
|
||||
- do:
|
||||
catch: missing
|
||||
delete:
|
||||
index: test_1
|
||||
type: test
|
||||
id: 1
|
||||
routing: 4
|
||||
|
||||
- do:
|
||||
delete:
|
||||
index: test_1
|
||||
type: test
|
||||
id: 1
|
||||
routing: 5
|
||||
|
40
rest-api-spec/test/delete/40_parent.yaml
Normal file
40
rest-api-spec/test/delete/40_parent.yaml
Normal file
@ -0,0 +1,40 @@
|
||||
---
|
||||
"Parent":
|
||||
- skip:
|
||||
version: "0 - 0.90.2"
|
||||
reason: Delete ignores the parent param
|
||||
|
||||
- do:
|
||||
indices.create:
|
||||
index: test_1
|
||||
body:
|
||||
mappings:
|
||||
test:
|
||||
_parent: { type: "foo" }
|
||||
- do:
|
||||
cluster.health:
|
||||
wait_for_status: yellow
|
||||
|
||||
- do:
|
||||
index:
|
||||
index: test_1
|
||||
type: test
|
||||
id: 1
|
||||
parent: 5
|
||||
body: { foo: bar }
|
||||
|
||||
- do:
|
||||
catch: missing
|
||||
delete:
|
||||
index: test_1
|
||||
type: test
|
||||
id: 1
|
||||
parent: 1
|
||||
|
||||
- do:
|
||||
delete:
|
||||
index: test_1
|
||||
type: test
|
||||
id: 1
|
||||
parent: 5
|
||||
|
28
rest-api-spec/test/delete/42_missing_parent.yml
Normal file
28
rest-api-spec/test/delete/42_missing_parent.yml
Normal file
@ -0,0 +1,28 @@
|
||||
---
|
||||
"Delete on all shards when parent not specified":
|
||||
|
||||
- do:
|
||||
indices.create:
|
||||
index: test_1
|
||||
body:
|
||||
mappings:
|
||||
test:
|
||||
_parent: { type: "foo" }
|
||||
- do:
|
||||
cluster.health:
|
||||
wait_for_status: yellow
|
||||
|
||||
- do:
|
||||
index:
|
||||
index: test_1
|
||||
type: test
|
||||
id: 1
|
||||
parent: 5
|
||||
body: { foo: bar }
|
||||
|
||||
- do:
|
||||
delete:
|
||||
index: test_1
|
||||
type: test
|
||||
id: 1
|
||||
|
39
rest-api-spec/test/delete/45_parent_with_routing.yaml
Normal file
39
rest-api-spec/test/delete/45_parent_with_routing.yaml
Normal file
@ -0,0 +1,39 @@
|
||||
---
|
||||
"Parent with routing":
|
||||
- do:
|
||||
indices.create:
|
||||
index: test_1
|
||||
body:
|
||||
mappings:
|
||||
test:
|
||||
_parent: { type: "foo" }
|
||||
- do:
|
||||
cluster.health:
|
||||
wait_for_status: yellow
|
||||
|
||||
- do:
|
||||
index:
|
||||
index: test_1
|
||||
type: test
|
||||
id: 1
|
||||
parent: 5
|
||||
routing: 4
|
||||
body: { foo: bar }
|
||||
|
||||
- do:
|
||||
catch: missing
|
||||
delete:
|
||||
index: test_1
|
||||
type: test
|
||||
id: 1
|
||||
parent: 5
|
||||
routing: 1
|
||||
|
||||
- do:
|
||||
delete:
|
||||
index: test_1
|
||||
type: test
|
||||
id: 1
|
||||
parent: 5
|
||||
routing: 4
|
||||
|
67
rest-api-spec/test/delete/50_refresh.yaml
Normal file
67
rest-api-spec/test/delete/50_refresh.yaml
Normal file
@ -0,0 +1,67 @@
|
||||
---
|
||||
"Refresh":
|
||||
- do:
|
||||
indices.create:
|
||||
index: test_1
|
||||
body:
|
||||
settings:
|
||||
index.refresh_interval: -1
|
||||
- do:
|
||||
cluster.health:
|
||||
wait_for_status: yellow
|
||||
|
||||
- do:
|
||||
index:
|
||||
index: test_1
|
||||
type: test
|
||||
id: 1
|
||||
body: { foo: bar }
|
||||
refresh: 1
|
||||
|
||||
- do:
|
||||
index:
|
||||
index: test_1
|
||||
type: test
|
||||
id: 2
|
||||
body: { foo: bar }
|
||||
refresh: 1
|
||||
|
||||
- do:
|
||||
search:
|
||||
index: test_1
|
||||
type: test
|
||||
body:
|
||||
query: { terms: { _id: [1,2] }}
|
||||
|
||||
- match: { hits.total: 2 }
|
||||
|
||||
- do:
|
||||
delete:
|
||||
index: test_1
|
||||
type: test
|
||||
id: 1
|
||||
|
||||
- do:
|
||||
search:
|
||||
index: test_1
|
||||
type: test
|
||||
body:
|
||||
query: { terms: { _id: [1,2] }}
|
||||
|
||||
- match: { hits.total: 2 }
|
||||
|
||||
- do:
|
||||
delete:
|
||||
index: test_1
|
||||
type: test
|
||||
id: 2
|
||||
refresh: 1
|
||||
|
||||
- do:
|
||||
search:
|
||||
index: test_1
|
||||
type: test
|
||||
body:
|
||||
query: { terms: { _id: [1,2] }}
|
||||
|
||||
- match: { hits.total: 1 }
|
6
rest-api-spec/test/delete/TODO.txt
Normal file
6
rest-api-spec/test/delete/TODO.txt
Normal file
@ -0,0 +1,6 @@
|
||||
Tests missing for:
|
||||
|
||||
# consistency
|
||||
# replication
|
||||
# timeout
|
||||
|
Loading…
x
Reference in New Issue
Block a user