Is there a low-key test framework?


#1

I’ve got recipe code that’s pure Ruby, assembling information from
attributes, data bags, etc. that’s then consumed by more Cheffy code.

I’m looking for a way to “contribute” the plainer Ruby parts to a script
that would exercise them.

At present, I simply have those bits copied out into stand-alone scripts
I can run.

I’m new to Chef and to Ruby. I’m having fun, but I’m getting serious now
about using the very recipes I’ve been writing in a genuine production
environment.

I’d like a suggestion or two pointing me to some simple frameworks, even
if they tested Chef in addition to mere Ruby code.

Thanks,

Russ


#2

are you looking for unit testing or integration testing? rspec & chefspec
can help you our with unit testing ruby modules+ chef cookbooks. If you
want to test bare minimum convergence you can use vagrant with chef
provisioner to test , incrementally you can add mini-test bases tests and
test-kitchen. It really depends upon what you want to test first?
Integration testing is a bit of more work/slow, but its way better than the
early days :slight_smile:

On Wed, Sep 25, 2013 at 10:34 AM, Russell Bateman russ@windofkeltia.comwrote:

I’ve got recipe code that’s pure Ruby, assembling information from
attributes, data bags, etc. that’s then consumed by more Cheffy code.

I’m looking for a way to “contribute” the plainer Ruby parts to a script
that would exercise them.

At present, I simply have those bits copied out into stand-alone scripts I
can run.

I’m new to Chef and to Ruby. I’m having fun, but I’m getting serious now
about using the very recipes I’ve been writing in a genuine production
environment.

I’d like a suggestion or two pointing me to some simple frameworks, even
if they tested Chef in addition to mere Ruby code.

Thanks,

Russ