# Minitest-handler cookbook issue

**URL:** <https://discourse.chef.io/t/minitest-handler-cookbook-issue/3254>\
**Category:** Chef Infra (archive)\
**Created:** [October 9, 2012, 6:51am UTC](https://discourse.chef.io/t/minitest-handler-cookbook-issue/3254 "2012-10-09T06:51:58Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![millisami\_r](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/millisami_r/32/418_2.png) [@millisami\_r](https://discourse.chef.io/u/millisami_r)\
**Post date:** [October 9, 2012, 6:51am UTC](https://discourse.chef.io/t/minitest-handler-cookbook-issue/3254/1 "2012-10-09T06:51:58Z")

</div>

Ohai Chefs!

I gave a shot on doing integration testing with the minitest-handler cookbook.  
But it bit me on the first run.  
Can anyone testing chef have a few mins on this issue [https://github.com/btm/minitest-handler-cookbook/issues/24](https://github.com/btm/minitest-handler-cookbook/issues/24) ?

* * *

@millisami  
~ Sachin Sagar Rai  
Ruby on Rails Developer  
[http://tfm.com.np](http://tfm.com.np)  
[http://nepalonrails.tumblr.com](http://nepalonrails.tumblr.com)  
Sent with Sparrow ([http://www.sparrowmailapp.com/?sig](http://www.sparrowmailapp.com/?sig))

---

<div class="post-metadata">

**Author:** ![steve](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/steve/32/294_2.png) [@steve](https://discourse.chef.io/u/steve)\
**Post date:** [October 9, 2012, 5:56pm UTC](https://discourse.chef.io/t/minitest-handler-cookbook-issue/3254/2 "2012-10-09T17:56:06Z")

</div>

The minitest handler doesn't know you don't have tests written for  
those cookbooks. It's looping through all of the cookbooks for the  
recipes in the node's current run list and attempting to pull down  
test and support directories from all of them. These resources should  
be set to "ignore on failure," so it shouldn't cause your Chef run to  
bomb out if they're not there.

At the end of the run, the handler will load all of the tests that  
_did_ make it to the node and run them. If any of those tests fail,  
it will flag your run as failed and your exception handlers will then  
run.

If you find the behavior of the handler unsatisfying and find a better  
way to pull down tests from all cookbooks, I'm sure the maintainers of  
the minitest handler would love to see your improvement in the form of  
a pull request!

On Mon, Oct 8, 2012 at 11:51 PM, Sachin Sagar Rai [millisami@gmail.com](mailto:millisami@gmail.com) wrote:

> Ohai Chefs!
> 
> I gave a shot on doing integration testing with the minitest-handler  
> cookbook.  
> But it bit me on the first run.  
> Can anyone testing chef have a few mins on this issue  
> [Why do this cookbook forces to have a test/support dir for every cookbook? · Issue #24 · btm/minitest-handler-cookbook · GitHub](https://github.com/btm/minitest-handler-cookbook/issues/24) ?
> 
> * * *
> 
> @millisami  
> ~ Sachin Sagar Rai  
> Ruby on Rails Developer  
> [http://tfm.com.np](http://tfm.com.np)  
> [http://nepalonrails.tumblr.com](http://nepalonrails.tumblr.com)  
> Sent with Sparrow

---

<div class="post-metadata">

**Author:** ![millisami\_r](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/millisami_r/32/418_2.png) [@millisami\_r](https://discourse.chef.io/u/millisami_r)\
**Post date:** [October 9, 2012, 6:09pm UTC](https://discourse.chef.io/t/minitest-handler-cookbook-issue/3254/3 "2012-10-09T18:09:27Z")

</div>

Thanks for the reply.

But still wondering where to put that 'ignore on failure' line? In tests?

Where to put it exactly?

* * *

@millisami  
~ Sachin Sagar Rai  
Ruby on Rails Developer  
[http://tfm.com.np](http://tfm.com.np)  
[http://nepalonrails.tumblr.com](http://nepalonrails.tumblr.com)  
Sent with Sparrow ([http://www.sparrowmailapp.com/?sig](http://www.sparrowmailapp.com/?sig))

On Tuesday, October 9, 2012 at 11:41 PM, steve . wrote:

> The minitest handler doesn't know you don't have tests written for  
> those cookbooks. It's looping through all of the cookbooks for the  
> recipes in the node's current run list and attempting to pull down  
> test and support directories from all of them. These resources should  
> be set to "ignore on failure," so it shouldn't cause your Chef run to  
> bomb out if they're not there.
> 
> At the end of the run, the handler will load all of the tests that  
> _did_ make it to the node and run them. If any of those tests fail,  
> it will flag your run as failed and your exception handlers will then  
> run.
> 
> If you find the behavior of the handler unsatisfying and find a better  
> way to pull down tests from all cookbooks, I'm sure the maintainers of  
> the minitest handler would love to see your improvement in the form of  
> a pull request!
> 
> On Mon, Oct 8, 2012 at 11:51 PM, Sachin Sagar Rai \<[millisami@gmail.com](mailto:millisami@gmail.com) ([mailto:millisami@gmail.com](mailto:millisami@gmail.com))\> wrote:
> 
> > Ohai Chefs!
> > 
> > I gave a shot on doing integration testing with the minitest-handler  
> > cookbook.  
> > But it bit me on the first run.  
> > Can anyone testing chef have a few mins on this issue  
> > [Why do this cookbook forces to have a test/support dir for every cookbook? · Issue #24 · btm/minitest-handler-cookbook · GitHub](https://github.com/btm/minitest-handler-cookbook/issues/24) ?
> > 
> > * * *
> > 
> > @millisami  
> > ~ Sachin Sagar Rai  
> > Ruby on Rails Developer  
> > [http://tfm.com.np](http://tfm.com.np)  
> > [http://nepalonrails.tumblr.com](http://nepalonrails.tumblr.com)  
> > Sent with Sparrow

---

<div class="post-metadata">

**Author:** ![Bryan\_Berry](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/bryan_berry/32/213_2.png) [@Bryan\_Berry](https://discourse.chef.io/u/Bryan_Berry)\
**Post date:** [October 10, 2012, 6:19am UTC](https://discourse.chef.io/t/minitest-handler-cookbook-issue/3254/4 "2012-10-10T06:19:54Z")

</div>

Namaste Sachin

I wrote some of that code, it just checks whether any of the recipes  
in the run\_list also have tests. If it were smarter it would allow you  
to filter for only those tests that you want run. There currently is  
no way to do that though I would love to add that functionality

On Tue, Oct 9, 2012 at 8:09 PM, Sachin Sagar Rai [millisami@gmail.com](mailto:millisami@gmail.com) wrote:

> Thanks for the reply.
> 
> But still wondering where to put that 'ignore on failure' line? In tests?
> 
> Where to put it exactly?
> 
> * * *
> 
> @millisami  
> ~ Sachin Sagar Rai  
> Ruby on Rails Developer  
> [http://tfm.com.np](http://tfm.com.np)  
> [http://nepalonrails.tumblr.com](http://nepalonrails.tumblr.com)  
> Sent with Sparrow
> 
> On Tuesday, October 9, 2012 at 11:41 PM, steve . wrote:
> 
> The minitest handler doesn't know you don't have tests written for  
> those cookbooks. It's looping through all of the cookbooks for the  
> recipes in the node's current run list and attempting to pull down  
> test and support directories from all of them. These resources should  
> be set to "ignore on failure," so it shouldn't cause your Chef run to  
> bomb out if they're not there.
> 
> At the end of the run, the handler will load all of the tests that  
> _did_ make it to the node and run them. If any of those tests fail,  
> it will flag your run as failed and your exception handlers will then  
> run.
> 
> If you find the behavior of the handler unsatisfying and find a better  
> way to pull down tests from all cookbooks, I'm sure the maintainers of  
> the minitest handler would love to see your improvement in the form of  
> a pull request!
> 
> On Mon, Oct 8, 2012 at 11:51 PM, Sachin Sagar Rai [millisami@gmail.com](mailto:millisami@gmail.com)  
> wrote:
> 
> Ohai Chefs!
> 
> I gave a shot on doing integration testing with the minitest-handler  
> cookbook.  
> But it bit me on the first run.  
> Can anyone testing chef have a few mins on this issue  
> [Why do this cookbook forces to have a test/support dir for every cookbook? · Issue #24 · btm/minitest-handler-cookbook · GitHub](https://github.com/btm/minitest-handler-cookbook/issues/24) ?
> 
> * * *
> 
> @millisami  
> ~ Sachin Sagar Rai  
> Ruby on Rails Developer  
> [http://tfm.com.np](http://tfm.com.np)  
> [http://nepalonrails.tumblr.com](http://nepalonrails.tumblr.com)  
> Sent with Sparrow

---

<div class="post-metadata">

**Author:** ![steve](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/steve/32/294_2.png) [@steve](https://discourse.chef.io/u/steve)\
**Post date:** [October 10, 2012, 6:28am UTC](https://discourse.chef.io/t/minitest-handler-cookbook-issue/3254/5 "2012-10-10T06:28:11Z")

</div>

I guess you could put a whitelist/blacklist set of tests (or maybe  
regexes?) into the node data, namespaced appropriately for the  
minitest handler... the handler has access to this data during its  
run, so it would be able to pick that up and filter its cookbook file  
walk appropriately.

Anyone else want that functionality? I mean, I could see at least  
some use for it, though for my current work setup it's not  
critical-path...

On Tue, Oct 9, 2012 at 11:19 PM, Bryan Berry [bryan.berry@gmail.com](mailto:bryan.berry@gmail.com) wrote:

> Namaste Sachin
> 
> I wrote some of that code, it just checks whether any of the recipes  
> in the run\_list also have tests. If it were smarter it would allow you  
> to filter for only those tests that you want run. There currently is  
> no way to do that though I would love to add that functionality
> 
> On Tue, Oct 9, 2012 at 8:09 PM, Sachin Sagar Rai [millisami@gmail.com](mailto:millisami@gmail.com) wrote:
> 
> > Thanks for the reply.
> > 
> > But still wondering where to put that 'ignore on failure' line? In tests?
> > 
> > Where to put it exactly?
> > 
> > * * *
> > 
> > @millisami  
> > ~ Sachin Sagar Rai  
> > Ruby on Rails Developer  
> > [http://tfm.com.np](http://tfm.com.np)  
> > [http://nepalonrails.tumblr.com](http://nepalonrails.tumblr.com)  
> > Sent with Sparrow
> > 
> > On Tuesday, October 9, 2012 at 11:41 PM, steve . wrote:
> > 
> > The minitest handler doesn't know you don't have tests written for  
> > those cookbooks. It's looping through all of the cookbooks for the  
> > recipes in the node's current run list and attempting to pull down  
> > test and support directories from all of them. These resources should  
> > be set to "ignore on failure," so it shouldn't cause your Chef run to  
> > bomb out if they're not there.
> > 
> > At the end of the run, the handler will load all of the tests that  
> > _did_ make it to the node and run them. If any of those tests fail,  
> > it will flag your run as failed and your exception handlers will then  
> > run.
> > 
> > If you find the behavior of the handler unsatisfying and find a better  
> > way to pull down tests from all cookbooks, I'm sure the maintainers of  
> > the minitest handler would love to see your improvement in the form of  
> > a pull request!
> > 
> > On Mon, Oct 8, 2012 at 11:51 PM, Sachin Sagar Rai [millisami@gmail.com](mailto:millisami@gmail.com)  
> > wrote:
> > 
> > Ohai Chefs!
> > 
> > I gave a shot on doing integration testing with the minitest-handler  
> > cookbook.  
> > But it bit me on the first run.  
> > Can anyone testing chef have a few mins on this issue  
> > [Why do this cookbook forces to have a test/support dir for every cookbook? · Issue #24 · btm/minitest-handler-cookbook · GitHub](https://github.com/btm/minitest-handler-cookbook/issues/24) ?
> > 
> > * * *
> > 
> > @millisami  
> > ~ Sachin Sagar Rai  
> > Ruby on Rails Developer  
> > [http://tfm.com.np](http://tfm.com.np)  
> > [http://nepalonrails.tumblr.com](http://nepalonrails.tumblr.com)  
> > Sent with Sparrow

---

<div class="post-metadata">

**Author:** ![Bryan\_Berry](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/bryan_berry/32/213_2.png) [@Bryan\_Berry](https://discourse.chef.io/u/Bryan_Berry)\
**Post date:** [October 10, 2012, 6:32am UTC](https://discourse.chef.io/t/minitest-handler-cookbook-issue/3254/6 "2012-10-10T06:32:07Z")

</div>

i think cucumber and rspec use tags "@foobar" to filter the tests to  
run, i would try to support that filtering mechanism rather than  
whitelist/blacklist

On Wed, Oct 10, 2012 at 8:28 AM, steve . [leftathome@gmail.com](mailto:leftathome@gmail.com) wrote:

> I guess you could put a whitelist/blacklist set of tests (or maybe  
> regexes?) into the node data, namespaced appropriately for the  
> minitest handler... the handler has access to this data during its  
> run, so it would be able to pick that up and filter its cookbook file  
> walk appropriately.
> 
> Anyone else want that functionality? I mean, I could see at least  
> some use for it, though for my current work setup it's not  
> critical-path...
> 
> On Tue, Oct 9, 2012 at 11:19 PM, Bryan Berry [bryan.berry@gmail.com](mailto:bryan.berry@gmail.com) wrote:
> 
> > Namaste Sachin
> > 
> > I wrote some of that code, it just checks whether any of the recipes  
> > in the run\_list also have tests. If it were smarter it would allow you  
> > to filter for only those tests that you want run. There currently is  
> > no way to do that though I would love to add that functionality
> > 
> > On Tue, Oct 9, 2012 at 8:09 PM, Sachin Sagar Rai [millisami@gmail.com](mailto:millisami@gmail.com) wrote:
> > 
> > > Thanks for the reply.
> > > 
> > > But still wondering where to put that 'ignore on failure' line? In tests?
> > > 
> > > Where to put it exactly?
> > > 
> > > * * *
> > > 
> > > @millisami  
> > > ~ Sachin Sagar Rai  
> > > Ruby on Rails Developer  
> > > [http://tfm.com.np](http://tfm.com.np)  
> > > [http://nepalonrails.tumblr.com](http://nepalonrails.tumblr.com)  
> > > Sent with Sparrow
> > > 
> > > On Tuesday, October 9, 2012 at 11:41 PM, steve . wrote:
> > > 
> > > The minitest handler doesn't know you don't have tests written for  
> > > those cookbooks. It's looping through all of the cookbooks for the  
> > > recipes in the node's current run list and attempting to pull down  
> > > test and support directories from all of them. These resources should  
> > > be set to "ignore on failure," so it shouldn't cause your Chef run to  
> > > bomb out if they're not there.
> > > 
> > > At the end of the run, the handler will load all of the tests that  
> > > _did_ make it to the node and run them. If any of those tests fail,  
> > > it will flag your run as failed and your exception handlers will then  
> > > run.
> > > 
> > > If you find the behavior of the handler unsatisfying and find a better  
> > > way to pull down tests from all cookbooks, I'm sure the maintainers of  
> > > the minitest handler would love to see your improvement in the form of  
> > > a pull request!
> > > 
> > > On Mon, Oct 8, 2012 at 11:51 PM, Sachin Sagar Rai [millisami@gmail.com](mailto:millisami@gmail.com)  
> > > wrote:
> > > 
> > > Ohai Chefs!
> > > 
> > > I gave a shot on doing integration testing with the minitest-handler  
> > > cookbook.  
> > > But it bit me on the first run.  
> > > Can anyone testing chef have a few mins on this issue  
> > > [Why do this cookbook forces to have a test/support dir for every cookbook? · Issue #24 · btm/minitest-handler-cookbook · GitHub](https://github.com/btm/minitest-handler-cookbook/issues/24) ?
> > > 
> > > * * *
> > > 
> > > @millisami  
> > > ~ Sachin Sagar Rai  
> > > Ruby on Rails Developer  
> > > [http://tfm.com.np](http://tfm.com.np)  
> > > [http://nepalonrails.tumblr.com](http://nepalonrails.tumblr.com)  
> > > Sent with Sparrow

---

<div class="post-metadata">

**Author:** ![Leif\_Madsen](https://avatars.discourse-cdn.com/v4/letter/l/e95f7d/32.png) [@Leif\_Madsen](https://discourse.chef.io/u/Leif_Madsen)\
**Post date:** [October 10, 2012, 12:26pm UTC](https://discourse.chef.io/t/minitest-handler-cookbook-issue/3254/7 "2012-10-10T12:26:37Z")

</div>

On 09/10/12 02:09 PM, Sachin Sagar Rai wrote:

> Thanks for the reply.
> 
> But still wondering where to put that 'ignore on failure' line? In tests?
> 
> Where to put it exactly?

What it comes down to, is you don't have to do anything. It's already  
ignoring the cookbooks with no tests. The output you see just happens to  
be overly verbose and ugly, but it's not affecting your run at all.

--  
Leif Madsen

> **[O'Reilly Media - Technology and Business Training](https://www.oreilly.com)**
>
> Gain technology and business knowledge and hone your skills with learning resources created and curated by O'Reilly's experts: live online training, video, books, our platform has content from 200+ of the world's best publishers.
