I am building logstash 1.5.3-1 from source. When I run the core unit tests using rspec, they all pass, but when I run them using rake, a bunch fail.
My environment is an ubuntu trusty docker container on Docker for Mac.
Here are some of my setup actions and configuration settings:
cd /root/source
git clone -b 'v1.5.3.snapshot1' --single-branch --depth 1 https://github.com/elastic/logstash
edit Gemfile and add lines:
gem "tins", "<1.7"
gem "backports", "3.6.8"
export JRUBY_OPTS=--1.9
export GEM_HOME=/root/source/logstash/vendor/bundle/jruby/1.9
export GEM_PATH=/root/source/logstash/vendor/bundle/jruby/1.9/gems
export PATH=/root/source/logstash/vendor/bundle/jruby/1.9/bin:$PATH
export PATH=/root/source/logstash/vendor/jruby/bin:/root/source/logstash/vendor/bundle/jruby/1.9/bin:$PATH
export PATH=/root/source/logstash/bin:$PATH
export RUBYLIB=/root/source/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.3.snapshot1-java/lib
bundle install
rake bootstrap
rake plugin:install-default
rake test:install-core
rake test:core
The following runs the tests just fine:
rspec spec/**/*_spec.rb
When I run rake test:core as above, I get many errors that all look the same. Here is the first:
Failures:
1) truncating unicode strings correctly randomized testing should be near the boundary of requested size
Failure/Error: subject { LogStash::Util::UnicodeTrimmer }
NameError:
uninitialized constant LogStash::Util::UnicodeTrimmer
# ./spec/util/unicode_trimmer_spec.rb:12:in `subject'
# ./spec/util/unicode_trimmer_spec.rb:52:in `(root)'
# ./vendor/bundle/jruby/1.9/gems/rspec-wait-0.0.9/lib/rspec/wait.rb:46:in `(root)'
# ./rakelib/test.rake:32:in `(root)'
# ./vendor/bundle/jruby/1.9/gems/rake-11.3.0/lib/rake/task.rb:248:in `execute'
# ./vendor/bundle/jruby/1.9/gems/rake-11.3.0/lib/rake/task.rb:243:in `execute'
# ./vendor/bundle/jruby/1.9/gems/rake-11.3.0/lib/rake/task.rb:187:in `invoke_with_call_chain'
# ./vendor/bundle/jruby/1.9/gems/rake-11.3.0/lib/rake/task.rb:180:in `invoke_with_call_chain'
# ./vendor/bundle/jruby/1.9/gems/rake-11.3.0/lib/rake/task.rb:173:in `invoke'
# ./vendor/bundle/jruby/1.9/gems/rake-11.3.0/lib/rake/application.rb:152:in `invoke_task'
# ./vendor/bundle/jruby/1.9/gems/rake-11.3.0/lib/rake/application.rb:108:in `top_level'
# ./vendor/bundle/jruby/1.9/gems/rake-11.3.0/lib/rake/application.rb:108:in `top_level'
# ./vendor/bundle/jruby/1.9/gems/rake-11.3.0/lib/rake/application.rb:117:in `run_with_threads'
# ./vendor/bundle/jruby/1.9/gems/rake-11.3.0/lib/rake/application.rb:102:in `top_level'
# ./vendor/bundle/jruby/1.9/gems/rake-11.3.0/lib/rake/application.rb:80:in `run'
# ./vendor/bundle/jruby/1.9/gems/rake-11.3.0/lib/rake/application.rb:178:in `standard_exception_handling'
# ./vendor/bundle/jruby/1.9/gems/rake-11.3.0/lib/rake/application.rb:77:in `run'
# ./vendor/bundle/jruby/1.9/gems/rake-11.3.0/exe/rake:27:in `(root)'
Of course, attempts to add a -r switch to the rake file for this file fail:
/root/source/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.3.snapshot1-java/lib/logstash/util/unicode_trimmer.rb
The file is there, but can't be found. I do not know where to make the change that will cause this file to be found. Environment variable? Change to rake file? Elsewhere? I am a novice at ruby and rake.
logstash uses jruby and a custom rake, rspec:
jruby 1.7.20 (1.9.3p551) 2015-05-04 3086e6a on OpenJDK 64-Bit Server VM 1.7.0_121-b00 +jit [linux-amd64]
rake, version 11.3.0
rspec, version 3.1.5