test-kitchen icon indicating copy to clipboard operation
test-kitchen copied to clipboard

cookbook_files_glob setting is too broad

Open coderanger opened this issue 10 years ago • 2 comments

The default :cookbook_files_glob for the Chef provisioners is too generous.

Compare https://github.com/test-kitchen/test-kitchen/blob/master/lib/kitchen/provisioner/chef_base.rb#L53-L57 to https://github.com/chef/chef/blob/master/lib/chef/cookbook/cookbook_version_loader.rb#L81-L88. We should tighten that glob to match Chef's behavior or cookbooks will appear to work in tests but fail with chef-client.

coderanger avatar Jan 29 '16 01:01 coderanger

Also because the behavior is weird, the way that glob is used is to prune "non-cookbook" files from the sandbox before transfer to the instance.

coderanger avatar Jan 29 '16 01:01 coderanger

for libraries i think we fixed this the other way in core chef here:

https://github.com/chef/chef/pull/4640

resources and providers i think are still only *.rb files and do not recursively descend so those should probably be fixed.

lamont-granquist avatar Nov 08 '16 20:11 lamont-granquist