Skip to content

Commit

Permalink
config: test: Assert parametrs at once in est/test_config.rb
Browse files Browse the repository at this point in the history
Co-authored-by: Takuro Ashie <ashie@clear-code.com>
  • Loading branch information
cosmo0920 and ashie committed May 18, 2022
1 parent 6574387 commit 348c5e2
Showing 1 changed file with 33 additions and 20 deletions.
53 changes: 33 additions & 20 deletions test/test_config.rb
Expand Up @@ -202,26 +202,39 @@ def test_included
fluent_log_conf = label_conf.elements.first
fluent_log_buffer_conf = fluent_log_conf.elements.first

assert_equal 'dummy', dummy_source_conf['@type']
assert_equal 'tag.dummy', dummy_source_conf['tag']

assert_equal 'tcp', tcp_source_conf['@type']
assert_equal 'tag.tcp', tcp_source_conf['tag']

assert_equal 'none', parse_tcp_conf['@type']
assert_equal 'why.parse.section.doesnot.have.arg,huh', parse_tcp_conf.arg

assert_equal 'stdout', match_conf['@type']
assert_equal 'tag.*', match_conf.arg

assert_equal 'null', fluent_log_conf['@type']
assert_equal '**', fluent_log_conf.arg

assert_equal '@FLUENT_LOG', label_conf.arg

assert_equal 'memory', fluent_log_buffer_conf['@type']
assert_equal 'interval', fluent_log_buffer_conf['flush_mode']
assert_equal '1s', fluent_log_buffer_conf['flush_interval']
assert_equal(
[
'dummy',
'tag.dummy',
'tcp',
'tag.tcp',
'none',
'why.parse.section.doesnot.have.arg,huh',
'stdout',
'tag.*',
'null',
'**',
'@FLUENT_LOG',
'memory',
'interval',
'1s',
],
[
dummy_source_conf['@type'],
dummy_source_conf['tag'],
tcp_source_conf['@type'],
tcp_source_conf['tag'],
parse_tcp_conf['@type'],
parse_tcp_conf.arg,
match_conf['@type'],
match_conf.arg,
fluent_log_conf['@type'],
fluent_log_conf.arg,
label_conf.arg,
fluent_log_buffer_conf['@type'],
fluent_log_buffer_conf['flush_mode'],
fluent_log_buffer_conf['flush_interval'],
])
end

def test_check_not_fetchd
Expand Down

0 comments on commit 348c5e2

Please sign in to comment.