Renamed "ok" and "not_ok" to "is_true" and "is_false"

and tidied up the layout to make it easier to read
This commit is contained in:
Clinton Gormley 2013-07-01 15:58:23 +02:00
parent 846420904d
commit df94f08dab
44 changed files with 129 additions and 39 deletions

View File

@ -101,19 +101,19 @@ testing indexing a document without a specified ID:
The stash should be reset at the beginning of each test file.
=== `ok`
=== `is_true`
The specified key exists and has a true value (ie not `0`, `false`, `undefined`, `null`
or the empty string), eg:
- ok: fields._parent # the _parent key exists in the fields hash and is "true"
- is_true: fields._parent # the _parent key exists in the fields hash and is "true"
=== `not_ok`
=== `is_false`
The specified key doesn't exist or has a false value (ie `0`, `false`, `undefined`,
`null` or the empty string), eg:
- not_ok: fields._source # the _source key doesn't exist in the fields hash
- is_false: fields._source # the _source key doesn't exist in the fields hash
=== `match`

View File

@ -6,7 +6,8 @@
type: test
id: 1
body: { foo: bar }
- ok: ok
- is_true: ok
- match: { _index: test_1 }
- match: { _type: test }
- match: { _id: 1}
@ -17,6 +18,7 @@
index: test_1
type: test
id: 1
- match: { _index: test_1 }
- match: { _type: test }
- match: { _id: 1}

View File

@ -5,8 +5,9 @@
index: test_1
type: test
body: { foo: bar }
- ok: ok
- ok: _id
- is_true: ok
- is_true: _id
- match: { _index: test_1 }
- match: { _type: test }
- match: { _version: 1 }
@ -17,6 +18,7 @@
index: test_1
type: test
id: '$id'
- match: { _index: test_1 }
- match: { _type: test }
- match: { _id: $id }

View File

@ -1,11 +1,13 @@
---
"Internal version":
- do:
create:
index: test_1
type: test
id: 1
body: { foo: bar }
- match: { _version: 1}
- do:

View File

@ -1,5 +1,6 @@
---
"External version":
- do:
create:
index: test_1
@ -8,7 +9,9 @@
body: { foo: bar }
version_type: external
version: 5
- match: { _version: 5}
- do:
catch: conflict
create:
@ -18,6 +21,7 @@
body: { foo: bar }
version_type: external
version: 5
- do:
catch: conflict
create:

View File

@ -1,5 +1,6 @@
---
"Routing":
- do:
create:
index: test_1
@ -10,6 +11,7 @@
- do:
cluster.health:
wait_for_status: yellow
- do:
get:
index: test_1
@ -17,6 +19,7 @@
id: 1
routing: 5
fields: [_routing]
- match: { _id: 1}
- match: { fields._routing: 5}

View File

@ -1,5 +1,6 @@
---
"Parent":
- do:
indices.create:
index: test_1
@ -26,6 +27,7 @@
id: 1
parent: 5
fields: [_parent, _routing]
- match: { _id: 1}
- match: { fields._parent: 5}
- match: { fields._routing: 5}

View File

@ -1,5 +1,6 @@
---
"Parent with routing":
- do:
indices.create:
index: test_1
@ -28,6 +29,7 @@
parent: 5
routing: 4
fields: [_parent, _routing]
- match: { _id: 1}
- match: { fields._parent: 5}
- match: { fields._routing: 4}

View File

@ -1,5 +1,6 @@
---
"Refresh":
- do:
indices.create:
index: test_1

View File

@ -1,5 +1,6 @@
---
"Timestamp":
- do:
indices.create:
index: test_1
@ -27,7 +28,8 @@
type: test
id: 1
fields: _timestamp
- ok: fields._timestamp
- is_true: fields._timestamp
# milliseconds since epoch
@ -50,6 +52,7 @@
type: test
id: 1
fields: _timestamp
- match: { fields._timestamp: 1372011280000 }
# date format
@ -73,5 +76,6 @@
type: test
id: 1
fields: _timestamp
- match: { fields._timestamp: 1372011280000 }

View File

@ -1,5 +1,6 @@
---
"TTL":
- do:
indices.create:
index: test_1
@ -28,6 +29,7 @@
type: test
id: 1
fields: _ttl
- lt: { fields._ttl: 10000}
- gt: { fields._ttl: 0}
@ -51,6 +53,7 @@
type: test
id: 1
fields: _ttl
- lt: { fields._ttl: 100000}
- gt: { fields._ttl: 10000}
@ -75,6 +78,7 @@
type: test
id: 1
fields: _ttl
- lt: { fields._ttl: 20000}
- gt: { fields._ttl: 10000}

View File

@ -1,5 +1,6 @@
---
"Basic":
- do:
catch: missing
delete:
@ -20,7 +21,8 @@
type: test
id: 1
body: { foo: bar }
- ok: ok
- is_true: ok
- match: { _version: 3}
- do:
@ -28,4 +30,5 @@
index: test_1
type: test
id: 1
- match: { _version: 4}

