fluentd 0.14.6 → 0.14.7

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of fluentd might be problematic. Click here for more details.

Files changed (103) hide show
  1. checksums.yaml +4 -4
  2. data/ChangeLog +46 -0
  3. data/bin/fluent-binlog-reader +7 -0
  4. data/example/in_dummy_with_compression.conf +23 -0
  5. data/lib/fluent/agent.rb +8 -12
  6. data/lib/fluent/command/binlog_reader.rb +234 -0
  7. data/lib/fluent/command/fluentd.rb +17 -1
  8. data/lib/fluent/compat/file_util.rb +1 -1
  9. data/lib/fluent/compat/output.rb +5 -1
  10. data/lib/fluent/config/configure_proxy.rb +18 -4
  11. data/lib/fluent/config/element.rb +1 -1
  12. data/lib/fluent/config/section.rb +1 -1
  13. data/lib/fluent/config/v1_parser.rb +1 -1
  14. data/lib/fluent/env.rb +1 -0
  15. data/lib/fluent/event.rb +49 -2
  16. data/lib/fluent/event_router.rb +6 -2
  17. data/lib/fluent/label.rb +8 -0
  18. data/lib/fluent/log.rb +30 -1
  19. data/lib/fluent/plugin.rb +1 -1
  20. data/lib/fluent/plugin/base.rb +3 -0
  21. data/lib/fluent/plugin/buf_file.rb +2 -2
  22. data/lib/fluent/plugin/buf_memory.rb +1 -1
  23. data/lib/fluent/plugin/buffer.rb +12 -2
  24. data/lib/fluent/plugin/buffer/chunk.rb +68 -7
  25. data/lib/fluent/plugin/buffer/file_chunk.rb +4 -4
  26. data/lib/fluent/plugin/buffer/memory_chunk.rb +4 -4
  27. data/lib/fluent/plugin/compressable.rb +91 -0
  28. data/lib/fluent/plugin/filter_grep.rb +4 -4
  29. data/lib/fluent/plugin/formatter.rb +2 -2
  30. data/lib/fluent/plugin/formatter_json.rb +2 -1
  31. data/lib/fluent/plugin/formatter_out_file.rb +3 -30
  32. data/lib/fluent/plugin/in_forward.rb +3 -2
  33. data/lib/fluent/plugin/in_monitor_agent.rb +7 -21
  34. data/lib/fluent/plugin/in_syslog.rb +1 -1
  35. data/lib/fluent/plugin/in_tail.rb +10 -2
  36. data/lib/fluent/plugin/multi_output.rb +63 -3
  37. data/lib/fluent/plugin/out_exec.rb +1 -1
  38. data/lib/fluent/plugin/out_file.rb +5 -1
  39. data/lib/fluent/plugin/out_forward.rb +17 -5
  40. data/lib/fluent/plugin/out_stdout.rb +2 -1
  41. data/lib/fluent/plugin/output.rb +205 -19
  42. data/lib/fluent/plugin/parser.rb +5 -49
  43. data/lib/fluent/plugin/parser_apache2.rb +1 -1
  44. data/lib/fluent/plugin/parser_json.rb +4 -4
  45. data/lib/fluent/plugin/parser_multiline.rb +5 -5
  46. data/lib/fluent/plugin/parser_regexp.rb +1 -2
  47. data/lib/fluent/plugin/parser_syslog.rb +2 -2
  48. data/lib/fluent/plugin/storage_local.rb +2 -1
  49. data/lib/fluent/plugin_helper.rb +1 -0
  50. data/lib/fluent/plugin_helper/compat_parameters.rb +39 -21
  51. data/lib/fluent/plugin_helper/extract.rb +92 -0
  52. data/lib/fluent/plugin_helper/inject.rb +10 -12
  53. data/lib/fluent/plugin_helper/thread.rb +23 -3
  54. data/lib/fluent/registry.rb +1 -1
  55. data/lib/fluent/root_agent.rb +2 -1
  56. data/lib/fluent/supervisor.rb +28 -8
  57. data/lib/fluent/test/base.rb +0 -7
  58. data/lib/fluent/test/driver/base.rb +1 -0
  59. data/lib/fluent/test/driver/output.rb +3 -0
  60. data/lib/fluent/test/helpers.rb +18 -0
  61. data/lib/fluent/test/input_test.rb +4 -2
  62. data/lib/fluent/test/log.rb +3 -1
  63. data/lib/fluent/time.rb +232 -1
  64. data/lib/fluent/timezone.rb +1 -1
  65. data/lib/fluent/version.rb +1 -1
  66. data/test/command/test_binlog_reader.rb +351 -0
  67. data/test/config/test_config_parser.rb +6 -0
  68. data/test/config/test_configurable.rb +47 -1
  69. data/test/helper.rb +0 -1
  70. data/test/plugin/test_buffer.rb +22 -2
  71. data/test/plugin/test_buffer_chunk.rb +34 -4
  72. data/test/plugin/test_buffer_file_chunk.rb +73 -0
  73. data/test/plugin/test_buffer_memory_chunk.rb +73 -0
  74. data/test/plugin/test_compressable.rb +81 -0
  75. data/test/plugin/test_formatter_json.rb +14 -1
  76. data/test/plugin/test_in_forward.rb +67 -3
  77. data/test/plugin/test_in_monitor_agent.rb +17 -1
  78. data/test/plugin/test_in_tail.rb +8 -8
  79. data/test/plugin/test_out_file.rb +0 -8
  80. data/test/plugin/test_out_forward.rb +85 -0
  81. data/test/plugin/test_out_secondary_file.rb +20 -12
  82. data/test/plugin/test_out_stdout.rb +11 -10
  83. data/test/plugin/test_output.rb +234 -0
  84. data/test/plugin/test_output_as_buffered.rb +223 -0
  85. data/test/plugin/test_output_as_buffered_compress.rb +165 -0
  86. data/test/plugin/test_parser_json.rb +8 -0
  87. data/test/plugin/test_parser_regexp.rb +1 -1
  88. data/test/plugin_helper/test_child_process.rb +2 -2
  89. data/test/plugin_helper/test_extract.rb +195 -0
  90. data/test/plugin_helper/test_inject.rb +0 -7
  91. data/test/scripts/fluent/plugin/formatter1/formatter_test1.rb +7 -0
  92. data/test/scripts/fluent/plugin/formatter2/formatter_test2.rb +7 -0
  93. data/test/test_event.rb +186 -0
  94. data/test/test_event_router.rb +1 -1
  95. data/test/test_formatter.rb +0 -7
  96. data/test/test_log.rb +121 -0
  97. data/test/test_plugin_classes.rb +62 -0
  98. data/test/test_root_agent.rb +125 -0
  99. data/test/test_supervisor.rb +25 -2
  100. data/test/test_time_formatter.rb +103 -7
  101. data/test/test_time_parser.rb +211 -0
  102. metadata +23 -4
  103. data/test/plugin/test_parser_time.rb +0 -46
@@ -0,0 +1,211 @@
1
+ require_relative 'helper'
2
+ require 'fluent/test'
3
+ require 'fluent/time'
4
+
5
+ class TimeParserTest < ::Test::Unit::TestCase
6
+ def setup
7
+ Fluent::Test.setup
8
+ end
9
+
10
+ def test_call_with_parse
11
+ parser = Fluent::TimeParser.new
12
+
13
+ assert(parser.parse('2013-09-18 12:00:00 +0900').is_a?(Fluent::EventTime))
14
+
15
+ time = event_time('2013-09-18 12:00:00 +0900')
16
+ assert_equal(time, parser.parse('2013-09-18 12:00:00 +0900'))
17
+ end
18
+
19
+ def test_parse_with_strptime
20
+ parser = Fluent::TimeParser.new('%d/%b/%Y:%H:%M:%S %z')
21
+
22
+ assert(parser.parse('28/Feb/2013:12:00:00 +0900').is_a?(Fluent::EventTime))
23
+
24
+ time = event_time('28/Feb/2013:12:00:00 +0900', format: '%d/%b/%Y:%H:%M:%S %z')
25
+ assert_equal(time, parser.parse('28/Feb/2013:12:00:00 +0900'))
26
+ end
27
+
28
+ def test_parse_nsec_with_strptime
29
+ parser = Fluent::TimeParser.new('%d/%b/%Y:%H:%M:%S:%N %z')
30
+
31
+ assert(parser.parse('28/Feb/2013:12:00:00:123456789 +0900').is_a?(Fluent::EventTime))
32
+
33
+ time = event_time('28/Feb/2013:12:00:00:123456789 +0900', format: '%d/%b/%Y:%H:%M:%S:%N %z')
34
+ assert_equal_event_time(time, parser.parse('28/Feb/2013:12:00:00:123456789 +0900'))
35
+ end
36
+
37
+ def test_parse_with_invalid_argument
38
+ parser = Fluent::TimeParser.new
39
+
40
+ [[], {}, nil, true, 10000, //, ->{}, '', :symbol].each { |v|
41
+ assert_raise Fluent::TimeParser::TimeParseError do
42
+ parser.parse(v)
43
+ end
44
+ }
45
+ end
46
+
47
+ def test_parse_time_in_localtime
48
+ time = with_timezone("UTC+02") do
49
+ parser = Fluent::TimeParser.new("%Y-%m-%d %H:%M:%S.%N", true)
50
+ parser.parse("2016-09-02 18:42:31.123456789")
51
+ end
52
+ assert_equal_event_time(time, event_time("2016-09-02 18:42:31.123456789 -02:00", format: '%Y-%m-%d %H:%M:%S.%N %z'))
53
+ end
54
+
55
+ def test_parse_time_in_utc
56
+ time = with_timezone("UTC-09") do
57
+ parser = Fluent::TimeParser.new("%Y-%m-%d %H:%M:%S.%N", false)
58
+ parser.parse("2016-09-02 18:42:31.123456789")
59
+ end
60
+ assert_equal_event_time(time, event_time("2016-09-02 18:42:31.123456789 UTC", format: '%Y-%m-%d %H:%M:%S.%N %z'))
61
+ end
62
+
63
+ def test_parse_string_with_expected_timezone
64
+ time = with_timezone("UTC-09") do
65
+ parser = Fluent::TimeParser.new("%Y-%m-%d %H:%M:%S.%N", nil, "-07:00")
66
+ parser.parse("2016-09-02 18:42:31.123456789")
67
+ end
68
+ assert_equal_event_time(time, event_time("2016-09-02 18:42:31.123456789 -07:00", format: '%Y-%m-%d %H:%M:%S.%N %z'))
69
+ end
70
+
71
+ sub_test_case 'TimeMixin::Parser' do
72
+ class DummyForTimeParser
73
+ include Fluent::Configurable
74
+ include Fluent::TimeMixin::Parser
75
+ end
76
+
77
+ test 'provides configuration parameters for TimeParser with default values for localtime' do
78
+ time = with_timezone("UTC+07") do
79
+ i = DummyForTimeParser.new
80
+ i.configure(config_element('parse'))
81
+
82
+ assert_nil i.time_format
83
+ assert_true i.localtime
84
+ assert_false i.utc
85
+ assert_nil i.timezone
86
+
87
+ parser = i.time_parser_create
88
+ # time_format unspecified
89
+ # localtime
90
+ parser.parse("2016-09-02 18:42:31.012345678")
91
+ end
92
+ assert_equal_event_time(event_time("2016-09-02 18:42:31.012345678 -07:00", format: '%Y-%m-%d %H:%M:%S.%N %z'), time)
93
+ end
94
+
95
+ test 'provides configuration parameters for TimeParser, configurable for any time format' do
96
+ time = with_timezone("UTC+07") do
97
+ i = DummyForTimeParser.new
98
+ i.configure(config_element('parse', '', {'time_format' => '%m/%d/%Y %H-%M-%S %N'}))
99
+ parser = i.time_parser_create
100
+ # time_format specified
101
+ # localtime
102
+ parser.parse("09/02/2016 18-42-31 012345678")
103
+ end
104
+ assert_equal_event_time(event_time("2016-09-02 18:42:31.012345678 -07:00", format: '%Y-%m-%d %H:%M:%S.%N %z'), time)
105
+ end
106
+
107
+ test 'provides configuration parameters for TimeParser, configurable for UTC by localtime=false' do
108
+ time = with_timezone("UTC+07") do
109
+ i = DummyForTimeParser.new
110
+ i.configure(config_element('parse', '', {'time_format' => '%m/%d/%Y %H-%M-%S %N', 'localtime' => 'false'}))
111
+ parser = i.time_parser_create
112
+ # time_format specified
113
+ # utc
114
+ parser.parse("09/02/2016 18-42-31 012345678")
115
+ end
116
+ assert_equal_event_time(event_time("2016-09-02 18:42:31.012345678 UTC", format: '%Y-%m-%d %H:%M:%S.%N %z'), time)
117
+ end
118
+
119
+ test 'provides configuration parameters for TimeParser, configurable for UTC by utc=true' do
120
+ time = with_timezone("UTC+07") do
121
+ i = DummyForTimeParser.new
122
+ i.configure(config_element('parse', '', {'time_format' => '%m/%d/%Y %H-%M-%S %N', 'utc' => 'true'}))
123
+ parser = i.time_parser_create
124
+ # time_format specified
125
+ # utc
126
+ parser.parse("09/02/2016 18-42-31 012345678")
127
+ end
128
+ assert_equal_event_time(event_time("2016-09-02 18:42:31.012345678 UTC", format: '%Y-%m-%d %H:%M:%S.%N %z'), time)
129
+ end
130
+
131
+ test 'provides configuration parameters for TimeParser, configurable for any timezone' do
132
+ time = with_timezone("UTC+07") do
133
+ i = DummyForTimeParser.new
134
+ i.configure(config_element('parse', '', {'time_format' => '%m/%d/%Y %H-%M-%S %N', 'timezone' => '-01:00'}))
135
+ parser = i.time_parser_create
136
+ # time_format specified
137
+ # -01:00
138
+ parser.parse("09/02/2016 18-42-31 012345678")
139
+ end
140
+ assert_equal_event_time(event_time("2016-09-02 18:42:31.012345678 -01:00", format: '%Y-%m-%d %H:%M:%S.%N %z'), time)
141
+ end
142
+
143
+ test 'specifying timezone without time format raises configuration error' do
144
+ assert_raise Fluent::ConfigError.new("specifying timezone requires time format") do
145
+ i = DummyForTimeParser.new
146
+ i.configure(config_element('parse', '', {'utc' => 'true'}))
147
+ i.time_parser_create
148
+ end
149
+ assert_raise Fluent::ConfigError.new("specifying timezone requires time format") do
150
+ i = DummyForTimeParser.new
151
+ i.configure(config_element('parse', '', {'localtime' => 'false'}))
152
+ i.time_parser_create
153
+ end
154
+ assert_raise Fluent::ConfigError.new("specifying timezone requires time format") do
155
+ i = DummyForTimeParser.new
156
+ i.configure(config_element('parse', '', {'timezone' => '-0700'}))
157
+ i.time_parser_create
158
+ end
159
+ end
160
+
161
+ test '#time_parser_create returns TimeParser with specified time format and timezone' do
162
+ time = with_timezone("UTC-09") do
163
+ i = DummyForTimeParser.new
164
+ i.configure(config_element('parse', '', {'time_format' => '%m/%d/%Y %H-%M-%S %N'}))
165
+ assert_equal '%m/%d/%Y %H-%M-%S %N', i.time_format
166
+ assert_true i.localtime
167
+ parser = i.time_parser_create(format: '%Y-%m-%d %H:%M:%S.%N %z')
168
+ parser.parse("2016-09-05 17:59:38.987654321 -03:00")
169
+ end
170
+ assert_equal_event_time(event_time("2016-09-05 17:59:38.987654321 -03:00", format: '%Y-%m-%d %H:%M:%S.%N %z'), time)
171
+ end
172
+
173
+ test '#time_parser_create returns TimeParser with localtime when specified it forcedly besides any configuration parameters' do
174
+ time = with_timezone("UTC-09") do
175
+ i = DummyForTimeParser.new
176
+ i.configure(config_element('parse', '', {'time_format' => '%m/%d/%Y %H-%M-%S', 'utc' => 'true'}))
177
+ assert_equal '%m/%d/%Y %H-%M-%S', i.time_format
178
+ assert_true i.utc
179
+ parser = i.time_parser_create(format: '%Y-%m-%d %H:%M:%S.%N', force_localtime: true)
180
+ parser.parse("2016-09-05 17:59:38.987654321")
181
+ end
182
+ assert_equal_event_time(event_time("2016-09-05 17:59:38.987654321 +09:00", format: '%Y-%m-%d %H:%M:%S.%N %z'), time)
183
+
184
+ time = with_timezone("UTC-09") do
185
+ i = DummyForTimeParser.new
186
+ i.configure(config_element('parse', '', {'time_format' => '%m/%d/%Y %H-%M-%S', 'timezone' => '+0000'}))
187
+ assert_equal '%m/%d/%Y %H-%M-%S', i.time_format
188
+ assert_equal '+0000', i.timezone
189
+ parser = i.time_parser_create(format: '%Y-%m-%d %H:%M:%S.%N', force_localtime: true)
190
+ parser.parse("2016-09-05 17:59:38.987654321")
191
+ end
192
+ assert_equal_event_time(event_time("2016-09-05 17:59:38.987654321 +09:00", format: '%Y-%m-%d %H:%M:%S.%N %z'), time)
193
+ end
194
+
195
+ test '#time_parser_create returns NumericTimeParser to parse time as unixtime when time_type unixtime specified' do
196
+ i = DummyForTimeParser.new
197
+ i.configure(config_element('parse', '', {'time_type' => 'unixtime'}))
198
+ parser = i.time_parser_create
199
+ time = event_time("2016-10-03 20:08:30.123456789 +0100", format: '%Y-%m-%d %H:%M:%S.%N %z')
200
+ assert_equal_event_time(Fluent::EventTime.new(time.to_i), parser.parse("#{time.sec}"))
201
+ end
202
+
203
+ test '#time_parser_create returns NumericTimeParser to parse time as float when time_type float specified' do
204
+ i = DummyForTimeParser.new
205
+ i.configure(config_element('parse', '', {'time_type' => 'float'}))
206
+ parser = i.time_parser_create
207
+ time = event_time("2016-10-03 20:08:30.123456789 +0100", format: '%Y-%m-%d %H:%M:%S.%N %z')
208
+ assert_equal_event_time(time, parser.parse("#{time.sec}.#{time.nsec}"))
209
+ end
210
+ end
211
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluentd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.6
4
+ version: 0.14.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sadayuki Furuhashi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-07 00:00:00.000000000 Z
11
+ date: 2016-10-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: msgpack
@@ -279,6 +279,7 @@ description: Fluentd is an open source data collector designed to scale and simp
279
279
  email:
