btm / minitest-handler-cookbook

Apache License 2.0
59 stars 36 forks source link

Why do this cookbook forces to have a test/support dir for every cookbook? #24

Closed millisami closed 12 years ago

millisami commented 12 years ago

Hi, I've added minitest-handler and added a test for one my cookbook.

Now when it runs, it checks for support directory for everyother cookbooks I've.

Doesn't matter how many cookbooks I've, I just want to add test for my cookbook only.

So, how to tell minitest-handler to just run the specs of my cookbook and don't care other cookbooks have tests or not?

.........
Compiled Resource:
------------------
# Declared in /var/cache/chef/cookbooks/minitest-handler/recipes/default.rb:53:in `block in from_file'

cookbook_file("tests-phpmyadmin-privileges") do
  provider Chef::Provider::CookbookFile
  action "create"
  ignore_failure true
  retries 0
  retry_delay 2
  path "/var/chef/minitest/phpmyadmin/privileges_test.rb"
  backup 5
  source "tests/minitest/privileges_test.rb"
  cookbook "phpmyadmin"
  cookbook_name "minitest-handler"
  recipe_name "default"
end

[2012-10-08T09:01:34+00:00] INFO: Processing remote_directory[tests-support-phpmyadmin-privileges] action create (minitest-handler::default line 60)
[2012-10-08T09:01:34+00:00] ERROR: remote_directory[tests-support-phpmyadmin-privileges] (minitest-handler::default line 60) had an error: cookbook phpmyadmin has no directory files/default/tests/minitest/support; ignore_failure is set, continuing

================================================================================
Error executing action `create` on resource 'remote_directory[tests-support-phpmyadmin-privileges]'
================================================================================

Chef::Exceptions::FileNotFound
------------------------------
cookbook phpmyadmin has no directory files/default/tests/minitest/support

Resource Declaration:
---------------------
# In /var/cache/chef/cookbooks/minitest-handler/recipes/default.rb

 60:     remote_directory "tests-support-#{cookbook_name}-#{recipe_name}" do
 61:       source "tests/minitest/support"
 62:       cookbook cookbook_name
 63:       path "#{node['minitest']['path']}/#{cookbook_name}/support"
 64:       recursive true
 65:       ignore_failure true
 66:     end
 67:   end
................
leifmadsen commented 12 years ago

I'll give you that this is fairly ugly, but I think it was a change in Chef directly that causes the extra text output. I've run this on older versions of Chef and the output isn't as verbose. While it is verbose, there is no error or bug here.

bryanwb commented 12 years ago

it is more verbose cuz kallistec improved the output formatters

On Wed, Oct 10, 2012 at 2:39 PM, Leif Madsen notifications@github.comwrote:

I'll give you that this is fairly ugly, but I think it was a change in Chef directly that causes the extra text output. I've run this on older versions of Chef and the output isn't as verbose. While it is verbose, there is no error or bug here.

— Reply to this email directly or view it on GitHubhttps://github.com/btm/minitest-handler-cookbook/issues/24#issuecomment-9300075.

leifmadsen commented 12 years ago

It's certainly nice when you're wondering why your tests aren't triggering :) Seems like this can be closed as "not a bug" though.

millisami commented 12 years ago

Does it ignore the failure and the run will continue? Coz I've tried couple of times before posting this here and it was halting the run saying with exist code non-zero the chef run just stops!

bryanwb commented 12 years ago

wow, it should just continue, that is why ignore_failure true is set

r u sure you aren't getting a non-zero error due to something else?

On Wed, Oct 10, 2012 at 8:18 PM, millisami notifications@github.com wrote:

Does it ignore the failure and the run will continue? Coz I've tried couple of times before posting this here and it was halting the run saying with exist code non-zero the chef run just stops!

— Reply to this email directly or view it on GitHubhttps://github.com/btm/minitest-handler-cookbook/issues/24#issuecomment-9313685.

leifmadsen commented 12 years ago

That's what I've always seen as well. It doesn't actually error out or cause any ill effects.

bryanwb commented 12 years ago

hey guys, am closing this as I can't replicate it