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. 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` The specified key exists and has a true value (ie not `0`, `false`, `undefined`, `null`
or the empty string), eg: 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`, The specified key doesn't exist or has a false value (ie `0`, `false`, `undefined`,
`null` or the empty string), eg: `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` === `match`

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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