From 82066cfc83f04ac687bc0f9df188b69012210a67 Mon Sep 17 00:00:00 2001 From: Julie Tibshirani Date: Sun, 3 Feb 2019 13:50:56 -0800 Subject: [PATCH] Fix some REST tests. --- .../test/painless/80_script_score.yml | 36 +++++----- .../test/update_by_query/20_validation.yml | 5 +- .../rest-api-spec/test/rollup/delete_job.yml | 11 ++-- .../rest-api-spec/test/rollup/get_jobs.yml | 11 ++-- .../rest-api-spec/test/rollup/put_job.yml | 11 ++-- .../test/rollup/rollup_search.yml | 65 ++++++------------- .../test/rollup/security_tests.yml | 41 +++++------- .../rest-api-spec/test/rollup/start_job.yml | 11 ++-- .../rest-api-spec/test/rollup/stop_job.yml | 11 ++-- 9 files changed, 80 insertions(+), 122 deletions(-) diff --git a/modules/lang-painless/src/test/resources/rest-api-spec/test/painless/80_script_score.yml b/modules/lang-painless/src/test/resources/rest-api-spec/test/painless/80_script_score.yml index c9b73bca029b1..a3135777c952c 100644 --- a/modules/lang-painless/src/test/resources/rest-api-spec/test/painless/80_script_score.yml +++ b/modules/lang-painless/src/test/resources/rest-api-spec/test/painless/80_script_score.yml @@ -14,26 +14,22 @@ setup: settings: number_of_shards: 2 mappings: - _doc: - properties: - dval: - type: double + properties: + dval: + type: double - do: index: index: test - type: _doc id: d1 body: {"dval": 10} - do: index: index: test - type: _doc id: d2 body: {"dval": 100} - do: index: index: test - type: _doc id: d3 body: {"dval": 1000} @@ -225,10 +221,9 @@ setup: settings: number_of_shards: 1 mappings: - _doc: - properties: - date: - type: date + properties: + date: + type: date - do: index: index: test @@ -309,16 +304,15 @@ setup: settings: number_of_shards: 1 mappings: - _doc: - properties: - ival: - type: integer - lval: - type: long - fval: - type: float - dval: - type: double + properties: + ival: + type: integer + lval: + type: long + fval: + type: float + dval: + type: double - do: index: diff --git a/modules/reindex/src/test/resources/rest-api-spec/test/update_by_query/20_validation.yml b/modules/reindex/src/test/resources/rest-api-spec/test/update_by_query/20_validation.yml index 5e750f89f12ad..b6823f88c15fc 100644 --- a/modules/reindex/src/test/resources/rest-api-spec/test/update_by_query/20_validation.yml +++ b/modules/reindex/src/test/resources/rest-api-spec/test/update_by_query/20_validation.yml @@ -44,9 +44,8 @@ index: test body: mappings: - _doc: - _source: - enabled: false + _source: + enabled: false - do: index: index: test diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/test/rollup/delete_job.yml b/x-pack/plugin/src/test/resources/rest-api-spec/test/rollup/delete_job.yml index 2208502b3e4cf..40fa404f36147 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/test/rollup/delete_job.yml +++ b/x-pack/plugin/src/test/resources/rest-api-spec/test/rollup/delete_job.yml @@ -6,12 +6,11 @@ setup: index: foo body: mappings: - _doc: - properties: - the_field: - type: date - value_field: - type: integer + properties: + the_field: + type: date + value_field: + type: integer - do: headers: diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/test/rollup/get_jobs.yml b/x-pack/plugin/src/test/resources/rest-api-spec/test/rollup/get_jobs.yml index 3e03ac924ec89..6332302e67418 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/test/rollup/get_jobs.yml +++ b/x-pack/plugin/src/test/resources/rest-api-spec/test/rollup/get_jobs.yml @@ -6,12 +6,11 @@ setup: index: foo body: mappings: - _doc: - properties: - the_field: - type: date - value_field: - type: integer + properties: + the_field: + type: date + value_field: + type: integer --- "Test basic get_jobs": diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/test/rollup/put_job.yml b/x-pack/plugin/src/test/resources/rest-api-spec/test/rollup/put_job.yml index 7f3f0347ec0df..f8cfe85cc2e6a 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/test/rollup/put_job.yml +++ b/x-pack/plugin/src/test/resources/rest-api-spec/test/rollup/put_job.yml @@ -6,12 +6,11 @@ setup: index: foo body: mappings: - _doc: - properties: - the_field: - type: date - value_field: - type: integer + properties: + the_field: + type: date + value_field: + type: integer --- "Test basic put_job": diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/test/rollup/rollup_search.yml b/x-pack/plugin/src/test/resources/rest-api-spec/test/rollup/rollup_search.yml index 0865cf084eb61..9af896f4c9fab 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/test/rollup/rollup_search.yml +++ b/x-pack/plugin/src/test/resources/rest-api-spec/test/rollup/rollup_search.yml @@ -6,14 +6,13 @@ setup: index: foo body: mappings: - _doc: - properties: - timestamp: - type: date - partition: - type: keyword - price: - type: integer + properties: + timestamp: + type: date + partition: + type: keyword + price: + type: integer - do: headers: @@ -51,7 +50,6 @@ setup: body: - index: _index: "foo_rollup" - _type: "_doc" - timestamp.date_histogram.timestamp: "2017-01-01T05:00:00Z" timestamp.date_histogram.interval: "1h" timestamp.date_histogram.time_zone: "UTC" @@ -67,7 +65,6 @@ setup: - index: _index: "foo_rollup" - _type: "_doc" - timestamp.date_histogram.timestamp: "2017-01-01T06:00:00Z" timestamp.date_histogram.interval: "1h" timestamp.date_histogram.time_zone: "UTC" @@ -83,7 +80,6 @@ setup: - index: _index: "foo_rollup" - _type: "_doc" - timestamp.date_histogram.timestamp: "2017-01-01T07:00:00Z" timestamp.date_histogram.interval: "1h" timestamp.date_histogram.time_zone: "UTC" @@ -99,7 +95,6 @@ setup: - index: _index: "foo_rollup" - _type: "_doc" - timestamp.date_histogram.timestamp: "2017-01-01T08:00:00Z" timestamp.date_histogram.interval: "1h" timestamp.date_histogram.time_zone: "UTC" @@ -115,7 +110,6 @@ setup: - index: _index: "foo_rollup" - _type: "_doc" - timestamp.date_histogram.timestamp: "2017-01-01T08:00:00Z" timestamp.date_histogram.interval: "1h" timestamp.date_histogram.time_zone: "UTC" @@ -319,7 +313,6 @@ setup: body: - index: _index: "foo_rollup" - _type: "_doc" - timestamp.date_histogram.timestamp: "2017-01-01T05:00:00Z" timestamp.date_histogram.interval: "1h" timestamp.date_histogram.time_zone: "UTC" @@ -335,7 +328,6 @@ setup: - index: _index: "foo_rollup" - _type: "_doc" - timestamp.date_histogram.timestamp: "2017-01-01T06:00:00Z" timestamp.date_histogram.interval: "1h" timestamp.date_histogram.time_zone: "UTC" @@ -351,7 +343,6 @@ setup: - index: _index: "foo_rollup" - _type: "_doc" - timestamp.date_histogram.timestamp: "2017-01-01T07:00:00Z" timestamp.date_histogram.interval: "1h" timestamp.date_histogram.time_zone: "UTC" @@ -367,7 +358,6 @@ setup: - index: _index: "foo_rollup" - _type: "_doc" - timestamp.date_histogram.timestamp: "2017-01-01T08:00:00Z" timestamp.date_histogram.interval: "1h" timestamp.date_histogram.time_zone: "UTC" @@ -383,7 +373,6 @@ setup: - index: _index: "foo_rollup" - _type: "_doc" - timestamp.date_histogram.timestamp: "2017-01-01T08:00:00Z" timestamp.date_histogram.interval: "1h" timestamp.date_histogram.time_zone: "UTC" @@ -467,7 +456,6 @@ setup: body: - index: _index: "foo_rollup" - _type: "_doc" - timestamp.date_histogram.timestamp: "2017-01-01T05:00:00Z" timestamp.date_histogram.interval: "1h" timestamp.date_histogram.time_zone: "UTC" @@ -483,7 +471,6 @@ setup: - index: _index: "foo_rollup" - _type: "_doc" - timestamp.date_histogram.timestamp: "2017-01-01T06:00:00Z" timestamp.date_histogram.interval: "1h" timestamp.date_histogram.time_zone: "UTC" @@ -499,7 +486,6 @@ setup: - index: _index: "foo_rollup" - _type: "_doc" - timestamp.date_histogram.timestamp: "2017-01-01T07:00:00Z" timestamp.date_histogram.interval: "1h" timestamp.date_histogram.time_zone: "UTC" @@ -515,7 +501,6 @@ setup: - index: _index: "foo_rollup" - _type: "_doc" - timestamp.date_histogram.timestamp: "2017-01-01T08:00:00Z" timestamp.date_histogram.interval: "1h" timestamp.date_histogram.time_zone: "UTC" @@ -531,7 +516,6 @@ setup: - index: _index: "foo_rollup" - _type: "_doc" - timestamp.date_histogram.timestamp: "2017-01-01T08:00:00Z" timestamp.date_histogram.interval: "1h" timestamp.date_histogram.time_zone: "UTC" @@ -617,7 +601,6 @@ setup: body: - index: _index: "foo_rollup" - _type: "_doc" - timestamp.date_histogram.timestamp: "2017-01-01T05:00:00Z" timestamp.date_histogram.interval: "1h" timestamp.date_histogram.time_zone: "UTC" @@ -633,7 +616,6 @@ setup: - index: _index: "foo_rollup" - _type: "_doc" - timestamp.date_histogram.timestamp: "2017-01-01T06:00:00Z" timestamp.date_histogram.interval: "1h" timestamp.date_histogram.time_zone: "UTC" @@ -649,7 +631,6 @@ setup: - index: _index: "foo_rollup" - _type: "_doc" - timestamp.date_histogram.timestamp: "2017-01-01T07:00:00Z" timestamp.date_histogram.interval: "1h" timestamp.date_histogram.time_zone: "UTC" @@ -665,7 +646,6 @@ setup: - index: _index: "foo_rollup" - _type: "_doc" - timestamp.date_histogram.timestamp: "2017-01-01T08:00:00Z" timestamp.date_histogram.interval: "1h" timestamp.date_histogram.time_zone: "UTC" @@ -681,7 +661,6 @@ setup: - index: _index: "foo_rollup" - _type: "_doc" - timestamp.date_histogram.timestamp: "2017-01-01T08:00:00Z" timestamp.date_histogram.interval: "1h" timestamp.date_histogram.time_zone: "UTC" @@ -760,14 +739,13 @@ setup: index: bar body: mappings: - _doc: - properties: - timestamp: - type: date - partition: - type: keyword - price: - type: integer + properties: + timestamp: + type: date + partition: + type: keyword + price: + type: integer - do: headers: @@ -849,14 +827,13 @@ setup: index: bar body: mappings: - _doc: - properties: - timestamp: - type: date - partition: - type: keyword - price: - type: integer + properties: + timestamp: + type: date + partition: + type: keyword + price: + type: integer - do: headers: diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/test/rollup/security_tests.yml b/x-pack/plugin/src/test/resources/rest-api-spec/test/rollup/security_tests.yml index c42ab9d06f6ce..5a53847187484 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/test/rollup/security_tests.yml +++ b/x-pack/plugin/src/test/resources/rest-api-spec/test/rollup/security_tests.yml @@ -48,18 +48,16 @@ teardown: index: foo body: mappings: - _doc: - properties: - timestamp: - type: date - value_field: - type: integer + properties: + timestamp: + type: date + value_field: + type: integer - do: headers: Authorization: "Basic eF9wYWNrX3Jlc3RfdXNlcjp4LXBhY2stdGVzdC1wYXNzd29yZA==" # run as x_pack_rest_user, i.e. the test setup superuser index: index: foo - type: _doc body: timestamp: 123 value_field: 1232 @@ -69,18 +67,16 @@ teardown: index: foobar body: mappings: - _doc: - properties: - timestamp: - type: date - value_field: - type: integer + properties: + timestamp: + type: date + value_field: + type: integer - do: headers: Authorization: "Basic eF9wYWNrX3Jlc3RfdXNlcjp4LXBhY2stdGVzdC1wYXNzd29yZA==" # run as x_pack_rest_user, i.e. the test setup superuser index: index: foobar - type: _doc body: timestamp: 123 value_field: 456 @@ -220,20 +216,18 @@ teardown: index: foo body: mappings: - _doc: - properties: - timestamp: - type: date - value_field: - type: integer - visibility: - type: keyword + properties: + timestamp: + type: date + value_field: + type: integer + visibility: + type: keyword - do: headers: Authorization: "Basic eF9wYWNrX3Jlc3RfdXNlcjp4LXBhY2stdGVzdC1wYXNzd29yZA==" # run as x_pack_rest_user, i.e. the test setup superuser index: index: foo - type: _doc body: timestamp: 123 value_field: 1232 @@ -243,7 +237,6 @@ teardown: Authorization: "Basic eF9wYWNrX3Jlc3RfdXNlcjp4LXBhY2stdGVzdC1wYXNzd29yZA==" # run as x_pack_rest_user, i.e. the test setup superuser index: index: foobar - type: _doc body: timestamp: 123 value_field: 456 diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/test/rollup/start_job.yml b/x-pack/plugin/src/test/resources/rest-api-spec/test/rollup/start_job.yml index 0ed11ab1b04a0..88619e0dfc8ee 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/test/rollup/start_job.yml +++ b/x-pack/plugin/src/test/resources/rest-api-spec/test/rollup/start_job.yml @@ -6,12 +6,11 @@ setup: index: foo body: mappings: - _doc: - properties: - the_field: - type: date - value_field: - type: integer + properties: + the_field: + type: date + value_field: + type: integer - do: headers: diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/test/rollup/stop_job.yml b/x-pack/plugin/src/test/resources/rest-api-spec/test/rollup/stop_job.yml index c19325bf707de..bcb592be7a074 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/test/rollup/stop_job.yml +++ b/x-pack/plugin/src/test/resources/rest-api-spec/test/rollup/stop_job.yml @@ -6,12 +6,11 @@ setup: index: foo body: mappings: - _doc: - properties: - the_field: - type: date - value_field: - type: integer + properties: + the_field: + type: date + value_field: + type: integer - do: headers: