Sha256: aa3ade105e1b23380d36d5a86b37370a76c03431629b3edfd2ed2eaae7fc0f57

Contents?: true

Size: 1.4 KB

Versions: 14

Compression:

Stored size: 1.4 KB

Contents

shared_context "execution_context" do
  let(:pipeline) { double("pipeline") }
  let(:pipeline_id) { :main }
  let(:agent) { double("agent") }
  let(:plugin_id) { :plugin_id }
  let(:plugin_type) { :plugin_type }
  let(:dlq_writer) { double("dlq_writer") }
  let(:execution_context) do
    ::LogStash::ExecutionContext.new(pipeline, agent, plugin_id, plugin_type, dlq_writer)
  end

  before do
    allow(pipeline).to receive(:pipeline_id).and_return(pipeline_id)
    allow(pipeline).to receive(:agent).and_return(agent)
  end
end

shared_context "api setup" do
  before :all do
    clear_data_dir
    settings = mock_settings
    config_string = "input { generator {id => 'api-generator-pipeline' count => 100 } } output { dummyoutput {} }"
    settings.set("config.string", config_string)
    settings.set("config.reload.automatic", false)
    @agent = make_test_agent(settings)
    @agent.execute
    pipeline_config = mock_pipeline_config(:main, "input { generator { id => '123' } } output { null {} }")
    pipeline_creator =  LogStash::PipelineAction::Create.new(pipeline_config, @agent.metric)
    @pipelines = Hash.new
    expect(pipeline_creator.execute(@agent, @pipelines)).to be_truthy
  end

  after :all do
    @agent.shutdown
    @pipelines.each do |_, pipeline|
      pipeline.shutdown
      pipeline.thread.join
    end
  end

  include Rack::Test::Methods

  def app()
    described_class.new(nil, @agent)
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
logstash-core-6.2.4-java spec/support/shared_contexts.rb
logstash-core-6.2.3-java spec/support/shared_contexts.rb
logstash-core-6.1.4-java spec/support/shared_contexts.rb
logstash-core-6.2.2-java spec/support/shared_contexts.rb
logstash-core-6.2.1-java spec/support/shared_contexts.rb
logstash-core-6.2.0-java spec/support/shared_contexts.rb
logstash-core-6.1.3-java spec/support/shared_contexts.rb
logstash-core-6.1.2-java spec/support/shared_contexts.rb
logstash-core-6.1.1-java spec/support/shared_contexts.rb
logstash-core-6.1.0-java spec/support/shared_contexts.rb
logstash-core-6.0.1-java spec/support/shared_contexts.rb
logstash-core-6.0.0-java spec/support/shared_contexts.rb
logstash-core-6.0.0.rc2-java spec/support/shared_contexts.rb
logstash-core-6.0.0.rc1-java spec/support/shared_contexts.rb