Skip to content

Commit

Permalink
Fix test for multi workers assign syntax on RootAgent
Browse files Browse the repository at this point in the history
  • Loading branch information
cosmo0920 committed Feb 20, 2019
1 parent 42272e5 commit c7e1885
Showing 1 changed file with 11 additions and 25 deletions.
36 changes: 11 additions & 25 deletions test/test_root_agent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -893,30 +893,16 @@ def configure_ra(conf_str)
refute ra.error_collector
end

test 'with plugins for workers syntax' do
test 'with plugins for workers syntax should match worker_id equals to 2' do
conf = <<-EOC
<worker 0-1>
<source>
@type tcp
tag test.worker_group1
<parse>
@type none
</parse>
</source>
<match pattern>
@type stdout
</match>
<label @ERROR>
<match>
@type null
</match>
</label>
</worker>
<worker 2-3>
<worker 0-2>
<source>
@type forward
</source>
<filter **>
@type test_filter
@id test_filter
</filter>
<match pattern>
@type stdout
</match>
Expand All @@ -927,12 +913,12 @@ def configure_ra(conf_str)
</label>
</worker>
EOC

ra = configure_ra(conf)
assert_equal 0, ra.inputs.size
assert_equal 0, ra.outputs.size
assert_equal 0, ra.filters.size
assert_equal 0, ra.labels.size
refute ra.error_collector
assert_kind_of Fluent::Plugin::ForwardInput, ra.inputs.first
assert_kind_of Fluent::Plugin::StdoutOutput, ra.outputs.first
assert_kind_of FluentTestFilter, ra.filters.first
assert ra.error_collector
end
end
end

0 comments on commit c7e1885

Please sign in to comment.