@@ -559,11 +559,15 @@ teardown:
559559 - match : { docs.0.processor_results.0.tag: "setstatus-1" }
560560 - match : { docs.0.processor_results.0.doc._source.field1: "123.42 400 <foo>" }
561561 - match : { docs.0.processor_results.0.doc._source.status: 200 }
562+ - match : { docs.0.processor_results.0.status: "success" }
563+ - match : { docs.0.processor_results.0.processor_type: "set" }
562564 - match : { docs.0.processor_results.1.tag: "rename-1" }
563565 - match : { docs.0.processor_results.1.ignored_error.error.type: "illegal_argument_exception" }
564566 - match : { docs.0.processor_results.1.ignored_error.error.reason: "field [foofield] doesn't exist" }
565567 - match : { docs.0.processor_results.1.doc._source.field1: "123.42 400 <foo>" }
566568 - match : { docs.0.processor_results.1.doc._source.status: 200 }
569+ - match : { docs.0.processor_results.1.status: "error_ignored" }
570+ - match : { docs.0.processor_results.1.processor_type: "rename" }
567571
568572---
569573" Test verbose simulate with ignore_failure and no exception thrown " :
@@ -605,11 +609,16 @@ teardown:
605609 }
606610 - length : { docs: 1 }
607611 - length : { docs.0.processor_results: 2 }
612+ - length : { docs.0.processor_results.0: 4 }
608613 - match : { docs.0.processor_results.0.tag: "setstatus-1" }
614+ - match : { docs.0.processor_results.0.status: "success" }
615+ - match : { docs.0.processor_results.0.processor_type: "set" }
609616 - match : { docs.0.processor_results.0.doc._source.field1: "123.42 400 <foo>" }
610617 - match : { docs.0.processor_results.0.doc._source.status: 200 }
611- - length : { docs.0.processor_results.1: 2 }
618+ - length : { docs.0.processor_results.1: 4 }
612619 - match : { docs.0.processor_results.1.tag: "rename-1" }
620+ - match : { docs.0.processor_results.1.status: "success" }
621+ - match : { docs.0.processor_results.1.processor_type: "rename" }
613622 - match : { docs.0.processor_results.1.doc._source.new_status: 200 }
614623
615624---
@@ -725,7 +734,8 @@ teardown:
725734 {
726735 "set": {
727736 "field": "pipeline0",
728- "value": true
737+ "value": true,
738+ "description" : "first_set"
729739 }
730740 },
731741 {
@@ -747,16 +757,25 @@ teardown:
747757 ]
748758 }
749759 - length : { docs: 1 }
750- - length : { docs.0.processor_results: 3 }
760+ - length : { docs.0.processor_results: 5 }
751761- match : { docs.0.processor_results.0.doc._source.pipeline0: true }
762+ - match : { docs.0.processor_results.0.status: "success" }
763+ - match : { docs.0.processor_results.0.processor_type: "set" }
764+ - match : { docs.0.processor_results.0.description: "first_set" }
752765- is_false : docs.0.processor_results.0.doc._source.pipeline1
753766- is_false : docs.0.processor_results.0.doc._source.pipeline2
754- - match : { docs.0.processor_results.1.doc._source.pipeline0: true }
755- - match : { docs.0.processor_results.1.doc._source.pipeline1: true }
756- - is_false : docs.0.processor_results.1.doc._source.pipeline2
767+ - match : { docs.0.processor_results.1.doc: null }
768+ - match : { docs.0.processor_results.1.status: "success" }
769+ - match : { docs.0.processor_results.1.processor_type: "pipeline" }
757770- match : { docs.0.processor_results.2.doc._source.pipeline0: true }
758771- match : { docs.0.processor_results.2.doc._source.pipeline1: true }
759- - match : { docs.0.processor_results.2.doc._source.pipeline2: true }
772+ - is_false : docs.0.processor_results.2.doc._source.pipeline2
773+ - match : { docs.0.processor_results.3.doc: null }
774+ - match : { docs.0.processor_results.3.status: "success" }
775+ - match : { docs.0.processor_results.3.processor_type: "pipeline" }
776+ - match : { docs.0.processor_results.4.doc._source.pipeline0: true }
777+ - match : { docs.0.processor_results.4.doc._source.pipeline1: true }
778+ - match : { docs.0.processor_results.4.doc._source.pipeline2: true }
760779
761780---
762781" Test verbose simulate with true conditional and on failure " :
@@ -817,19 +836,27 @@ teardown:
817836- length : { docs.0.processor_results: 4 }
818837- match : { docs.0.processor_results.0.tag: "gunna_fail" }
819838- match : { docs.0.processor_results.0.error.reason: "field [foo1] doesn't exist" }
839+ - match : { docs.0.processor_results.0.status: "error" }
840+ - match : { docs.0.processor_results.0.processor_type: "rename" }
820841- match : { docs.0.processor_results.1.tag: "failed1" }
821842- match : { docs.0.processor_results.1.doc._source.failed1: "failed1" }
822843- match : { docs.0.processor_results.1.doc._ingest.on_failure_processor_tag: "gunna_fail" }
844+ - match : { docs.0.processor_results.1.status: "success" }
845+ - match : { docs.0.processor_results.1.processor_type: "set" }
823846- match : { docs.0.processor_results.2.tag: "gunna_fail_again" }
824847- match : { docs.0.processor_results.2.error.reason: "field [foo2] doesn't exist" }
848+ - match : { docs.0.processor_results.2.status: "error" }
849+ - match : { docs.0.processor_results.2.processor_type: "rename" }
825850- match : { docs.0.processor_results.3.tag: "failed2" }
826851- match : { docs.0.processor_results.3.doc._source.failed1: "failed1" }
827852- match : { docs.0.processor_results.3.doc._source.failed2: "failed2" }
828853- match : { docs.0.processor_results.3.doc._ingest.on_failure_processor_tag: "gunna_fail_again" }
854+ - match : { docs.0.processor_results.3.status: "success" }
855+ - match : { docs.0.processor_results.3.processor_type: "set" }
829856
830857
831858---
832- " Test simulate with provided pipeline definition with tag and description in processors " :
859+ " Test simulate with pipeline with conditional and skipped and dropped " :
833860 - do :
834861 ingest.simulate :
835862 verbose : true
@@ -845,6 +872,16 @@ teardown:
845872 "field" : "field2",
846873 "value" : "_value"
847874 }
875+ },
876+ {
877+ "drop" : {
878+ "if": "false"
879+ }
880+ },
881+ {
882+ "drop" : {
883+ "if": "true"
884+ }
848885 }
849886 ]
850887 },
@@ -859,7 +896,43 @@ teardown:
859896 ]
860897 }
861898 - length : { docs: 1 }
862- - length : { docs.0.processor_results: 1 }
899+ - length : { docs.0.processor_results: 3 }
863900 - match : { docs.0.processor_results.0.doc._source.field2: "_value" }
864901 - match : { docs.0.processor_results.0.description: "processor_description" }
865902 - match : { docs.0.processor_results.0.tag: "processor_tag" }
903+ - match : { docs.0.processor_results.0.status: "success" }
904+ - match : { docs.0.processor_results.0.processor_type: "set" }
905+ - match : { docs.0.processor_results.1.status: "skipped" }
906+ - match : { docs.0.processor_results.1.processor_type: "drop" }
907+ - match : { docs.0.processor_results.1.if.condition: "false" }
908+ - match : { docs.0.processor_results.1.if.result: false }
909+ - match : { docs.0.processor_results.2.status: "dropped" }
910+ - match : { docs.0.processor_results.2.processor_type: "drop" }
911+ - match : { docs.0.processor_results.2.if.condition: "true" }
912+ - match : { docs.0.processor_results.2.if.result: true }
913+ ---
914+ " Test simulate with provided pipeline that does not exist " :
915+ - do :
916+ catch : bad_request
917+ ingest.simulate :
918+ verbose : true
919+ body : >
920+ {
921+ "pipeline": {
922+ "description": "_description",
923+ "processors": [
924+ {
925+ "pipeline": {
926+ "name": "____pipeline_doesnot_exist___"
927+ }
928+ }
929+ ]
930+ },
931+ "docs": [
932+ {
933+ "_source": {}
934+ }
935+ ]
936+ }
937+ - match : { error.root_cause.0.type: "illegal_argument_exception" }
938+ - match : { error.root_cause.0.reason: "Pipeline processor configured for non-existent pipeline [____pipeline_doesnot_exist___]" }
0 commit comments