logstash-filter-grok icon indicating copy to clipboard operation
logstash-filter-grok copied to clipboard

tests fail because LogStash::Environment.pattern_path is not in logstash-core

Open jsvd opened this issue 9 years ago • 5 comments

running the specs fail for logstash-core >= 2.2

/tmp/logstash-filter-grok (git)-[master] % bundle exec rspec
Using Accessor#strict_set for specs
NoMethodError: undefined method `pattern_path' for LogStash::Environment:Module
             Grok at /private/tmp/logstash-filter-grok/lib/logstash/filters/grok.rb:226
           (root) at /private/tmp/logstash-filter-grok/lib/logstash/filters/grok.rb:139
          require at org/jruby/RubyKernel.java:1040
          require at /Users/joaoduarte/.rvm/gems/jruby-1.7.23/gems/polyglot-0.3.5/lib/polyglot.rb:65
           (root) at /private/tmp/logstash-filter-grok/spec/filters/grok_spec.rb:1
             load at org/jruby/RubyKernel.java:1059
           (root) at /private/tmp/logstash-filter-grok/spec/filters/grok_spec.rb:11
             each at org/jruby/RubyArray.java:1613
           (root) at /Users/joaoduarte/.rvm/gems/jruby-1.7.23/gems/rspec-core-3.1.7/lib/rspec/core/configuration.rb:1
  load_spec_files at /Users/joaoduarte/.rvm/gems/jruby-1.7.23/gems/rspec-core-3.1.7/lib/rspec/core/configuration.rb:1105
  load_spec_files at /Users/joaoduarte/.rvm/gems/jruby-1.7.23/gems/rspec-core-3.1.7/lib/rspec/core/configuration.rb:1105
            setup at /Users/joaoduarte/.rvm/gems/jruby-1.7.23/gems/rspec-core-3.1.7/lib/rspec/core/runner.rb:96
              run at /Users/joaoduarte/.rvm/gems/jruby-1.7.23/gems/rspec-core-3.1.7/lib/rspec/core/runner.rb:84
              run at /Users/joaoduarte/.rvm/gems/jruby-1.7.23/gems/rspec-core-3.1.7/lib/rspec/core/runner.rb:69
             load at org/jruby/RubyKernel.java:1059
           invoke at /Users/joaoduarte/.rvm/gems/jruby-1.7.23/gems/rspec-core-3.1.7/lib/rspec/core/runner.rb:37
             eval at org/jruby/RubyKernel.java:1079
           (root) at /Users/joaoduarte/.rvm/gems/jruby-1.7.23/bin/jruby_executable_hooks:15

this happens because LogStash::Environment.pattern_path is not defined in logstash-core gem but instead in the boostrapping code

jsvd avatar Feb 04 '16 19:02 jsvd

I have the same issue

carlphilipp avatar Feb 11 '16 21:02 carlphilipp

This continues to be an issue for plugins that depend on logstash-filter-grok because, while v2.0.4 has the fix, v2.0.4 was never pushed to RubyGems.

elyscape avatar Mar 22 '16 22:03 elyscape

Just had this discussion with @elyscape on IRC about this: here's my assessment:

colinsurprenant: Elyscape: yeah, ok, I get it now… - outside the context of running logstash, pattern_path is underfined because it’s only part of the bootstrap. but pattern_path is only defined in the grok specs to have the test pass outside the logstash context but any other plugins depending on grok which covers the grok usage will also fail because pattern_parth is still undefined. [4:41pm]

so yeah, we need to either re-relocate pattern_path or having it correctly exposed to that any downstream plugins that depend on grok can run their specs which uses grok.

colinsurprenant avatar Mar 23 '16 20:03 colinsurprenant

forgot to also add @markwalkom

colinsurprenant avatar Mar 24 '16 03:03 colinsurprenant

I opened elastic/logstash#4928 for this

colinsurprenant avatar Mar 30 '16 15:03 colinsurprenant