280
280
  - frsyuki@gmail.com
281
281
  executables:
282
+ - fluent-binlog-reader
282
283
  - fluent-cat
283
284
  - fluent-debug
284
285
  - fluent-gem
@@ -298,12 +299,14 @@ files:
298
299
  - Rakefile
299
300
  - Vagrantfile
300
301
  - appveyor.yml
302
+ - bin/fluent-binlog-reader
301
303
  - bin/fluent-cat
302
304
  - bin/fluent-debug
303
305
  - bin/fluent-gem
304
306
  - bin/fluentd
305
307
  - example/copy_roundrobin.conf
306
308
  - example/filter_stdout.conf
309
+ - example/in_dummy_with_compression.conf
307
310
  - example/in_forward.conf
308
311
  - example/in_forward_client.conf
309
312
  - example/in_forward_shared_key.conf
@@ -329,6 +332,7 @@ files:
329
332
  - fluent.conf
330
333
  - fluentd.gemspec
331
334
  - lib/fluent/agent.rb
335
+ - lib/fluent/command/binlog_reader.rb
332
336
  - lib/fluent/command/bundler_injection.rb
333
337
  - lib/fluent/command/cat.rb
334
338
  - lib/fluent/command/debug.rb
@@ -392,6 +396,7 @@ files:
392
396
  - lib/fluent/plugin/buffer/chunk.rb
393
397
  - lib/fluent/plugin/buffer/file_chunk.rb
394
398
  - lib/fluent/plugin/buffer/memory_chunk.rb
399
+ - lib/fluent/plugin/compressable.rb
395
400
  - lib/fluent/plugin/exec_util.rb
396
401
  - lib/fluent/plugin/file_util.rb
397
402
  - lib/fluent/plugin/file_wrapper.rb
@@ -458,6 +463,7 @@ files:
458
463
  - lib/fluent/plugin_helper/compat_parameters.rb
459
464
  - lib/fluent/plugin_helper/event_emitter.rb
460
465
  - lib/fluent/plugin_helper/event_loop.rb
466
+ - lib/fluent/plugin_helper/extract.rb
461
467
  - lib/fluent/plugin_helper/formatter.rb
462
468
  - lib/fluent/plugin_helper/inject.rb
463
469
  - lib/fluent/plugin_helper/parser.rb
@@ -498,6 +504,7 @@ files:
498
504
  - lib/fluent/unique_id.rb
499
505
  - lib/fluent/version.rb
500
506
  - lib/fluent/winsvc.rb
507
+ - test/command/test_binlog_reader.rb
501
508
  - test/compat/test_calls_super.rb
502
509
  - test/compat/test_parser.rb
503
510
  - test/config/assertions.rb
@@ -525,6 +532,7 @@ files:
525
532
  - test/plugin/test_buffer_chunk.rb
526
533
  - test/plugin/test_buffer_file_chunk.rb
527
534
  - test/plugin/test_buffer_memory_chunk.rb
535
+ - test/plugin/test_compressable.rb
528
536
  - test/plugin/test_file_util.rb
529
537
  - test/plugin/test_filter.rb
530
538
  - test/plugin/test_filter_grep.rb
@@ -564,6 +572,7 @@ files:
564
572
  - test/plugin/test_out_stream.rb
565
573
  - test/plugin/test_output.rb
566
574
  - test/plugin/test_output_as_buffered.rb
575
+ - test/plugin/test_output_as_buffered_compress.rb
567
576
  - test/plugin/test_output_as_buffered_overflow.rb
568
577
  - test/plugin/test_output_as_buffered_retries.rb
569
578
  - test/plugin/test_output_as_buffered_secondary.rb
@@ -581,7 +590,6 @@ files:
581
590
  - test/plugin/test_parser_none.rb
582
591
  - test/plugin/test_parser_regexp.rb
583
592
  - test/plugin/test_parser_syslog.rb
584
- - test/plugin/test_parser_time.rb
585
593
  - test/plugin/test_parser_tsv.rb
