Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to test recipes using ChefVault with test-kitchen? #61

Closed
cstewart87 opened this issue Dec 10, 2013 · 3 comments
Closed

Comments

@cstewart87
Copy link

How do you run integration tests on recipes?

@moserke
Copy link
Contributor

moserke commented Dec 11, 2013

We have not done it with test kitchen yet, but have successfully done it with ChefSpec

def chef_vault_mock(vault, item, value)
  ChefVault::Item.stub(:load).with(vault, item).and_return(value)
end

Then in a spec you can use this mock function like:

chef_vault_mock('passwords', 'test_user', { 'id' => 'test_user', 'password' => 'happy' })

This works pretty good in ChefSpec. Unfortunately have not played a lot with test kitchen so don't know exactly what all would be involved, but would love to have someone help with that.

My initial thoughts are some kind of embedded test user or something. Not fully sure though.

@pivotal-casebook
Copy link

Please take a look at the chef-vault cookbook.

@moserke
Copy link
Contributor

moserke commented Jan 21, 2014

See https://github.com/opscode-cookbooks/chef-vault for how to test.

@moserke moserke closed this as completed Jan 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants