logstash-devutils 1.1.0-java → 1.3.5-java
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/CHANGELOG.md +22 -0
- data/lib/logstash/devutils/rspec/logstash_helpers.rb +29 -3
- data/lib/logstash/devutils/rspec/spec_helper.rb +1 -6
- data/logstash-devutils.gemspec +3 -3
- metadata +16 -9
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 86e45cdddc78a4bb753fbef368b665469e85a066000bfd7232be414b61d0646b
|
|
4
|
+
data.tar.gz: 7d687ce51ca99eb47fb7fa323eb1ea5462dac616660c204779dd9c3e9ec730ab
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7de72acab490dcfcd0187bbba26c583b7ddf1ec3a54b8f03b6d8df65029c11b8e6c40e85c3569ea824b15242fa7563b3d9121e5cda71af839cd794958b37b9ca
|
|
7
|
+
data.tar.gz: 8b8fc95b98bf02ba2feac3da115303521629c581aff861bfe40a75d14a68385fdbb3585c6dd28e4d6f4aa7628a4a6c76868bad53489308238897f72c9c3f178b
|
data/CHANGELOG.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
## 1.3.5
|
|
2
|
+
- Fix spec helper method `input` generating an invalid `output_func` that returned `nil` instead of an array
|
|
3
|
+
- Remove spec helper log4j explicit initialization and rely on logstash-core default log4j initialization
|
|
4
|
+
|
|
5
|
+
## 1.3.4
|
|
6
|
+
- Pin kramdown gem to support ruby 1.x syntax for LS 5.x
|
|
7
|
+
|
|
8
|
+
## 1.3.3
|
|
9
|
+
- Make input function support different pipeline constructor signatures - for compatibility with logstash-core 6.0
|
|
10
|
+
- Make return of lambda used in input helpers explicit
|
|
11
|
+
|
|
12
|
+
## 1.3.2
|
|
13
|
+
- Make sample function support different pipeline constructor signatures - for compatibility with logstash-core 6.0
|
|
14
|
+
|
|
15
|
+
## 1.3.1
|
|
16
|
+
- Close pipeline after #sample helper - for compatibility with logstash-core 5.3
|
|
17
|
+
|
|
18
|
+
## 1.3.0
|
|
19
|
+
- Temporary add more visibility into the pipeline to make the #sample method work
|
|
20
|
+
|
|
21
|
+
## 1.2.1
|
|
22
|
+
- require logstash-core gem manually to make all the jars available to the plugin unit tests
|
|
@@ -6,6 +6,11 @@ require "rspec/expectations"
|
|
|
6
6
|
require "thread"
|
|
7
7
|
|
|
8
8
|
module LogStashHelper
|
|
9
|
+
class TestPipeline < LogStash::Pipeline
|
|
10
|
+
public :filter
|
|
11
|
+
public :flush_filters
|
|
12
|
+
end
|
|
13
|
+
|
|
9
14
|
DEFAULT_NUMBER_OF_TRY = 5
|
|
10
15
|
DEFAULT_EXCEPTIONS_FOR_TRY = [RSpec::Expectations::ExpectationNotMetError]
|
|
11
16
|
|
|
@@ -31,7 +36,7 @@ module LogStashHelper
|
|
|
31
36
|
name = name[0..50] + "..." if name.length > 50
|
|
32
37
|
|
|
33
38
|
describe "\"#{name}\"" do
|
|
34
|
-
let(:pipeline) {
|
|
39
|
+
let(:pipeline) { new_pipeline_from_string(config) }
|
|
35
40
|
let(:event) do
|
|
36
41
|
sample_event = [sample_event] unless sample_event.is_a?(Array)
|
|
37
42
|
next sample_event.collect do |e|
|
|
@@ -55,6 +60,11 @@ module LogStashHelper
|
|
|
55
60
|
results.select { |e| !e.cancelled? }
|
|
56
61
|
end
|
|
57
62
|
|
|
63
|
+
# starting at logstash-core 5.3 an initialized pipeline need to be closed
|
|
64
|
+
after do
|
|
65
|
+
pipeline.close if pipeline.respond_to?(:close)
|
|
66
|
+
end
|
|
67
|
+
|
|
58
68
|
subject { results.length > 1 ? results : results.first }
|
|
59
69
|
|
|
60
70
|
it("when processed", &block)
|
|
@@ -62,7 +72,7 @@ module LogStashHelper
|
|
|
62
72
|
end # def sample
|
|
63
73
|
|
|
64
74
|
def input(config, &block)
|
|
65
|
-
pipeline =
|
|
75
|
+
pipeline = new_pipeline_from_string(config)
|
|
66
76
|
queue = Queue.new
|
|
67
77
|
|
|
68
78
|
pipeline.instance_eval do
|
|
@@ -72,6 +82,10 @@ module LogStashHelper
|
|
|
72
82
|
# output_func is now a method, call closure
|
|
73
83
|
def output_func(event)
|
|
74
84
|
@output_func.call(event)
|
|
85
|
+
# We want to return nil or [] since outputs aren't used here
|
|
86
|
+
# NOTE: In Ruby 1.9.x, Queue#<< returned nil, but in 2.x it returns the queue itself
|
|
87
|
+
# So we need to be explicit about the return
|
|
88
|
+
[]
|
|
75
89
|
end
|
|
76
90
|
end
|
|
77
91
|
|
|
@@ -102,11 +116,23 @@ module LogStashHelper
|
|
|
102
116
|
def agent(&block)
|
|
103
117
|
|
|
104
118
|
it("agent(#{caller[0].gsub(/ .*/, "")}) runs") do
|
|
105
|
-
pipeline =
|
|
119
|
+
pipeline = new_pipeline_from_string(config)
|
|
106
120
|
pipeline.run
|
|
107
121
|
block.call
|
|
108
122
|
end
|
|
109
123
|
end # def agent
|
|
110
124
|
|
|
125
|
+
def new_pipeline_from_string(string)
|
|
126
|
+
if TestPipeline.instance_methods.include?(:pipeline_config)
|
|
127
|
+
settings = ::LogStash::SETTINGS.clone
|
|
128
|
+
|
|
129
|
+
config_part = org.logstash.common.SourceWithMetadata.new("config_string", "config_string", string)
|
|
130
|
+
|
|
131
|
+
pipeline_config = LogStash::Config::PipelineConfig.new(LogStash::Config::Source::Local, :main, config_part, settings)
|
|
132
|
+
TestPipeline.new(pipeline_config)
|
|
133
|
+
else
|
|
134
|
+
TestPipeline.new(string)
|
|
135
|
+
end
|
|
136
|
+
end
|
|
111
137
|
end # module LogStash
|
|
112
138
|
|
|
@@ -12,6 +12,7 @@ if ENV['COVERAGE']
|
|
|
12
12
|
end
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
+
require "logstash-core"
|
|
15
16
|
require "logstash/logging"
|
|
16
17
|
require "logstash/environment"
|
|
17
18
|
require "logstash/devutils/rspec/logstash_helpers"
|
|
@@ -20,12 +21,6 @@ require "insist"
|
|
|
20
21
|
|
|
21
22
|
Thread.abort_on_exception = true
|
|
22
23
|
|
|
23
|
-
# set log4j configuration
|
|
24
|
-
unless java.lang.System.getProperty("log4j.configurationFile")
|
|
25
|
-
log4j2_properties = "#{File.dirname(__FILE__)}/log4j2.properties"
|
|
26
|
-
LogStash::Logging::Logger::initialize(log4j2_properties)
|
|
27
|
-
end
|
|
28
|
-
|
|
29
24
|
$TESTING = true
|
|
30
25
|
if RUBY_VERSION < "1.9.2"
|
|
31
26
|
$stderr.puts "Ruby 1.9.2 or later is required. (You are running: " + RUBY_VERSION + ")"
|
data/logstash-devutils.gemspec
CHANGED
|
@@ -6,7 +6,7 @@ Gem::Specification.new do |spec|
|
|
|
6
6
|
files = %x{git ls-files}.split("\n")
|
|
7
7
|
|
|
8
8
|
spec.name = "logstash-devutils"
|
|
9
|
-
spec.version = "1.
|
|
9
|
+
spec.version = "1.3.5"
|
|
10
10
|
spec.licenses = ["Apache License (2.0)"]
|
|
11
11
|
spec.summary = "logstash-devutils"
|
|
12
12
|
spec.description = "logstash-devutils"
|
|
@@ -35,13 +35,13 @@ Gem::Specification.new do |spec|
|
|
|
35
35
|
spec.add_runtime_dependency "rake" # MIT License
|
|
36
36
|
spec.add_runtime_dependency "gem_publisher" # MIT License
|
|
37
37
|
spec.add_runtime_dependency "minitar" # GPL2|Ruby License
|
|
38
|
-
spec.add_runtime_dependency "logstash-core-plugin-api", "
|
|
38
|
+
spec.add_runtime_dependency "logstash-core-plugin-api", "<= 2.99", ">= 2.0"
|
|
39
39
|
|
|
40
40
|
# Should be removed as soon as the plugins are using insist by their
|
|
41
41
|
# own, and not relying on being required by the spec helper.
|
|
42
42
|
# (some plugins does it, some use insist throw spec_helper)
|
|
43
43
|
spec.add_runtime_dependency "insist", "1.0.0" # (Apache 2.0 license)
|
|
44
|
-
spec.add_runtime_dependency "kramdown"
|
|
44
|
+
spec.add_runtime_dependency "kramdown", '1.14.0'
|
|
45
45
|
spec.add_runtime_dependency "stud", " >= 0.0.20"
|
|
46
46
|
spec.add_runtime_dependency "fivemat"
|
|
47
47
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: logstash-devutils
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.3.5
|
|
5
5
|
platform: java
|
|
6
6
|
authors:
|
|
7
7
|
- Elastic
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2017-10-12 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -83,7 +83,10 @@ dependencies:
|
|
|
83
83
|
- !ruby/object:Gem::Dependency
|
|
84
84
|
requirement: !ruby/object:Gem::Requirement
|
|
85
85
|
requirements:
|
|
86
|
-
- - "
|
|
86
|
+
- - "<="
|
|
87
|
+
- !ruby/object:Gem::Version
|
|
88
|
+
version: '2.99'
|
|
89
|
+
- - ">="
|
|
87
90
|
- !ruby/object:Gem::Version
|
|
88
91
|
version: '2.0'
|
|
89
92
|
name: logstash-core-plugin-api
|
|
@@ -91,7 +94,10 @@ dependencies:
|
|
|
91
94
|
type: :runtime
|
|
92
95
|
version_requirements: !ruby/object:Gem::Requirement
|
|
93
96
|
requirements:
|
|
94
|
-
- - "
|
|
97
|
+
- - "<="
|
|
98
|
+
- !ruby/object:Gem::Version
|
|
99
|
+
version: '2.99'
|
|
100
|
+
- - ">="
|
|
95
101
|
- !ruby/object:Gem::Version
|
|
96
102
|
version: '2.0'
|
|
97
103
|
- !ruby/object:Gem::Dependency
|
|
@@ -111,17 +117,17 @@ dependencies:
|
|
|
111
117
|
- !ruby/object:Gem::Dependency
|
|
112
118
|
requirement: !ruby/object:Gem::Requirement
|
|
113
119
|
requirements:
|
|
114
|
-
- -
|
|
120
|
+
- - '='
|
|
115
121
|
- !ruby/object:Gem::Version
|
|
116
|
-
version:
|
|
122
|
+
version: 1.14.0
|
|
117
123
|
name: kramdown
|
|
118
124
|
prerelease: false
|
|
119
125
|
type: :runtime
|
|
120
126
|
version_requirements: !ruby/object:Gem::Requirement
|
|
121
127
|
requirements:
|
|
122
|
-
- -
|
|
128
|
+
- - '='
|
|
123
129
|
- !ruby/object:Gem::Version
|
|
124
|
-
version:
|
|
130
|
+
version: 1.14.0
|
|
125
131
|
- !ruby/object:Gem::Dependency
|
|
126
132
|
requirement: !ruby/object:Gem::Requirement
|
|
127
133
|
requirements:
|
|
@@ -156,6 +162,7 @@ executables: []
|
|
|
156
162
|
extensions: []
|
|
157
163
|
extra_rdoc_files: []
|
|
158
164
|
files:
|
|
165
|
+
- CHANGELOG.md
|
|
159
166
|
- Gemfile
|
|
160
167
|
- LICENSE
|
|
161
168
|
- lib/logstash/devutils/rake.rb
|
|
@@ -187,7 +194,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
187
194
|
version: '0'
|
|
188
195
|
requirements: []
|
|
189
196
|
rubyforge_project:
|
|
190
|
-
rubygems_version: 2.
|
|
197
|
+
rubygems_version: 2.6.11
|
|
191
198
|
signing_key:
|
|
192
199
|
specification_version: 4
|
|
193
200
|
summary: logstash-devutils
|