Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 2.0.2
- Set number of pipeline workers to 1 in helper pipelines to facilitate plugin testing

## 2.0.0
- Reinvented helpers using Java pipeline, only LS >= 6.x (JRuby >= 9.1) is supported.
- [BREAKING] changes:
Expand Down
8 changes: 7 additions & 1 deletion lib/logstash/devutils/rspec/logstash_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ def tags(*tags)
deprecated "tags(#{tags.inspect}) - let(:default_tags) are not used"
end

def default_pipeline_settings(hash = {})
settings = ::LogStash::SETTINGS.clone
settings.set_value("pipeline.workers", 1)
settings
end

def sample(sample_event, &block)
name = sample_event.is_a?(String) ? sample_event : LogStash::Json.dump(sample_event)
name = name[0..50] + "..." if name.length > 50
Expand Down Expand Up @@ -144,7 +150,7 @@ def new_pipeline_from_string(config_string, pipeline_id: :main, test_sink: {})
new_pipeline(config_parts, pipeline_id)
end

def new_pipeline(config_parts, pipeline_id = :main, settings = ::LogStash::SETTINGS.clone)
def new_pipeline(config_parts, pipeline_id = :main, settings = default_pipeline_settings())
pipeline_config = LogStash::Config::PipelineConfig.new(LogStash::Config::Source::Local, pipeline_id, config_parts, settings)
TestPipeline.new(pipeline_config)
end
Expand Down
2 changes: 1 addition & 1 deletion logstash-devutils.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Gem::Specification.new do |spec|
files = %x{git ls-files}.split("\n")

spec.name = "logstash-devutils"
spec.version = "2.0.1"
spec.version = "2.0.2"
spec.license = "Apache-2.0"
spec.authors = ["Elastic"]
spec.email = "[email protected]"
Expand Down