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" } - match: { jobs.0.state: "closed" }
- do: - do:
get: get:
index: .ml-anomalies-farequote index: .ml-anomalies-farequote
type: data_counts type: data_counts
id: farequote-data-counts id: farequote-data-counts
- match: { _source.processed_record_count: 2 } - match: { _source.processed_record_count: 2 }
- match: { _source.processed_field_count: 4} - match: { _source.processed_field_count: 4}

View File

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

View File

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