-
Notifications
You must be signed in to change notification settings - Fork 137
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
Testing ansible idempotency #116
Comments
Generally, there's no test for idempotency, unless you define a test scenario that allows you to test idempotent behavior of your module(s). As you probably know, a test case in kitchen-ansible is an ansible playbook that is located somewhere under test/integration. In such a test case you would call your role multiple times and then use serverspec (or any other of the supported test frameworks) to test whether the state has only been enforced once. If you think about an entry in a configuration file, you could test, whether the entry was created only once. Does that make sense? |
To follow up on @metmajer, here's the way I do it:
This essentially runs the role on the same host twice, so I can see if anything changed in the second run. Though it would be nice to have an idempotency test like https://github.com/ahelal/kitchen-ansiblepush. |
thanks for PR in version 0.0.34 |
Is there are some way to do it with kitchen-ansible ?
The text was updated successfully, but these errors were encountered: