Skip to content

Commit 4e61088

Browse files
authored
Add a test of an edge case for the set processor (elastic#134217)
1 parent 85f7fa9 commit 4e61088

File tree

1 file changed

+37
-1
lines changed

1 file changed

+37
-1
lines changed

modules/ingest-common/src/yamlRestTest/resources/rest-api-spec/test/ingest/270_set_processor.yml

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ teardown:
66
ignore: 404
77

88
---
9-
"Test set processor with template value":
9+
"Test set processor with a templated value":
1010
- do:
1111
ingest.put_pipeline:
1212
id: "1"
@@ -53,6 +53,7 @@ teardown:
5353
index: test
5454
id: "2"
5555
- match: { _source.foo: "hello" }
56+
5657
---
5758
"Test set processor with index change and require_alias":
5859
- do:
@@ -295,3 +296,38 @@ teardown:
295296
- match: { _source.result_2: "{{bar}}" }
296297
- match: { _source.old_bar: 2 }
297298
- match: { _source.bar: 3 }
299+
300+
---
301+
"Test set processor with ignore_empty_value and a literal empty value":
302+
- do:
303+
ingest.put_pipeline:
304+
id: "1"
305+
body: >
306+
{
307+
"processors": [
308+
{
309+
"set" : {
310+
"description": "we don't forbid this, even though it's a little silly",
311+
"field" : "foo",
312+
"value" : "",
313+
"ignore_empty_value" : true
314+
}
315+
}
316+
]
317+
}
318+
- match: { acknowledged: true }
319+
320+
- do:
321+
index:
322+
index: test
323+
id: "1"
324+
pipeline: "1"
325+
body: {
326+
foo: "hello"
327+
}
328+
329+
- do:
330+
get:
331+
index: test
332+
id: "1"
333+
- match: { _source.foo: "" }

0 commit comments

Comments
 (0)