forked from elastic/elasticsearch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Temporarily blow away the new tests and add asserts
- Loading branch information
Showing
3 changed files
with
89 additions
and
153 deletions.
There are no files selected for viewing
187 changes: 75 additions & 112 deletions
187
...ingest-common/src/yamlRestTest/resources/rest-api-spec/test/ingest/220_drop_processor.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,131 +1,94 @@ | ||
--- | ||
teardown: | ||
- do: | ||
ingest.delete_pipeline: | ||
id: "my_pipeline" | ||
ignore: 404 | ||
- do: | ||
ingest.delete_pipeline: | ||
id: "my_pipeline" | ||
ignore: 404 | ||
|
||
--- | ||
"Test Drop Processor": | ||
- do: | ||
ingest.put_pipeline: | ||
id: "my_pipeline" | ||
body: > | ||
{ | ||
"description" : "pipeline with drop", | ||
"processors" : [ | ||
{ | ||
"drop" : { | ||
"if": "ctx.foo == 'bar'" | ||
} | ||
- do: | ||
ingest.put_pipeline: | ||
id: "my_pipeline" | ||
body: > | ||
{ | ||
"description" : "pipeline with drop", | ||
"processors" : [ | ||
{ | ||
"drop" : { | ||
"if": "ctx.foo == 'bar'" | ||
} | ||
] | ||
} | ||
- match: { acknowledged: true } | ||
|
||
- do: | ||
index: | ||
index: test | ||
id: "1" | ||
pipeline: "my_pipeline" | ||
body: { | ||
foo: "bar" | ||
} | ||
] | ||
} | ||
- match: { acknowledged: true } | ||
|
||
- do: | ||
index: | ||
index: test | ||
id: "2" | ||
pipeline: "my_pipeline" | ||
body: { | ||
foo: "blub" | ||
} | ||
|
||
- do: | ||
catch: missing | ||
get: | ||
index: test | ||
id: "1" | ||
- match: { found: false } | ||
|
||
- do: | ||
get: | ||
index: test | ||
id: "2" | ||
- match: { _source.foo: "blub" } | ||
- do: | ||
index: | ||
index: test | ||
id: "1" | ||
pipeline: "my_pipeline" | ||
body: { | ||
foo: "bar" | ||
} | ||
|
||
--- | ||
"Test Drop Processor On Failure": | ||
- do: | ||
ingest.put_pipeline: | ||
id: "my_pipeline_with_failure" | ||
body: > | ||
{ | ||
"description" : "pipeline with on failure drop", | ||
"processors": [ | ||
{ | ||
"fail": { | ||
"message": "failed", | ||
"on_failure": [ | ||
{ | ||
"drop": {} | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} | ||
- match: { acknowledged: true } | ||
- do: | ||
index: | ||
index: test | ||
id: "2" | ||
pipeline: "my_pipeline" | ||
body: { | ||
foo: "blub" | ||
} | ||
|
||
- do: | ||
index: | ||
index: test | ||
id: "3" | ||
pipeline: "my_pipeline_with_failure" | ||
body: { | ||
foo: "bar" | ||
} | ||
- do: | ||
catch: missing | ||
get: | ||
index: test | ||
id: "1" | ||
- match: { found: false } | ||
|
||
- do: | ||
catch: missing | ||
get: | ||
index: test | ||
id: "3" | ||
- do: | ||
get: | ||
index: test | ||
id: "2" | ||
- match: { _source.foo: "blub" } | ||
|
||
--- | ||
"Test Drop Processor with Upsert": | ||
- do: | ||
ingest.put_pipeline: | ||
id: "my_pipeline" | ||
body: > | ||
{ | ||
"processors": [ | ||
"Test Drop Processor On Failure": | ||
- do: | ||
ingest.put_pipeline: | ||
id: "my_pipeline_with_failure" | ||
body: > | ||
{ | ||
"description" : "pipeline with on failure drop", | ||
"processors": [ | ||
{ | ||
"drop": { | ||
"fail": { | ||
"message": "failed", | ||
"on_failure": [ | ||
{ | ||
"drop": {} | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} | ||
- match: { acknowledged: true } | ||
} | ||
- match: { acknowledged: true } | ||
|
||
- do: | ||
index: | ||
index: test | ||
id: "3" | ||
pipeline: "my_pipeline_with_failure" | ||
body: { | ||
foo: "bar" | ||
} | ||
|
||
- do: | ||
bulk: | ||
refresh: true | ||
pipeline: "my_pipeline" | ||
body: | ||
- update: | ||
_index: test | ||
_id: 4 | ||
- '{"upsert":{"some":"fields"},"script":"ctx"}' | ||
- match: { errors: false } | ||
- match: { items.0.update._index: test } | ||
- match: { items.0.update._id: "4" } | ||
- match: { items.0.update._version: -3 } | ||
- match: { items.0.update.result: noop } | ||
- match: { items.0.update.status: 200 } | ||
- do: | ||
catch: missing | ||
get: | ||
index: test | ||
id: "3" | ||
|
||
- do: | ||
catch: missing | ||
get: | ||
index: test | ||
id: "4" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters