Skip to content

Commit

Permalink
Add tests checking final_pipelines in YAML tests (#94388)
Browse files Browse the repository at this point in the history
  • Loading branch information
HiDAl authored Mar 8, 2023
1 parent 1c35212 commit 20588b1
Showing 1 changed file with 47 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,36 @@
---
setup:
- skip:
features: [ "allowed_warnings" ]

- do:
allowed_warnings:
- "index template [add_final_pipeline] has index patterns [foo] matching patterns from existing older templates [global] with patterns (global => [*]); this template [add_final_pipeline] will take precedence during new index creation"
indices.put_index_template:
name: add_final_pipeline
body:
index_patterns: [ "foo" ]
template:
settings:
final_pipeline: "final_pipeline"

- do:
ingest.put_pipeline:
id: "final_pipeline"
body: >
{
"processors": [
{
"append" : {
"field" : "accumulator",
"value" : [
"non-repeated-value"
]
}
}
]
}
---
teardown:
- do:
Expand All @@ -9,6 +42,10 @@ teardown:
indices.delete:
index: foo

- do:
ingest.delete_pipeline:
id: final_pipeline
ignore: 404
---
"Test Change Target Index with Explicit Pipeline":

Expand Down Expand Up @@ -50,6 +87,11 @@ teardown:
index: foo
id: "1"
- match: { _source.a: true }
# The next is commented out because there's a bug where the final_pipeline is executed twice under certain circumstances
# (See issue https://github.com/elastic/elasticsearch/issues/83653).
# TODO: Uncomment after the issue is fixed, and remove the repeated value test of the current behavior
#- match: { _source.accumulator: [ "non-repeated-value" ] }
- match: { _source.accumulator: [ "non-repeated-value", "non-repeated-value" ] }

# only the foo index
- do:
Expand Down Expand Up @@ -108,6 +150,11 @@ teardown:
index: foo
id: "1"
- match: { _source.a: true }
# The next is commented out because there's a bug where the final_pipeline is executed twice under certain circumstances
# (See issue https://github.com/elastic/elasticsearch/issues/83653).
# TODO: Uncomment after the issue is fixed, and remove the repeated value test of the current behavior
#- match: { _source.accumulator: [ "non-repeated-value" ] }
- match: { _source.accumulator: [ "non-repeated-value", "non-repeated-value" ] }

# only the foo index
- do:
Expand Down

0 comments on commit 20588b1

Please sign in to comment.