[chef-dev] Re: Question on Chef 12 Issue


Chronological Thread 
  • From: Lamont Granquist < >
  • To: David Petzel < >
  • Cc: Chef Dev < >
  • Subject: [chef-dev] Re: Question on Chef 12 Issue
  • Date: Fri, 05 Dec 2014 16:08:12 -0800


If its just that one resource that is broken, it might be core-chef (chef_gem is kind of simple, yet weird). If its all broken then its likely that chef-minitest-handler needs to be updated to hook properly into the provider_resolver stuff, or changed to call the correct API. Offhand its kind of hard to say. Either way could use an issue cut against chef on github for more investigation.

On Fri Dec  5 15:56:01 2014, David Petzel wrote:
I'm not entirely sure which side of the fence the issue lies on and
hoping someone might know
We use minitest-chef-handler for testing and we have a common pattern
of doing something like this:

require_relative "support/test_helper.rb"

describe_recipe 'cookbook::default' do
  include MyCokbook::Test::Helper
  MiniTest::Chef::Resources.register_resource(:chef_gem)
  describe "gems" do
    it "ensures the netaddr gem is installed" do
      chef_gem("netaddr").must_be_installed
    end
  end
end

The key line appears to be
MiniTest::Chef::Resources.register_resource(:chef_gem).

This worked on Chef 11, however is failing on Chef 12 with this error

ArgumentError: Cannot find a provider for chef_gem[netaddr] on centos
version 6.5
from
/opt/chef/embedded/apps/chef/lib/chef/platform/provider_mapping.rb:552:in
`find_provider'

Given the changes for the Dynamic Provider Resolver, does this appear
to be more of a Chef bug, or a breaking change that
minitest-chef-handler will need to updated to accomodate?

Thanks






Archive powered by MHonArc 2.6.16.

§