View File

@ -1,11 +1,13 @@
---
"Internal version":
- do:
index:
index: test_1
type: test
id: 1
body: { foo: bar }
- match: { _version: 1}
- do:

View File

@ -1,5 +1,6 @@
---
"External version":
- do:
index:
index: test_1
@ -8,6 +9,7 @@
body: { foo: bar }
version_type: external
version: 5
- match: { _version: 5}
- do:
@ -26,4 +28,5 @@
id: 1
version_type: external
version: 6
- match: { _version: 6}

View File

@ -1,5 +1,6 @@
---
"Routing":
- do:
index:
index: test_1
@ -10,6 +11,7 @@
- do:
cluster.health:
wait_for_status: yellow
- do:
catch: missing
delete:

View File

@ -1,5 +1,6 @@
---
"Parent with routing":
- do:
indices.create:
index: test_1

View File

@ -1,5 +1,6 @@
---
"Refresh":
- do:
indices.create:
index: test_1

View File

@ -1,5 +1,6 @@
---
"Basic GET":
- do:
catch: missing
get:

View File

@ -1,5 +1,6 @@
---
"Fields":
- do:
index:
index: test_1
@ -13,11 +14,11 @@
id: 1
fields: foo
- match: { _index: test_1 }
- match: { _type: test }
- match: { _id: 1 }
- match: { fields.foo: bar }
- not_ok: _source
- match: { _index: test_1 }
- match: { _type: test }
- match: { _id: 1 }
- match: { fields.foo: bar }
- is_false: _source
- do:
get:
@ -25,9 +26,10 @@
type: test
id: 1
fields: [foo, count]
- match: { fields.foo: bar }
- match: { fields.count: 1 }
- not_ok: _source
- match: { fields.foo: bar }
- match: { fields.count: 1 }
- is_false: _source
- do:
get:
@ -35,6 +37,7 @@
type: test
id: 1
fields: [foo, count, _source]
- match: { fields.foo: bar }
- match: { fields.count: 1 }
- match: { _source.foo: bar }

View File

@ -1,5 +1,6 @@
---
"Parent":
- do:
indices.create:
index: test_1
@ -26,6 +27,7 @@
id: 1
parent: 5
fields: [_parent, _routing]
- match: { _id: 1}
- match: { fields._parent: 5}
- match: { fields._routing: 5}

View File

@ -1,5 +1,6 @@
---
"Routing":
- do:
index:
index: test_1
@ -17,6 +18,7 @@
id: 1
routing: 5
fields: [_routing]
- match: { _id: 1}
- match: { fields._routing: 5}

View File

@ -1,5 +1,6 @@
---
"Parent with routing":
- do:
indices.create:
index: test_1
@ -28,6 +29,7 @@
parent: 5
routing: 4
fields: [_parent, _routing]
- match: { _id: 1}
- match: { fields._parent: 5}
- match: { fields._routing: 4}

View File

@ -1,12 +1,14 @@
---
"Index with ID":
- do:
index:
index: test_1
type: test
id: 1
body: { foo: bar }
- ok: ok
- is_true: ok
- match: { _index: test_1 }
- match: { _type: test }
- match: { _id: 1}
@ -17,6 +19,7 @@
index: test_1
type: test
id: 1
- match: { _index: test_1 }
- match: { _type: test }
- match: { _id: 1}

View File

@ -1,12 +1,14 @@
---
"Index without ID":
- do:
index:
index: test_1
type: test
body: { foo: bar }
- ok: ok
- ok: _id
- is_true: ok
- is_true: _id
- match: { _index: test_1 }
- match: { _type: test }
- match: { _version: 1 }
@ -17,6 +19,7 @@
index: test_1
type: test
id: '$id'
- match: { _index: test_1 }
- match: { _type: test }
- match: { _id: $id }

View File

@ -1,5 +1,6 @@
---
"Optype":
- do:
index:
index: test_1

View File

@ -1,5 +1,6 @@
---
"Internal version":
- do:
index:
index: test_1

View File

@ -1,5 +1,6 @@
---
"External version":
- do:
index:
index: test_1
@ -8,7 +9,9 @@
body: { foo: bar }
version_type: external
version: 5
- match: { _version: 5}
- do:
catch: conflict
index:
@ -18,6 +21,7 @@
body: { foo: bar }
version_type: external
version: 5
- do:
index:
index: test_1
@ -26,4 +30,5 @@
body: { foo: bar }
version_type: external
version: 6
- match: { _version: 6}

View File

@ -1,5 +1,6 @@
---
"Routing":
- do:
index:
index: test_1
@ -10,6 +11,7 @@
- do:
cluster.health:
wait_for_status: yellow
- do:
get:
index: test_1
@ -17,6 +19,7 @@
id: 1
routing: 5
fields: [_routing]
- match: { _id: 1}
- match: { fields._routing: 5}

View File

