From a6e1655fe9eb1b3c98f8bc2f4a06e95b7bcad837 Mon Sep 17 00:00:00 2001 From: Robert Muir Date: Wed, 9 Dec 2015 00:30:13 -0500 Subject: [PATCH] fix integ tests --- .../test/lang_mustache/10_basic.yaml | 57 +++++++++++++++++++ .../test/lang_mustache}/20_search.yaml | 0 .../30_render_search_template.yaml | 0 .../30_template_query_execution.yaml | 0 .../40_search_request_template.yaml | 0 .../test/lang_mustache/50_msearch.yaml | 1 + .../rest-api-spec/test/template/10_basic.yaml | 56 ------------------ 7 files changed, 58 insertions(+), 56 deletions(-) rename {rest-api-spec/src/main/resources/rest-api-spec/test/template => modules/lang-mustache/src/test/resources/rest-api-spec/test/lang_mustache}/20_search.yaml (100%) rename {rest-api-spec/src/main/resources/rest-api-spec/test/template => modules/lang-mustache/src/test/resources/rest-api-spec/test/lang_mustache}/30_render_search_template.yaml (100%) rename {rest-api-spec/src/main/resources/rest-api-spec/test/search => modules/lang-mustache/src/test/resources/rest-api-spec/test/lang_mustache}/30_template_query_execution.yaml (100%) rename {rest-api-spec/src/main/resources/rest-api-spec/test/search => modules/lang-mustache/src/test/resources/rest-api-spec/test/lang_mustache}/40_search_request_template.yaml (100%) rename rest-api-spec/src/main/resources/rest-api-spec/test/msearch/10_basic.yaml => modules/lang-mustache/src/test/resources/rest-api-spec/test/lang_mustache/50_msearch.yaml (99%) delete mode 100644 rest-api-spec/src/main/resources/rest-api-spec/test/template/10_basic.yaml diff --git a/modules/lang-mustache/src/test/resources/rest-api-spec/test/lang_mustache/10_basic.yaml b/modules/lang-mustache/src/test/resources/rest-api-spec/test/lang_mustache/10_basic.yaml index 70a9693f594..9bfea28abfa 100644 --- a/modules/lang-mustache/src/test/resources/rest-api-spec/test/lang_mustache/10_basic.yaml +++ b/modules/lang-mustache/src/test/resources/rest-api-spec/test/lang_mustache/10_basic.yaml @@ -12,3 +12,60 @@ - match: { nodes.$master.modules.0.name: lang-mustache } - match: { nodes.$master.modules.0.jvm: true } + +--- +"Indexed template": + + - do: + put_template: + id: "1" + body: { "template": { "query": { "match_all": {}}, "size": "{{my_size}}" } } + - match: { _id: "1" } + + - do: + get_template: + id: 1 + - match: { found: true } + - match: { lang: mustache } + - match: { _id: "1" } + - match: { _version: 1 } + - match: { template: /.*query\S\S\S\Smatch_all.*/ } + + - do: + catch: missing + get_template: + id: 2 + - match: { found: false } + - match: { lang: mustache } + - match: { _id: "2" } + - is_false: _version + - is_false: template + + - do: + delete_template: + id: "1" + - match: { found: true } + - match: { _index: ".scripts" } + - match: { _id: "1" } + - match: { _version: 2} + + - do: + catch: missing + delete_template: + id: "non_existing" + - match: { found: false } + - match: { _index: ".scripts" } + - match: { _id: "non_existing" } + - match: { _version: 1 } + + - do: + catch: request + put_template: + id: "1" + body: { "template": { "query": { "match{{}}_all": {}}, "size": "{{my_size}}" } } + + - do: + catch: /Unable\sto\sparse.*/ + put_template: + id: "1" + body: { "template": { "query": { "match{{}}_all": {}}, "size": "{{my_size}}" } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/template/20_search.yaml b/modules/lang-mustache/src/test/resources/rest-api-spec/test/lang_mustache/20_search.yaml similarity index 100% rename from rest-api-spec/src/main/resources/rest-api-spec/test/template/20_search.yaml rename to modules/lang-mustache/src/test/resources/rest-api-spec/test/lang_mustache/20_search.yaml diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/template/30_render_search_template.yaml b/modules/lang-mustache/src/test/resources/rest-api-spec/test/lang_mustache/30_render_search_template.yaml similarity index 100% rename from rest-api-spec/src/main/resources/rest-api-spec/test/template/30_render_search_template.yaml rename to modules/lang-mustache/src/test/resources/rest-api-spec/test/lang_mustache/30_render_search_template.yaml diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/search/30_template_query_execution.yaml b/modules/lang-mustache/src/test/resources/rest-api-spec/test/lang_mustache/30_template_query_execution.yaml similarity index 100% rename from rest-api-spec/src/main/resources/rest-api-spec/test/search/30_template_query_execution.yaml rename to modules/lang-mustache/src/test/resources/rest-api-spec/test/lang_mustache/30_template_query_execution.yaml diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/search/40_search_request_template.yaml b/modules/lang-mustache/src/test/resources/rest-api-spec/test/lang_mustache/40_search_request_template.yaml similarity index 100% rename from rest-api-spec/src/main/resources/rest-api-spec/test/search/40_search_request_template.yaml rename to modules/lang-mustache/src/test/resources/rest-api-spec/test/lang_mustache/40_search_request_template.yaml diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/msearch/10_basic.yaml b/modules/lang-mustache/src/test/resources/rest-api-spec/test/lang_mustache/50_msearch.yaml similarity index 99% rename from rest-api-spec/src/main/resources/rest-api-spec/test/msearch/10_basic.yaml rename to modules/lang-mustache/src/test/resources/rest-api-spec/test/lang_mustache/50_msearch.yaml index 49e34fb16cd..205070be13e 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/msearch/10_basic.yaml +++ b/modules/lang-mustache/src/test/resources/rest-api-spec/test/lang_mustache/50_msearch.yaml @@ -51,3 +51,4 @@ - query: { "template": { "query": { "term": { "foo": { "value": "{{template}}" } } }, "params": { "template": "bar" } } } - match: { responses.0.hits.total: 1 } + diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/template/10_basic.yaml b/rest-api-spec/src/main/resources/rest-api-spec/test/template/10_basic.yaml deleted file mode 100644 index bd1fd436648..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/template/10_basic.yaml +++ /dev/null @@ -1,56 +0,0 @@ ---- -"Indexed template": - - - do: - put_template: - id: "1" - body: { "template": { "query": { "match_all": {}}, "size": "{{my_size}}" } } - - match: { _id: "1" } - - - do: - get_template: - id: 1 - - match: { found: true } - - match: { lang: mustache } - - match: { _id: "1" } - - match: { _version: 1 } - - match: { template: /.*query\S\S\S\Smatch_all.*/ } - - - do: - catch: missing - get_template: - id: 2 - - match: { found: false } - - match: { lang: mustache } - - match: { _id: "2" } - - is_false: _version - - is_false: template - - - do: - delete_template: - id: "1" - - match: { found: true } - - match: { _index: ".scripts" } - - match: { _id: "1" } - - match: { _version: 2} - - - do: - catch: missing - delete_template: - id: "non_existing" - - match: { found: false } - - match: { _index: ".scripts" } - - match: { _id: "non_existing" } - - match: { _version: 1 } - - - do: - catch: request - put_template: - id: "1" - body: { "template": { "query": { "match{{}}_all": {}}, "size": "{{my_size}}" } } - - - do: - catch: /Unable\sto\sparse.*/ - put_template: - id: "1" - body: { "template": { "query": { "match{{}}_all": {}}, "size": "{{my_size}}" } }