Fix indentation in some yaml tests (elastic/x-pack-elasticsearch#686)

The yaml test runner now throws error when skip or do sections are malformed, such as they don't start with the proper token (START_OBJECT). That signals bad indentation, which was previously ignored. Thanks (or due to) our pull parsing code, we were still able to properly parse the sections, yet other runners weren't able to.

Original commit: elastic/x-pack-elasticsearch@920201207c
This commit is contained in:
Luca Cavanna 2017-03-02 12:43:43 +01:00 committed by GitHub
parent 0f5bfca69a
commit 70a4a69e39
3 changed files with 44 additions and 44 deletions

View File

@ -77,10 +77,10 @@ setup:
- match: { jobs.0.state: "closed" }
- do:
get:
index: .ml-anomalies-farequote
type: data_counts
id: farequote-data-counts
get:
index: .ml-anomalies-farequote
type: data_counts
id: farequote-data-counts
- match: { _source.processed_record_count: 2 }
- match: { _source.processed_field_count: 4}

View File

@ -6,19 +6,19 @@
features: warnings
- do:
cluster.health:
wait_for_status: yellow
cluster.health:
wait_for_status: yellow
- do:
put_script:
lang: transform-script
body: >
{
"script":{
"lang": "painless",
"code":"return [ 'email': 'foo@bar.org' ]"
put_script:
lang: transform-script
body: >
{
"script":{
"lang": "painless",
"code":"return [ 'email': 'foo@bar.org' ]"
}
}
}
- do:
xpack.watcher.put_watch:
@ -57,16 +57,16 @@
- match: { "watch_record.result.transform.payload.email": "foo@bar.org" }
- do:
put_script:
lang: transform-script
body: >
{
"script":
put_script:
lang: transform-script
body: >
{
"lang": "painless",
"code":"return [ 'email': 'foo@example.org' ]"
"script":
{
"lang": "painless",
"code":"return [ 'email': 'foo@example.org' ]"
}
}
}
- do:
xpack.watcher.execute_watch:
@ -81,20 +81,20 @@
features: warnings
- do:
cluster.health:
wait_for_status: yellow
cluster.health:
wait_for_status: yellow
- do:
put_script:
lang: condition-script
body: >
{
"script":
put_script:
lang: condition-script
body: >
{
"lang": "painless",
"code": "return false"
"script":
{
"lang": "painless",
"code": "return false"
}
}
}
- do:
xpack.watcher.put_watch:
@ -133,15 +133,15 @@
- match: { "watch_record.result.condition.met": false }
- do:
put_script:
lang: condition-script
body: >
{
"script": {
"lang": "painless",
"code": "return true"
put_script:
lang: condition-script
body: >
{
"script": {
"lang": "painless",
"code": "return true"
}
}
}
- do:
xpack.watcher.execute_watch:

View File

@ -1,12 +1,12 @@
---
"Test watcher is protected by security":
- do:
headers: { es-security-runas-user: powerless_user }
catch: forbidden
xpack.watcher.stats: {}
headers: { es-security-runas-user: powerless_user }
catch: forbidden
xpack.watcher.stats: {}
# there seems to be a bug in the yaml parser we use, where a single element list
# has the END_LIST token skipped...so here we just rerun the same request without
# the impersonation to show it works
- do:
xpack.watcher.stats: {}
xpack.watcher.stats: {}
- match: { watcher_state: started }