# Chef Run Errors with Minitest-Handler

**URL:** <https://discourse.chef.io/t/chef-run-errors-with-minitest-handler/3370>\
**Category:** Chef Infra (archive)\
**Created:** [December 2, 2012, 9:15pm UTC](https://discourse.chef.io/t/chef-run-errors-with-minitest-handler/3370 "2012-12-02T21:15:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Torben\_Knerr](https://avatars.discourse-cdn.com/v4/letter/t/ba8739/32.png) [@Torben\_Knerr](https://discourse.chef.io/u/Torben_Knerr)\
**Post date:** [December 2, 2012, 9:15pm UTC](https://discourse.chef.io/t/chef-run-errors-with-minitest-handler/3370/1 "2012-12-02T21:15:13Z")

</div>

Hi everybody,

I’m using the minitest-handler cookbook. The tests pass and the chef run  
seems to be successful in the end, but there are lots of errors logged to  
stdoud, e.g.:

[2012-12-02T20:47:52+00:00] INFO:  
remote\_directory[tests-support-tdd-example-default] created directory  
/var/chef/minitest/tdd-example/support

[2012-12-02T20:47:52+00:00] ERROR:  
remote\_directory[tests-support-tdd-example-default]  
(minitest-handler::default line 60) had an error: cookbook tdd-exam

ple has no directory files/default/tests/minitest/support;  
ignore\_failure is set, continuing

================================================================================

Error executing action `create` on resource  
’remote\_directory[tests-support-tdd-example-default]’

================================================================================

Chef::Exceptions::FileNotFound

* * *

cookbook tdd-example has no directory files/default/tests/minitest/support

Resource Declaration:

* * *

# In /tmp/vagrant-chef-1/chef-solo-1/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

Compiled Resource:

* * *

# Declared in /tmp/vagrant-chef-1/chef-solo-1/cookbooks/minitest-handler/recipes/default.rb:60:in

`block in from\_file’

remote\_directory(“tests-support-tdd-example-default”) do  
provider Chef::Provider::RemoteDirectory

action :create  
ignore\_failure true

retries 0  
retry\_delay 2  
path "/var/chef/minitest/tdd-example/support"  
recursive true  
source "tests/minitest/support"  
files\_backup 5  
files\_mode 420

overwrite true  
cookbook “tdd-example”

cookbook\_name :"minitest-handler"  
recipe\_name “default”

end

Full chef run output here:

> <https://gist.github.com/tknerr/4191017>

Is this the expected behaviour?

Cheers,  
Torben

---

<div class="post-metadata">

**Author:** ![Steven\_Danna](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/steven_danna/32/195_2.png) [@Steven\_Danna](https://discourse.chef.io/u/Steven_Danna)\
**Post date:** [December 2, 2012, 11:42pm UTC](https://discourse.chef.io/t/chef-run-errors-with-minitest-handler/3370/2 "2012-12-02T23:42:08Z")

</div>

On 12/2/12 1:15 PM, Torben Knerr wrote:

> Hi everybody,
> 
> Is this the expected behaviour?

It is expected in the sense that this is currently the output you will  
see for any cookbooks in the run\_list that don't have tests defined. In  
previous versions of Chef the error output was likely less intrusive  
since we didn't have error inspectors outputting what is usually very  
helpful information.

I just opened a pull request here:

> <https://github.com/btm/minitest-handler-cookbook/pull/25>
>
> The remote\_directory and cookbook\_file resources uses ignore\_failure
> to account …for cookbooks that do not have tests or support files.
> However, with the addition of error inspectors, the errors these
> resources raise produce a large amount of output that obfuscates the
> test results. The following link has an example of the problematic
> output:
> 
> https://gist.github.com/4191403
> 
> This commit tests for the exists of the tests and support and run-time
> and produces more consise output:
> 
> \`\`\`
> WARN: No tests found for test-kitchen::default!
> DEBUG: No support files found for test-kitchen::default.
> \`\`\`
> 
> Note that this depends on internal implementation details of the
> Chef::CookbookVersion class which may increase the maintenance burden
> of this cookbook.

It is a bit of a hack but it does reduce the noise substantially.

Cheers,

Steven

--  
Steven Danna  
Systems Engineer, Opscode, Inc  
GPG Key: [http://stevendanna.github.com/downloads/code/public.key](http://stevendanna.github.com/downloads/code/public.key)
