chef-boneyard / minitest-chef-handler

Run minitest suites after your Chef recipes to check the status of your system.
Other
163 stars 44 forks source link

fix chef deps #85

Closed lamont-granquist closed 9 years ago

lamont-granquist commented 9 years ago

having the gem install try to upgrade chef and ohai causes quite a bit of chaos. strictly this gem does 'depend' on chef, but it makes no sense to install it into a ruby which does not have chef and we really don't want the side effect of having various shitty versions of rubygems depsolver go and install chef and ohai. its preserved as dev dep so that bundle install will pick up chef for testing.

chef-12 and ohai-8 no longer support ruby 1.9.3 so travis fails without this. it would be possible to use 1.9.3 and pin against chef 11 in order to test against that, but its probably more important to start testing against chef-12 on ruby >= 2.0.

lamont-granquist commented 9 years ago

Well that got further, but I'm unsure what the rest of the spec failures are now.

FestivalBobcats commented 9 years ago

I've seen related issues on the main Chef repo, but I'm thinking I may get a better answer in this thread:

I have a massive app that's used Chef (chef solo) 11.6 and the minitest handler for nearly a year, and just yesterday I tried to run the tests and it broke saying:

ohai requires Ruby version >= 2.0.0.

I attempted to upgrade Ruby to 2.0 and Chef to 12.0.0, but that seemed to cause a major memory-hogging situation that completely wrecks our setup -- we install software on nodes as small as 512mb RAM, and it looks like the Chef run almost kills nodes that size when I'm on Ruby 2 and Chef 12. The Ruby 2 install alone is overkill for what we're trying to achieve.

My question:

How do I lock the minitest handler to Chef 11? Is this a dependency issue with Ohai/Chef itself? I'm utterly confused at this point.

Note: I tried to hack the minitest-handler cookbook into using this PR's github repository, but that didn't change the error.

lamont-granquist commented 9 years ago

this patch would make installing minitest handler stop trying to install chef, which would fix the problem. or you could use bundler to lock it yourself. or maybe upgrade your rubygems so that its less aggressive about upgrading deps and/or understands how to remove ohai-8 from the depsolving solution.

FestivalBobcats commented 9 years ago

What's odd is that your patch doesn't seem to change the issue. I'm still seeing the same ohai requires Ruby version >= 2.0.0. error. Here's what I've done in the minitest cookbook's recipe:

# chef_gem "minitest-chef-handler" do
#   action :nothing
# end.run_action(:install)

git '/usr/local/src/minitest-chef-handler' do
  repository 'https://github.com/lamont-granquist/minitest-chef-handler.git'
  action :nothing
end.run_action(:sync)

execute 'gem build minitest-chef-handler.gemspec' do
  cwd '/usr/local/src/minitest-chef-handler'
  action :nothing
end.run_action(:run)

chef_gem 'minitest-chef-handler' do
  source '/usr/local/src/minitest-chef-handler/minitest-chef-handler-1.0.3.gem'
end

Gem.clear_paths
# Ensure minitest gem is utilized
require "minitest-chef-handler"

Is there something else I need to do here?

FestivalBobcats commented 9 years ago

Okay, I think I may have fixed it by pointing to revision 566346d068fd98f943fc1d6c7bf6701029ef7228.

lamont-granquist commented 9 years ago

Yeah, you were pulling master...

FestivalBobcats commented 9 years ago

:neutral_face: