StackStorm / chef-stackstorm

DEPRECATED! Community-maintained Chef Cookbook to deploy StackStorm, IFTTT for Ops
https://supermarket.chef.io/cookbooks/stackstorm
Apache License 2.0
16 stars 10 forks source link

Multiplatform (Ubuntu 14.04 and Centos 7) ChefSpec testing #55

Closed jvrplmlmn closed 7 years ago

jvrplmlmn commented 7 years ago

Solves https://github.com/StackStorm/chef-stackstorm/issues/54

It is my first time writing multi-platform ChefSpec, so probably there is room for improvement.

WDYT @armab @shortdudey123 ?

arm4b commented 7 years ago

Thanks for trying it!

It looks pretty messed in Travis:

Apart of that, is it possible just to loop through the platforms in spec where tests are 100% identical? To avoid huge code duplication. Otherwise, I'm not sure if this going to be helpful.

So expectation and reality differs here dramatically :smiley: Most probably we'll discourage writing tests. IMO, if the process of adding tests/spec looks ugly, - we'd rather throw it and keep old state.

Thoughts?

jvrplmlmn commented 7 years ago

I have no idea why Travis shows that output...

When running KITCHEN_LOCAL_YAML=.kitchen.docker.yml /opt/chefdk/bin/chef exec rake default locally this is how the output is displayed:

image

jvrplmlmn commented 7 years ago

Apart of that, is it possible just to loop through the platforms in spec where tests are 100% identical? To avoid huge code duplication. Otherwise, I'm not sure if this going to be helpful.

@armab take a look at 414275b, I managed to get it done for a single spec. I'll try to get the rest done later on.

jvrplmlmn commented 7 years ago

I guess that there is some room for additional compactation in spec/recipes/_packages_spec.rb, but I think that the code its more readable as it is.

What about now @armab ?

shortdudey123 commented 7 years ago

If you are looking to combine things, i would look at the shared_examples rspec directive http://modocache.io/shared-examples-in-rspec

jvrplmlmn commented 7 years ago

@armab I've included the changes added on https://github.com/StackStorm/chef-stackstorm/pull/57, would you mind taking a look?