@@ -546,11 +546,15 @@ teardown:
546546 - match : { docs.0.processor_results.0.tag: "setstatus-1" }
547547 - match : { docs.0.processor_results.0.doc._source.field1: "123.42 400 <foo>" }
548548 - match : { docs.0.processor_results.0.doc._source.status: 200 }
549+ - match : { docs.0.processor_results.0.status: "success" }
550+ - match : { docs.0.processor_results.0.processor_type: "set" }
549551 - match : { docs.0.processor_results.1.tag: "rename-1" }
550552 - match : { docs.0.processor_results.1.ignored_error.error.type: "illegal_argument_exception" }
551553 - match : { docs.0.processor_results.1.ignored_error.error.reason: "field [foofield] doesn't exist" }
552554 - match : { docs.0.processor_results.1.doc._source.field1: "123.42 400 <foo>" }
553555 - match : { docs.0.processor_results.1.doc._source.status: 200 }
556+ - match : { docs.0.processor_results.1.status: "error_ignored" }
557+ - match : { docs.0.processor_results.1.processor_type: "rename" }
554558
555559---
556560" Test verbose simulate with ignore_failure and no exception thrown " :
@@ -591,11 +595,16 @@ teardown:
591595 }
592596 - length : { docs: 1 }
593597 - length : { docs.0.processor_results: 2 }
598+ - length : { docs.0.processor_results.0: 4 }
594599 - match : { docs.0.processor_results.0.tag: "setstatus-1" }
600+ - match : { docs.0.processor_results.0.status: "success" }
601+ - match : { docs.0.processor_results.0.processor_type: "set" }
595602 - match : { docs.0.processor_results.0.doc._source.field1: "123.42 400 <foo>" }
596603 - match : { docs.0.processor_results.0.doc._source.status: 200 }
597- - length : { docs.0.processor_results.1: 2 }
604+ - length : { docs.0.processor_results.1: 4 }
598605 - match : { docs.0.processor_results.1.tag: "rename-1" }
606+ - match : { docs.0.processor_results.1.status: "success" }
607+ - match : { docs.0.processor_results.1.processor_type: "rename" }
599608 - match : { docs.0.processor_results.1.doc._source.new_status: 200 }
600609
601610---
@@ -710,7 +719,8 @@ teardown:
710719 {
711720 "set": {
712721 "field": "pipeline0",
713- "value": true
722+ "value": true,
723+ "description" : "first_set"
714724 }
715725 },
716726 {
@@ -731,16 +741,25 @@ teardown:
731741 ]
732742 }
733743 - length : { docs: 1 }
734- - length : { docs.0.processor_results: 3 }
744+ - length : { docs.0.processor_results: 5 }
735745- match : { docs.0.processor_results.0.doc._source.pipeline0: true }
746+ - match : { docs.0.processor_results.0.status: "success" }
747+ - match : { docs.0.processor_results.0.processor_type: "set" }
748+ - match : { docs.0.processor_results.0.description: "first_set" }
736749- is_false : docs.0.processor_results.0.doc._source.pipeline1
737750- is_false : docs.0.processor_results.0.doc._source.pipeline2
738- - match : { docs.0.processor_results.1.doc._source.pipeline0: true }
739- - match : { docs.0.processor_results.1.doc._source.pipeline1: true }
740- - is_false : docs.0.processor_results.1.doc._source.pipeline2
751+ - match : { docs.0.processor_results.1.doc: null }
752+ - match : { docs.0.processor_results.1.status: "success" }
753+ - match : { docs.0.processor_results.1.processor_type: "pipeline" }
741754- match : { docs.0.processor_results.2.doc._source.pipeline0: true }
742755- match : { docs.0.processor_results.2.doc._source.pipeline1: true }
743- - match : { docs.0.processor_results.2.doc._source.pipeline2: true }
756+ - is_false : docs.0.processor_results.2.doc._source.pipeline2
757+ - match : { docs.0.processor_results.3.doc: null }
758+ - match : { docs.0.processor_results.3.status: "success" }
759+ - match : { docs.0.processor_results.3.processor_type: "pipeline" }
760+ - match : { docs.0.processor_results.4.doc._source.pipeline0: true }
761+ - match : { docs.0.processor_results.4.doc._source.pipeline1: true }
762+ - match : { docs.0.processor_results.4.doc._source.pipeline2: true }
744763
745764---
746765" Test verbose simulate with true conditional and on failure " :
@@ -801,19 +820,27 @@ teardown:
801820- length : { docs.0.processor_results: 4 }
802821- match : { docs.0.processor_results.0.tag: "gunna_fail" }
803822- match : { docs.0.processor_results.0.error.reason: "field [foo1] doesn't exist" }
823+ - match : { docs.0.processor_results.0.status: "error" }
824+ - match : { docs.0.processor_results.0.processor_type: "rename" }
804825- match : { docs.0.processor_results.1.tag: "failed1" }
805826- match : { docs.0.processor_results.1.doc._source.failed1: "failed1" }
806827- match : { docs.0.processor_results.1.doc._ingest.on_failure_processor_tag: "gunna_fail" }
828+ - match : { docs.0.processor_results.1.status: "success" }
829+ - match : { docs.0.processor_results.1.processor_type: "set" }
807830- match : { docs.0.processor_results.2.tag: "gunna_fail_again" }
808831- match : { docs.0.processor_results.2.error.reason: "field [foo2] doesn't exist" }
832+ - match : { docs.0.processor_results.2.status: "error" }
833+ - match : { docs.0.processor_results.2.processor_type: "rename" }
809834- match : { docs.0.processor_results.3.tag: "failed2" }
810835- match : { docs.0.processor_results.3.doc._source.failed1: "failed1" }
811836- match : { docs.0.processor_results.3.doc._source.failed2: "failed2" }
812837- match : { docs.0.processor_results.3.doc._ingest.on_failure_processor_tag: "gunna_fail_again" }
838+ - match : { docs.0.processor_results.3.status: "success" }
839+ - match : { docs.0.processor_results.3.processor_type: "set" }
813840
814841
815842---
816- " Test simulate with provided pipeline definition with tag and description in processors " :
843+ " Test simulate with pipeline with conditional and skipped and dropped " :
817844 - do :
818845 ingest.simulate :
819846 verbose : true
@@ -829,6 +856,16 @@ teardown:
829856 "field" : "field2",
830857 "value" : "_value"
831858 }
859+ },
860+ {
861+ "drop" : {
862+ "if": "false"
863+ }
864+ },
865+ {
866+ "drop" : {
867+ "if": "true"
868+ }
832869 }
833870 ]
834871 },
@@ -843,7 +880,43 @@ teardown:
843880 ]
844881 }
845882 - length : { docs: 1 }
846- - length : { docs.0.processor_results: 1 }
883+ - length : { docs.0.processor_results: 3 }
847884 - match : { docs.0.processor_results.0.doc._source.field2: "_value" }
848885 - match : { docs.0.processor_results.0.description: "processor_description" }
849886 - match : { docs.0.processor_results.0.tag: "processor_tag" }
887+ - match : { docs.0.processor_results.0.status: "success" }
888+ - match : { docs.0.processor_results.0.processor_type: "set" }
889+ - match : { docs.0.processor_results.1.status: "skipped" }
890+ - match : { docs.0.processor_results.1.processor_type: "drop" }
891+ - match : { docs.0.processor_results.1.if.condition: "false" }
892+ - match : { docs.0.processor_results.1.if.result: false }
893+ - match : { docs.0.processor_results.2.status: "dropped" }
894+ - match : { docs.0.processor_results.2.processor_type: "drop" }
895+ - match : { docs.0.processor_results.2.if.condition: "true" }
896+ - match : { docs.0.processor_results.2.if.result: true }
897+ ---
898+ " Test simulate with provided pipeline that does not exist " :
899+ - do :
900+ catch : bad_request
901+ ingest.simulate :
902+ verbose : true
903+ body : >
904+ {
905+ "pipeline": {
906+ "description": "_description",
907+ "processors": [
908+ {
909+ "pipeline": {
910+ "name": "____pipeline_doesnot_exist___"
911+ }
912+ }
913+ ]
914+ },
915+ "docs": [
916+ {
917+ "_source": {}
918+ }
919+ ]
920+ }
921+ - match : { error.root_cause.0.type: "illegal_argument_exception" }
922+ - match : { error.root_cause.0.reason: "Pipeline processor configured for non-existent pipeline [____pipeline_doesnot_exist___]" }
0 commit comments