586
594
  - test/plugin/test_storage.rb
587
595
  - test/plugin/test_storage_local.rb
@@ -590,6 +598,7 @@ files:
590
598
  - test/plugin_helper/test_compat_parameters.rb
591
599
  - test/plugin_helper/test_event_emitter.rb
592
600
  - test/plugin_helper/test_event_loop.rb
601
+ - test/plugin_helper/test_extract.rb
593
602
  - test/plugin_helper/test_formatter.rb
594
603
  - test/plugin_helper/test_inject.rb
595
604
  - test/plugin_helper/test_parser.rb
@@ -598,6 +607,8 @@ files:
598
607
  - test/plugin_helper/test_thread.rb
599
608
  - test/plugin_helper/test_timer.rb
600
609
  - test/scripts/exec_script.rb
610
+ - test/scripts/fluent/plugin/formatter1/formatter_test1.rb
611
+ - test/scripts/fluent/plugin/formatter2/formatter_test2.rb
601
612
  - test/scripts/fluent/plugin/formatter_known.rb
602
613
  - test/scripts/fluent/plugin/out_test.rb
603
614
  - test/scripts/fluent/plugin/out_test2.rb
@@ -620,6 +631,7 @@ files:
620
631
  - test/test_root_agent.rb
621
632
  - test/test_supervisor.rb
622
633
  - test/test_time_formatter.rb
634
+ - test/test_time_parser.rb
623
635
  - test/test_unique_id.rb
624
636
  homepage: http://fluentd.org/
625
637
  licenses:
@@ -646,6 +658,7 @@ signing_key:
646
658
  specification_version: 4
647
659
  summary: Fluentd event collector
648
660
  test_files:
661
+ - test/command/test_binlog_reader.rb
649
662
  - test/compat/test_calls_super.rb
650
663
  - test/compat/test_parser.rb
651
664
  - test/config/assertions.rb
@@ -673,6 +686,7 @@ test_files:
673
686
  - test/plugin/test_buffer_chunk.rb
674
687
  - test/plugin/test_buffer_file_chunk.rb
675
688
  - test/plugin/test_buffer_memory_chunk.rb
689
+ - test/plugin/test_compressable.rb
676
690
  - test/plugin/test_file_util.rb
677
691
  - test/plugin/test_filter.rb
678
692
  - test/plugin/test_filter_grep.rb
@@ -712,6 +726,7 @@ test_files:
712
726
  - test/plugin/test_out_stream.rb
713
727
  - test/plugin/test_output.rb
714
728
  - test/plugin/test_output_as_buffered.rb
729
+ - test/plugin/test_output_as_buffered_compress.rb
715
730
  - test/plugin/test_output_as_buffered_overflow.rb
716
731
  - test/plugin/test_output_as_buffered_retries.rb
717
732
  - test/plugin/test_output_as_buffered_secondary.rb
