puppet-agent build fails on facter unit test if ruby bundle is installed
Sprint:
Client Triage
Scrum Team:
Client Platform
The facter test runs ' {{bundle exec rspec'}} if {{bundle}} is found, however ' {{bundle install'}} has not been executed. Note this issue is not specific to the local engine, but other engines will likely be running the build in an environment where ruby {{bundle}} is not installed.
The Facter documentation says "If a ruby was found during configuration, execute the following command before running tests: $ bundle install --gemfile lib/Gemfile"
The CMakeLists.txt file checks for the existence of the ruby and bundle commands. If both are found, the test is added.
Error: {code} 2: Test command: /tmp/ruby/gems/bin/bundle "exec" "rspec" 2: Test timeout computed to be: 9.99988e+06 2: /tmp/ruby/gems/gems/bundler-1.11.2/lib/bundler/resolver.rb:354:in `block in verify_gemfile_dependencies_are_found!': Could not find gem 'rspec (~> 2.11.0)' in any of the gem sources listed in your Gemfile or available on this machine. (Bundler::GemNotFound) 2: from /tmp/ruby/gems/gems/bundler-1.11.2/lib/bundler/resolver.rb:330:in `each' 2: from /tmp/ruby/gems/gems/bundler-1.11.2/lib/bundler/resolver.rb:330:in `verify_gemfile_dependencies_are_found!' 2: from /tmp/ruby/gems/gems/bundler-1.11.2/lib/bundler/resolver.rb:199:in `start' 2: from /tmp/ruby/gems/gems/bundler-1.11.2/lib/bundler/resolver.rb:183:in `resolve' 2: from /tmp/ruby/gems/gems/bundler-1.11.2/lib/bundler/definition.rb:198:in `resolve' 2: from /tmp/ruby/gems/gems/bundler-1.11.2/lib/bundler/definition.rb:137:in `specs' 2: from /tmp/ruby/gems/gems/bundler-1.11.2/lib/bundler/definition.rb:182:in `specs_for' 2: from /tmp/ruby/gems/gems/bundler-1.11.2/lib/bundler/definition.rb:171:in `requested_specs' 2: from /tmp/ruby/gems/gems/bundler-1.11.2/lib/bundler/environment.rb:18:in `requested_specs' 2: from /tmp/ruby/gems/gems/bundler-1.11.2/lib/bundler/runtime.rb:13:in `setup' 2: from /tmp/ruby/gems/gems/bundler-1.11.2/lib/bundler.rb:92:in `setup' 2: from /tmp/ruby/gems/gems/bundler-1.11.2/lib/bundler/setup.rb:18:in `<top (required)>' 2: from /opt/puppetlabs/puppet/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require' 2: from /opt/puppetlabs/puppet/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require' 2/3 Test #2: libfacter specs ..................***Failed 0.34 sec test 3 Start 3: facter smoke {code}
The way we handle rspec is messy and requires manual setup. This causes packaging to fail if trying to do a local packaging build. We could do bundle setup in the project bin directory as part of make test, and use it to run specs; or separate rspec out of make test, and require multiple manual steps.
This could also be fixed by running bundle install before make test in puppet-agent.
Per discussion in triage, we don't think we've ever gotten any value out of running these during the vanagon build. We are inclined to just remove that step from the Vanagon project. We already disable them on several platforms where running them is difficult.