Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Oct 2, 2018. It is now read-only.

Add initial support for chefspec. #66

Merged
merged 3 commits into from
Dec 28, 2013
Merged

Add initial support for chefspec. #66

merged 3 commits into from
Dec 28, 2013

Conversation

joestump
Copy link
Contributor

  • Added a .travis.yml.
  • Added a working Gemfile.
  • Added libraries/matchers.rb for chefspec.
  • Added specs for python::default.

@@ -0,0 +1,7 @@
rvm:
- 1.9.3
- 2.0.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any reason to test this? I would only expect it to work on the ruby in omnibus chef (and when I add test-kitchen support, you want just a single build in the matrix).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Different people install Chef different ways. There's also backwards compatibility to think about.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this just makes it much more complex to handle test-kitchen later, since we don't want to run those twice. Can probably make it work with some kind of env var magic (create another matrix axis for TEST_TYPE=spec,kitchen, and have the build script run the correct commands in the correct places).

@coderanger
Copy link
Member

I've not really played much with chefspec in favor of test kitchen, any major reason to go this way?

@joestump
Copy link
Contributor Author

My understanding, as I've not implemented test-kitchen are integration tests while chefspec are unit tests. While test-kitchen exercises against an actual OS, chefspec tests converged recipes against fixtures. My understanding is that community cookbook guidelines will be requiring both as we move forward.

I think of test-kitchen as more analogous to Selenium browser tests.

@coderanger
Copy link
Member

There are no community cookbook guidelines as Opscode's policies hold no sway here :-) The problem I've had with chefspec (and why I don't use it personally) is that it mocks out a lot of Chef internally, which fails with Poise-style cookbooks and their multi-level resource structure.

@joestump
Copy link
Contributor Author

You can create more complex build matrixes that would effectively exercise both test-kitchen and chefspec across multiple platforms and Rubies, but it would require a bit more effort in the build setup.

@coderanger
Copy link
Member

test-kitchen is a little different since it doesn't use the local system at all, it just spins up Rackspace instances and talks to them via SSH :-) This looks good for now though, and having a template for a hybrid chefspec/TK travis run is something I want to do anyway.

coderanger added a commit that referenced this pull request Dec 28, 2013
@coderanger coderanger merged commit dc6cd4d into poise:master Dec 28, 2013
@joestump
Copy link
Contributor Author

Let me know if you need/want any help/input. I need to add test-kitchen to my own cookbooks and am keen to establish a sane setup.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants