Skip to content

Commit e10a3fb

Browse files
committed
require fluentd < 0.14
1 parent c69ae42 commit e10a3fb

File tree

4 files changed

+28
-27
lines changed

4 files changed

+28
-27
lines changed

Rakefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Rake::TestTask.new(:test) do |test|
55
test.libs << 'test'
66
test.pattern = 'test/**/test_*.rb'
77
test.verbose = true
8+
test.warning = false
89
end
910

1011
task :default => :test

fluent-plugin-elasticsearch.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Gem::Specification.new do |s|
1616
s.test_files = s.files.grep(%r{^(test|spec|features)/})
1717
s.require_paths = ['lib']
1818

19-
s.add_runtime_dependency 'fluentd', '>= 0.10.43'
19+
s.add_runtime_dependency 'fluentd', '>= 0.10.43', '< 0.14'
2020
s.add_runtime_dependency 'excon', '>= 0'
2121
s.add_runtime_dependency 'elasticsearch', '>= 0'
2222

test/plugin/test_out_elasticsearch.rb

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,8 @@ def test_writes_to_speficied_index_uppercase
163163
stub_elastic
164164
driver.emit(sample_record)
165165
driver.run
166-
# Allthough index_name has upper-case characters,
167-
# it should be set as lower-case when sent to elasticsearch.
166+
# Allthough index_name has upper-case characters,
167+
# it should be set as lower-case when sent to elasticsearch.
168168
assert_equal('myindex', index_cmds.first['index']['_index'])
169169
end
170170

@@ -185,7 +185,7 @@ def test_writes_to_target_index_key_logstash
185185
time = Time.parse Date.today.to_s
186186
stub_elastic_ping
187187
stub_elastic
188-
driver.emit(sample_record.merge('@target_index' => 'local-override'), time)
188+
driver.emit(sample_record.merge('@target_index' => 'local-override'), time.to_i)
189189
driver.run
190190
assert_equal('local-override', index_cmds.first['index']['_index'])
191191
end
@@ -196,10 +196,10 @@ def test_writes_to_target_index_key_logstash_uppercase
196196
time = Time.parse Date.today.to_s
197197
stub_elastic_ping
198198
stub_elastic
199-
driver.emit(sample_record.merge('@target_index' => 'Local-Override'), time)
199+
driver.emit(sample_record.merge('@target_index' => 'Local-Override'), time.to_i)
200200
driver.run
201-
# Allthough @target_index has upper-case characters,
202-
# it should be set as lower-case when sent to elasticsearch.
201+
# Allthough @target_index has upper-case characters,
202+
# it should be set as lower-case when sent to elasticsearch.
203203
assert_equal('local-override', index_cmds.first['index']['_index'])
204204
end
205205

@@ -219,7 +219,7 @@ def test_writes_to_target_index_key_fallack_logstash
219219
logstash_index = "logstash-#{time.getutc.strftime("%Y.%m.%d")}"
220220
stub_elastic_ping
221221
stub_elastic
222-
driver.emit(sample_record, time)
222+
driver.emit(sample_record, time.to_i)
223223
driver.run
224224
assert_equal(logstash_index, index_cmds.first['index']['_index'])
225225
end
@@ -373,7 +373,7 @@ def test_writes_to_logstash_index
373373
logstash_index = "logstash-2015.05.31"
374374
stub_elastic_ping
375375
stub_elastic
376-
driver.emit(sample_record, dt.to_time)
376+
driver.emit(sample_record, dt.to_time.to_i)
377377
driver.run
378378
assert_equal(logstash_index, index_cmds.first['index']['_index'])
379379
end
@@ -387,7 +387,7 @@ def test_writes_to_logstash_non_utc_index
387387
index = "logstash-#{time.strftime("%Y.%m.%d")}"
388388
stub_elastic_ping
389389
stub_elastic
390-
driver.emit(sample_record, time)
390+
driver.emit(sample_record, time.to_i)
391391
driver.run
392392
assert_equal(index, index_cmds.first['index']['_index'])
393393
end
@@ -399,7 +399,7 @@ def test_writes_to_logstash_index_with_specified_prefix
399399
logstash_index = "myprefix-#{time.getutc.strftime("%Y.%m.%d")}"
400400
stub_elastic_ping
401401
stub_elastic
402-
driver.emit(sample_record, time)
402+
driver.emit(sample_record, time.to_i)
403403
driver.run
404404
assert_equal(logstash_index, index_cmds.first['index']['_index'])
405405
end
@@ -411,10 +411,10 @@ def test_writes_to_logstash_index_with_specified_prefix_uppercase
411411
logstash_index = "myprefix-#{time.getutc.strftime("%Y.%m.%d")}"
412412
stub_elastic_ping
413413
stub_elastic
414-
driver.emit(sample_record, time)
414+
driver.emit(sample_record, time.to_i)
415415
driver.run
416-
# Allthough logstash_prefix has upper-case characters,
417-
# it should be set as lower-case when sent to elasticsearch.
416+
# Allthough logstash_prefix has upper-case characters,
417+
# it should be set as lower-case when sent to elasticsearch.
418418
assert_equal(logstash_index, index_cmds.first['index']['_index'])
419419
end
420420

@@ -425,7 +425,7 @@ def test_writes_to_logstash_index_with_specified_dateformat
425425
logstash_index = "logstash-#{time.getutc.strftime("%Y.%m")}"
426426
stub_elastic_ping
427427
stub_elastic
428-
driver.emit(sample_record, time)
428+
driver.emit(sample_record, time.to_i)
429429
driver.run
430430
assert_equal(logstash_index, index_cmds.first['index']['_index'])
431431
end
@@ -438,7 +438,7 @@ def test_writes_to_logstash_index_with_specified_prefix_and_dateformat
438438
logstash_index = "myprefix-#{time.getutc.strftime("%Y.%m")}"
439439
stub_elastic_ping
440440
stub_elastic
441-
driver.emit(sample_record, time)
441+
driver.emit(sample_record, time.to_i)
442442
driver.run
443443
assert_equal(logstash_index, index_cmds.first['index']['_index'])
444444
end

test/plugin/test_out_elasticsearch_dynamic.rb

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def test_writes_to_speficied_index
154154
driver.run
155155
assert_equal('myindex', index_cmds.first['index']['_index'])
156156
end
157-
157+
158158
def test_writes_to_speficied_index_uppercase
159159
driver.configure("index_name MyIndex\n")
160160
stub_elastic_ping
@@ -247,7 +247,7 @@ def test_writes_to_logstash_index
247247
logstash_index = "logstash-#{time.getutc.strftime("%Y.%m.%d")}"
248248
stub_elastic_ping
249249
stub_elastic
250-
driver.emit(sample_record, time)
250+
driver.emit(sample_record, time.to_i)
251251
driver.run
252252
assert_equal(logstash_index, index_cmds.first['index']['_index'])
253253
end
@@ -259,7 +259,7 @@ def test_writes_to_logstash_utc_index
259259
utc_index = "logstash-#{time.strftime("%Y.%m.%d")}"
260260
stub_elastic_ping
261261
stub_elastic
262-
driver.emit(sample_record, time)
262+
driver.emit(sample_record, time.to_i)
263263
driver.run
264264
assert_equal(utc_index, index_cmds.first['index']['_index'])
265265
end
@@ -271,19 +271,19 @@ def test_writes_to_logstash_index_with_specified_prefix
271271
logstash_index = "myprefix-#{time.getutc.strftime("%Y.%m.%d")}"
272272
stub_elastic_ping
273273
stub_elastic
274-
driver.emit(sample_record, time)
274+
driver.emit(sample_record, time.to_i)
275275
driver.run
276276
assert_equal(logstash_index, index_cmds.first['index']['_index'])
277277
end
278-
278+
279279
def test_writes_to_logstash_index_with_specified_prefix_uppercase
280280
driver.configure("logstash_format true
281281
logstash_prefix MyPrefix")
282282
time = Time.parse Date.today.to_s
283283
logstash_index = "myprefix-#{time.getutc.strftime("%Y.%m.%d")}"
284284
stub_elastic_ping
285285
stub_elastic
286-
driver.emit(sample_record, time)
286+
driver.emit(sample_record, time.to_i)
287287
driver.run
288288
assert_equal(logstash_index, index_cmds.first['index']['_index'])
289289
end
@@ -295,7 +295,7 @@ def test_writes_to_logstash_index_with_specified_dateformat
295295
logstash_index = "logstash-#{time.getutc.strftime("%Y.%m")}"
296296
stub_elastic_ping
297297
stub_elastic
298-
driver.emit(sample_record, time)
298+
driver.emit(sample_record, time.to_i)
299299
driver.run
300300
assert_equal(logstash_index, index_cmds.first['index']['_index'])
301301
end
@@ -308,7 +308,7 @@ def test_writes_to_logstash_index_with_specified_prefix_and_dateformat
308308
logstash_index = "myprefix-#{time.getutc.strftime("%Y.%m")}"
309309
stub_elastic_ping
310310
stub_elastic
311-
driver.emit(sample_record, time)
311+
driver.emit(sample_record, time.to_i)
312312
driver.run
313313
assert_equal(logstash_index, index_cmds.first['index']['_index'])
314314
end
@@ -546,7 +546,7 @@ def test_create_should_not_write_if_theres_no_id
546546
end
547547

548548
def test_update_should_write_update_op_and_doc_as_upsert_is_false
549-
driver.configure("write_operation update
549+
driver.configure("write_operation update
550550
id_key request_id")
551551
stub_elastic_ping
552552
stub_elastic
@@ -557,7 +557,7 @@ def test_update_should_write_update_op_and_doc_as_upsert_is_false
557557
end
558558

559559
def test_upsert_should_write_update_op_and_doc_as_upsert_is_true
560-
driver.configure("write_operation upsert
560+
driver.configure("write_operation upsert
561561
id_key request_id")
562562
stub_elastic_ping
563563
stub_elastic
@@ -568,7 +568,7 @@ def test_upsert_should_write_update_op_and_doc_as_upsert_is_true
568568
end
569569

570570
def test_create_should_write_create_op
571-
driver.configure("write_operation create
571+
driver.configure("write_operation create
572572
id_key request_id")
573573
stub_elastic_ping
574574
stub_elastic

0 commit comments

Comments
 (0)