@@ -729,7 +744,6 @@ test_files:
729
744
  - test/plugin/test_parser_none.rb
730
745
  - test/plugin/test_parser_regexp.rb
731
746
  - test/plugin/test_parser_syslog.rb
732
- - test/plugin/test_parser_time.rb
733
747
  - test/plugin/test_parser_tsv.rb
734
748
  - test/plugin/test_storage.rb
735
749
  - test/plugin/test_storage_local.rb
@@ -738,6 +752,7 @@ test_files:
738
752
  - test/plugin_helper/test_compat_parameters.rb
739
753
  - test/plugin_helper/test_event_emitter.rb
740
754
  - test/plugin_helper/test_event_loop.rb
755
+ - test/plugin_helper/test_extract.rb
741
756
  - test/plugin_helper/test_formatter.rb
742
757
  - test/plugin_helper/test_inject.rb
743
758
  - test/plugin_helper/test_parser.rb
@@ -746,6 +761,8 @@ test_files:
746
761
  - test/plugin_helper/test_thread.rb
747
762
  - test/plugin_helper/test_timer.rb
748
763
  - test/scripts/exec_script.rb
764
+ - test/scripts/fluent/plugin/formatter1/formatter_test1.rb
765
+ - test/scripts/fluent/plugin/formatter2/formatter_test2.rb
749
766
  - test/scripts/fluent/plugin/formatter_known.rb
750
767
  - test/scripts/fluent/plugin/out_test.rb
751
768
  - test/scripts/fluent/plugin/out_test2.rb
@@ -768,4 +785,6 @@ test_files:
768
785
  - test/test_root_agent.rb
769
786
  - test/test_supervisor.rb
770
787
  - test/test_time_formatter.rb
788
+ - test/test_time_parser.rb
771
789
  - test/test_unique_id.rb
790
+ has_rdoc: false
@@ -1,46 +0,0 @@
1
- require_relative '../helper'
2
- require 'fluent/test/driver/parser'
3
- require 'fluent/plugin/parser'
4
-
5
- class TimeParserTest < ::Test::Unit::TestCase
6
- def setup
7
- Fluent::Test.setup
8
- end
9
-
10
- def test_call_with_parse
11
- parser = Fluent::Test::Driver::Parser.new(Fluent::Plugin::Parser::TimeParser.new(nil))
12
-
13
- assert(parser.instance.parse('2013-09-18 12:00:00 +0900').is_a?(Fluent::EventTime))
14
-
15
- time = event_time('2013-09-18 12:00:00 +0900')
16
- assert_equal(time, parser.instance.parse('2013-09-18 12:00:00 +0900'))
17
- end
18
-
19
- def test_parse_with_strptime
20
- parser = Fluent::Test::Driver::Parser.new(Fluent::Plugin::Parser::TimeParser.new('%d/%b/%Y:%H:%M:%S %z'))
21
-
22
- assert(parser.instance.parse('28/Feb/2013:12:00:00 +0900').is_a?(Fluent::EventTime))
23
-
24
- time = event_time('28/Feb/2013:12:00:00 +0900', format: '%d/%b/%Y:%H:%M:%S %z')
25
- assert_equal(time, parser.instance.parse('28/Feb/2013:12:00:00 +0900'))
26
- end
27
-
28
- def test_parse_nsec_with_strptime
29
- parser = Fluent::Test::Driver::Parser.new(Fluent::Plugin::Parser::TimeParser.new('%d/%b/%Y:%H:%M:%S:%N %z'))
30
-
31
- assert(parser.instance.parse('28/Feb/2013:12:00:00:123456789 +0900').is_a?(Fluent::EventTime))
32
-
33
- time = event_time('28/Feb/2013:12:00:00:123456789 +0900', format: '%d/%b/%Y:%H:%M:%S:%N %z')
34
- assert_equal_event_time(time, parser.instance.parse('28/Feb/2013:12:00:00:123456789 +0900'))
35
- end
36
-
37
- def test_parse_with_invalid_argument
38
- parser = Fluent::Test::Driver::Parser.new(Fluent::Plugin::Parser::TimeParser.new(nil))
39
-
40
- [[], {}, nil, true, 10000, //, ->{}, '', :symbol].each { |v|
41
- assert_raise Fluent::ParserError do
42
- parser.instance.parse(v)
43
- end
44
- }
45
- end
46
- end