@ -1,5 +1,6 @@
---
"Parent with routing":
- do:
indices.create:
index: test_1
@ -28,6 +29,7 @@
parent: 5
routing: 4
fields: [_parent, _routing]
- match: { _id: 1}
- match: { fields._parent: 5}
- match: { fields._routing: 4}

View File

@ -1,5 +1,6 @@
---
"Refresh":
- do:
indices.create:
index: test_1

View File

@ -1,5 +1,6 @@
---
"Timestamp":
- do:
indices.create:
index: test_1
@ -27,7 +28,8 @@
type: test
id: 1
fields: _timestamp
- ok: fields._timestamp
- is_true: fields._timestamp
# milliseconds since epoch
@ -45,6 +47,7 @@
type: test
id: 1
fields: _timestamp
- match: { fields._timestamp: 1372011280000 }
# date format
@ -63,5 +66,6 @@
type: test
id: 1
fields: _timestamp
- match: { fields._timestamp: 1372011280000 }

View File

@ -1,5 +1,6 @@
---
"TTL":
- do:
indices.create:
index: test_1
@ -28,6 +29,7 @@
type: test
id: 1
fields: _ttl
- lt: { fields._ttl: 10000}
- gt: { fields._ttl: 0}
@ -46,6 +48,7 @@
type: test
id: 1
fields: _ttl
- lt: { fields._ttl: 100000}
- gt: { fields._ttl: 10000}
@ -65,6 +68,7 @@
type: test
id: 1
fields: _ttl
- lt: { fields._ttl: 20000}
- gt: { fields._ttl: 10000}

View File

@ -1,12 +1,12 @@
---
"Info":
- do: {info: {}}
- match: { status: 200 }
- ok: ok
- ok: name
- ok: tagline
- ok: version
- ok: version.lucene_version
- ok: version.number
- do: {info: {}}
- match: {status: 200}
- is_true: ok
- is_true: name
- is_true: tagline
- is_true: version
- is_true: version.lucene_version
- is_true: version.number

View File

@ -1,4 +1,5 @@
---
"Ping":
- do: { ping: {}}
- do: { ping: {}}
- is_true: ''

View File

@ -17,7 +17,7 @@
id: 1
- match: { _source.foo: baz }
- not_ok: _source.count
- is_false: _source.count
- do:

View File

@ -1,5 +1,6 @@
---
"Internal version":
- skip:
version: "0 - 0.90.9"
reason: "Versions not supported by update API before 1.0.0"

View File

@ -1,5 +1,6 @@
---
"External version":
- skip:
version: "0 - 0.90.9"
reason: "Versions not supported by update API before 1.0.0"

View File

@ -1,5 +1,6 @@
---
"Routing":
- do:
update:
index: test_1

View File

@ -1,5 +1,6 @@
---
"Parent with routing":
- do:
indices.create:
index: test_1

View File

@ -1,5 +1,6 @@
---
"Refresh":
- do:
indices.create:
index: test_1

View File

@ -1,5 +1,6 @@
---
"Timestamp":
- do:
indices.create:
index: test_1
@ -29,7 +30,8 @@
type: test
id: 1
fields: _timestamp
- ok: fields._timestamp
- is_true: fields._timestamp
# milliseconds since epoch
@ -49,6 +51,7 @@
type: test
id: 1
fields: _timestamp
- match: { fields._timestamp: 1372011280000 }
# date format
@ -69,5 +72,6 @@
type: test
id: 1
fields: _timestamp
- match: { fields._timestamp: 1372011280000 }

View File

@ -1,5 +1,6 @@
---
"TTL":
- do:
indices.create:
index: test_1
@ -30,6 +31,7 @@
type: test
id: 1
fields: _ttl
- lt: { fields._ttl: 10000}
- gt: { fields._ttl: 0}
@ -44,12 +46,14 @@
doc: { foo: baz }
upsert: { foo: bar }
ttl: 100000
- do:
get:
index: test_1
type: test
id: 1
fields: _ttl
- lt: { fields._ttl: 100000}
- gt: { fields._ttl: 10000}
@ -71,6 +75,7 @@
type: test
id: 1
fields: _ttl
- lt: { fields._ttl: 20000}
- gt: { fields._ttl: 10000}

View File

@ -11,9 +11,9 @@
doc: { foo: baz }
upsert: { foo: bar }
- match: { get._source.foo: bar }
- match: { get.fields.foo: bar }
- not_ok: get.fields.bar
- match: { get._source.foo: bar }
- match: { get.fields.foo: bar }
- is_false: get.fields.bar
#### ADD _routing etc

View File

@ -35,10 +35,10 @@
doc: { foo: baz }
upsert: { foo: bar }
- match: { get.fields._parent: 5 }
- match: { get.fields._routing: 5 }
- ok: get.fields._timestamp
- ok: get.fields._ttl
- match: { get.fields._parent: 5 }
- match: { get.fields._routing: 5 }
- is_true: get.fields._timestamp
- is_true: get.fields._ttl
- do:
get: