From ec3b11d8025c8f5d5769068eeedbe034a4550866 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Fri, 1 Jul 2016 20:00:12 +0200 Subject: [PATCH] Watcher: Changed check for `_status.version` in the REST tests The check is failing, because even when the document is deleted before the test, the version of the document in Elasticsearch sticks around for a while. I have changed the test to use the `is_true` operator to check for the presence of the field only. Original commit: elastic/x-pack-elasticsearch@308ffe34f093d5a338ed8f901481897716a79cd0 --- .../rest-api-spec/test/xpack/watcher/get_watch/10_basic.yaml | 4 ++-- .../xpack/watcher/put_watch/40_put_watch_as_inactive.yaml | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/elasticsearch/x-pack/watcher/src/test/resources/rest-api-spec/test/xpack/watcher/get_watch/10_basic.yaml b/elasticsearch/x-pack/watcher/src/test/resources/rest-api-spec/test/xpack/watcher/get_watch/10_basic.yaml index faa96303041..6fe44ebf0b3 100644 --- a/elasticsearch/x-pack/watcher/src/test/resources/rest-api-spec/test/xpack/watcher/get_watch/10_basic.yaml +++ b/elasticsearch/x-pack/watcher/src/test/resources/rest-api-spec/test/xpack/watcher/get_watch/10_basic.yaml @@ -7,7 +7,7 @@ - do: xpack.watcher.put_watch: id: "my_watch" - body: > + body: > { "trigger": { "schedule": { @@ -43,5 +43,5 @@ id: "my_watch" - match: { found : true} - match: { _id: "my_watch" } - - match: { _status.version: 1 } + - is_true: _status.version - is_false: watch.status diff --git a/elasticsearch/x-pack/watcher/src/test/resources/rest-api-spec/test/xpack/watcher/put_watch/40_put_watch_as_inactive.yaml b/elasticsearch/x-pack/watcher/src/test/resources/rest-api-spec/test/xpack/watcher/put_watch/40_put_watch_as_inactive.yaml index 2a533f3320b..3aabc40a967 100644 --- a/elasticsearch/x-pack/watcher/src/test/resources/rest-api-spec/test/xpack/watcher/put_watch/40_put_watch_as_inactive.yaml +++ b/elasticsearch/x-pack/watcher/src/test/resources/rest-api-spec/test/xpack/watcher/put_watch/40_put_watch_as_inactive.yaml @@ -45,5 +45,4 @@ - match: { found : true } - match: { _id: "my_watch" } - - match: { _status.version: 1 } - match: { _status.state.active: false }