diff --git a/modules/ingest-common/src/yamlRestTest/resources/rest-api-spec/test/ingest/270_set_processor.yml b/modules/ingest-common/src/yamlRestTest/resources/rest-api-spec/test/ingest/270_set_processor.yml index 1af0289bb0584..0934b69692af2 100644 --- a/modules/ingest-common/src/yamlRestTest/resources/rest-api-spec/test/ingest/270_set_processor.yml +++ b/modules/ingest-common/src/yamlRestTest/resources/rest-api-spec/test/ingest/270_set_processor.yml @@ -1,69 +1,9 @@ -setup: - - do: - ingest.put_pipeline: - id: "pipeline1" - body: > - { - "description": "_description", - "processors": [ - { - "set" : { - "field" : "_op_type", - "value": "create" - } - } - ] - } - - do: - ingest.put_pipeline: - id: "pipeline2" - body: > - { - "description": "_description", - "processors": [ - { - "set" : { - "field" : "_op_type", - "value": "invalidOpType" - } - } - ] - } - - do: - indices.put_index_template: - name: test_index_template_for_data_stream - body: - index_patterns: test_data_stream1* - data_stream: {} - template: - settings: - number_of_shards: 1 - number_of_replicas: 0 - - do: - indices.create_data_stream: - name: test_data_stream1 --- teardown: - do: ingest.delete_pipeline: id: "1" ignore: 404 - - do: - ingest.delete_pipeline: - id: "pipeline1" - ignore: 404 - - do: - ingest.delete_pipeline: - id: "pipeline2" - ignore: 404 - - do: - indices.delete_index_template: - name: test_index_template_for_data_stream - ignore: 404 - - do: - indices.delete: - name: test_data_stream1 - ignore: 404 --- "Test set processor with template value": @@ -168,6 +108,52 @@ teardown: version: " - 2.99.99" reason: "introduced in 3.0.0" + - do: + ingest.put_pipeline: + id: "pipeline1" + body: > + { + "description": "_description", + "processors": [ + { + "set" : { + "field" : "_op_type", + "value": "create" + } + } + ] + } + + - do: + ingest.put_pipeline: + id: "pipeline2" + body: > + { + "description": "_description", + "processors": [ + { + "set" : { + "field" : "_op_type", + "value": "invalidOpType" + } + } + ] + } + + - do: + indices.put_index_template: + name: test_index_template_for_data_stream + body: + index_patterns: test_data_stream1* + data_stream: {} + template: + settings: + number_of_shards: 1 + number_of_replicas: 0 + - do: + indices.create_data_stream: + name: test_data_stream1 + - do: index: index: test_data_stream1 @@ -178,18 +164,27 @@ teardown: - match: { result: "created" } - do: - get: - index: test_data_stream1 - id: 1 - - match: { _source: {"foo": "bar", "@timestamp": "2099-03-08T11:04:05.000Z"} } - - - do: + catch: /illegal_argument_exception/ index: index: test_data_stream1 id: 1 op_type: index pipeline: pipeline2 body: { "foo": "bar", "@timestamp": "2099-03-08T11:04:05.000Z" } - - match: { items.0.status: 400 } - - match: { items.0.error.type: "illegal_argument_exception" } - - match: { items.0.error.reason: "opType must be 'create' or 'index', found: [invalidOpType]" } + + - do: + ingest.delete_pipeline: + id: "pipeline1" + ignore: 404 + - do: + ingest.delete_pipeline: + id: "pipeline2" + ignore: 404 + - do: + indices.delete_data_stream: + name: test_data_stream1 + ignore: 404 + - do: + indices.delete_index_template: + name: test_index_template_for_data_stream + ignore: 404 diff --git a/modules/ingest-common/src/yamlRestTest/resources/rest-api-spec/test/ingest/70_bulk.yml b/modules/ingest-common/src/yamlRestTest/resources/rest-api-spec/test/ingest/70_bulk.yml index a95368f8b28f3..bb2208dadd93a 100644 --- a/modules/ingest-common/src/yamlRestTest/resources/rest-api-spec/test/ingest/70_bulk.yml +++ b/modules/ingest-common/src/yamlRestTest/resources/rest-api-spec/test/ingest/70_bulk.yml @@ -30,34 +30,6 @@ setup: } ] } - - do: - ingest.put_pipeline: - id: "pipeline3" - body: > - { - "description": "_description", - "processors": [ - { - "set" : { - "field" : "_op_type", - "value": "create" - } - } - ] - } - - do: - indices.put_index_template: - name: test_index_template_for_data_stream - body: - index_patterns: test_data_stream1* - data_stream: {} - template: - settings: - number_of_shards: 1 - number_of_replicas: 0 - - do: - indices.create_data_stream: - name: test_data_stream1 --- teardown: - do: @@ -68,22 +40,6 @@ teardown: ingest.delete_pipeline: id: "pipeline2" ignore: 404 - - do: - ingest.delete_pipeline: - id: "pipeline3" - ignore: 404 - - do: - indices.delete_index_template: - name: test_index_template_for_bulk - ignore: 404 - - do: - indices.delete_index_template: - name: test_index_template_for_data_stream - ignore: 404 - - do: - indices.delete: - name: test_data_stream1 - ignore: 404 --- "Test bulk request without default pipeline": @@ -307,6 +263,35 @@ teardown: version: " - 2.99.99" reason: "introduced in 3.0.0" + - do: + ingest.put_pipeline: + id: "pipeline3" + body: > + { + "description": "_description", + "processors": [ + { + "set" : { + "field" : "_op_type", + "value": "create" + } + } + ] + } + - do: + indices.put_index_template: + name: test_index_template_for_data_stream + body: + index_patterns: test_data_stream1* + data_stream: {} + template: + settings: + number_of_shards: 1 + number_of_replicas: 0 + - do: + indices.create_data_stream: + name: test_data_stream1 + - do: bulk: refresh: true @@ -317,13 +302,14 @@ teardown: - match: { items.0.create.result: created } - do: - search: - index: test_data_stream1 - body: { - query: { - match_all: {} - } - } - - - length: { hits.hits: 1 } - - match: { hits.hits.0._source: {"foo": "bar", "@timestamp": "2099-03-08T11:04:05.000Z"} } + ingest.delete_pipeline: + id: "pipeline3" + ignore: 404 + - do: + indices.delete_data_stream: + name: test_data_stream1 + ignore: 404 + - do: + indices.delete_index_template: + name: test_index_template_for_data_stream + ignore: 404