|
4 | 4 | describe "failures in bulk class expected behavior", :integration => true do |
5 | 5 | let(:template) { '{"template" : "not important, will be updated by :index"}' } |
6 | 6 | let(:event1) { LogStash::Event.new("somevalue" => 100, "@timestamp" => "2014-11-17T20:37:17.223Z", "@metadata" => {"retry_count" => 0}) } |
7 | | - let(:action1) { ESHelper.action_for_version(["index", {:_id=>nil, routing_field_name =>nil, :_index=>"logstash-2014.11.17", :_type=> doc_type }, event1]) } |
| 7 | + let(:action1) do |
| 8 | + if ESHelper.es_version_satisfies?(">= 6", "< 7") |
| 9 | + ESHelper.action_for_version(["index", {:_id=>nil, routing_field_name =>nil, :_index=>"logstash-2014.11.17", :_type=> doc_type }, event1]) |
| 10 | + else |
| 11 | + ESHelper.action_for_version(["index", {:_id=>nil, routing_field_name =>nil, :_index=>"logstash-2014.11.17" }, event1]) |
| 12 | + end |
| 13 | + end |
8 | 14 | let(:event2) { LogStash::Event.new("geoip" => { "location" => [ 0.0, 0.0] }, "@timestamp" => "2014-11-17T20:37:17.223Z", "@metadata" => {"retry_count" => 0}) } |
9 | | - let(:action2) { ESHelper.action_for_version(["index", {:_id=>nil, routing_field_name =>nil, :_index=>"logstash-2014.11.17", :_type=> doc_type }, event2]) } |
| 15 | + let(:action2) do |
| 16 | + if ESHelper.es_version_satisfies?(">= 6", "< 7") |
| 17 | + ESHelper.action_for_version(["index", {:_id=>nil, routing_field_name =>nil, :_index=>"logstash-2014.11.17", :_type=> doc_type }, event2]) |
| 18 | + else |
| 19 | + ESHelper.action_for_version(["index", {:_id=>nil, routing_field_name =>nil, :_index=>"logstash-2014.11.17" }, event2]) |
| 20 | + end |
| 21 | + end |
10 | 22 | let(:invalid_event) { LogStash::Event.new("geoip" => { "location" => "notlatlon" }, "@timestamp" => "2014-11-17T20:37:17.223Z") } |
11 | 23 |
|
12 | 24 | def mock_actions_with_response(*resp) |
|
0 commit comments