mirror of
https://github.com/elastic/logstash.git
synced 2025-04-25 23:27:19 -04:00
* Add feature flag support for RATS Adds feature flag support for RATS integration tests. First feature to use it is persistent_queues. You can enable a FF in travis by using the travis matrix and adding a env variable called FEATURE_FLAG=<feature_name>. To use feature flag, you need a logstash.yml file which has this feature turned on. Unfortunately --path.settings needs an entire dir where logstash.yml is located, not just the logstash.yml file, so we need to checkin the fixture which has the feature yml and log4j. For example, you can now set FEATURE_FLAG=persistent_queues which means travis will run tests twice, one with this feature enabled and once without it. When the feature is enaabled the logstash.yml located in qa/integration/fixtures/persistent_queues is picked up whenever LS is started in tests
33 lines
795 B
Ruby
33 lines
795 B
Ruby
require_relative '../framework/fixture'
|
|
require_relative '../framework/settings'
|
|
require_relative '../services/logstash_service'
|
|
require "rspec/wait"
|
|
require "logstash/devutils/rspec/spec_helper"
|
|
|
|
describe "Test Kafka Input" do
|
|
let(:num_retries) { 60 }
|
|
let(:num_events) { 37 }
|
|
|
|
before(:all) {
|
|
@fixture = Fixture.new(__FILE__)
|
|
}
|
|
|
|
after(:all) {
|
|
@fixture.teardown
|
|
}
|
|
|
|
it "can ingest 37 apache log lines from Kafka broker" do
|
|
logstash_service = @fixture.get_service("logstash")
|
|
logstash_service.start_background(@fixture.config)
|
|
|
|
try(num_retries) do
|
|
expect(@fixture.output_exists?).to be true
|
|
end
|
|
|
|
try(num_retries) do
|
|
count = File.foreach(@fixture.actual_output).inject(0) {|c, line| c+1}
|
|
expect(count).to eq(num_events)
|
|
end
|
|
end
|
|
|
|
end
|