Skip to content

Commit c0e6f12

Browse files
committed
Update ingest-common REST tests
Since this change modifies how updates behave with ingest pipelines, the tests need to be updated to reflect the new behavior (where single item updates behave the same as bulk updates). Signed-off-by: Michael Froh <[email protected]>
1 parent a432e47 commit c0e6f12

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

modules/ingest-common/src/yamlRestTest/resources/rest-api-spec/test/ingest/200_default_pipeline.yml

+5-3
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,17 @@ teardown:
7676
- match: { _source.bytes_source_field: "1kb" }
7777
- match: { _source.bytes_target_field: 1024 }
7878
# default pipeline via scripted upsert
79+
# note - scripted upserts execute the pipeline before the script, so any data referenced by the pipeline
80+
# needs to be in the upsert, not the script
7981
- do:
8082
update:
8183
index: test
8284
id: 4
8385
body:
8486
script:
85-
source: "ctx._source.bytes_source_field = '1kb'"
87+
source: "ctx._source.ran_script = true"
8688
lang: "painless"
87-
upsert : {}
89+
upsert : {"bytes_source_field": "1kb"}
8890
scripted_upsert: true
8991
- do:
9092
get:
@@ -107,7 +109,7 @@ teardown:
107109
- match: { _source.bytes_source_field: "1kb" }
108110
- match: { _source.bytes_target_field: 1024 }
109111
# default pipeline via bulk upsert
110-
# note - bulk scripted upsert's execute the pipeline before the script, so any data referenced by the pipeline
112+
# note - bulk scripted upserts execute the pipeline before the script, so any data referenced by the pipeline
111113
# needs to be in the upsert, not the script
112114
- do:
113115
bulk:

modules/ingest-common/src/yamlRestTest/resources/rest-api-spec/test/ingest/240_required_pipeline.yml

+5-3
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,17 @@ teardown:
7676
- match: { _source.bytes_source_field: "1kb" }
7777
- match: { _source.bytes_target_field: 1024 }
7878
# final pipeline via scripted upsert
79+
# note - scripted upserts execute the pipeline before the script, so any data referenced by the pipeline
80+
# needs to be in the upsert, not the script
7981
- do:
8082
update:
8183
index: test
8284
id: 4
8385
body:
8486
script:
85-
source: "ctx._source.bytes_source_field = '1kb'"
87+
source: "ctx._source.ran_script = true"
8688
lang: "painless"
87-
upsert : {}
89+
upsert : {"bytes_source_field":"1kb"}
8890
scripted_upsert: true
8991
- do:
9092
get:
@@ -107,7 +109,7 @@ teardown:
107109
- match: { _source.bytes_source_field: "1kb" }
108110
- match: { _source.bytes_target_field: 1024 }
109111
# final pipeline via bulk upsert
110-
# note - bulk scripted upsert's execute the pipeline before the script, so any data referenced by the pipeline
112+
# note - bulk scripted upserts execute the pipeline before the script, so any data referenced by the pipeline
111113
# needs to be in the upsert, not the script
112114
- do:
113115
bulk:

modules/ingest-common/src/yamlRestTest/resources/rest-api-spec/test/ingest/75_update.yml

-4
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ teardown:
5858

5959
- do:
6060
headers: { "X-Opaque-Id": "default_pipeline_request" }
61-
warnings:
62-
- "the index [test_1] has a default ingest pipeline or a final ingest pipeline, the support of the ingest pipelines for update operation causes unexpected result and will be removed in 3.0.0"
6361
update:
6462
index: test_1
6563
id: 1
@@ -87,8 +85,6 @@ teardown:
8785

8886
- do:
8987
headers: { "X-Opaque-Id": "final_pipeline_request" }
90-
warnings:
91-
- "the index [test_2] has a default ingest pipeline or a final ingest pipeline, the support of the ingest pipelines for update operation causes unexpected result and will be removed in 3.0.0"
9288
update:
9389
index: test_2
9490
id: 1

0 commit comments

Comments
 (0)