-
Notifications
You must be signed in to change notification settings - Fork 79
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
molecule-vagrant does not run box remove
on destroy.
#290
Comments
well, this problem has been there for ages, afair. From a quick thought:
|
I reported it because it was a violation of the mental model of idempotent test setups for molecule. When using molecule (or any testing framework); I should not need to worry about gotcha's with idempotent testing setups -- they should be setup the same every time -- this lets you focus on actually testing errors within your project opposed to worrying about edge cases in the testing framework. VM testing is generally a lot heavier to begin with; and I would suggest that most folks already keep their testing to containers for a majority of their testing which does not require stronger abstractions (like, kernel, hardware, firmware, etc). I think sticking to the testing contract of idempotent test setups is more important that it being faster or slower; especially with knowledge that there are other frameworks allowing for lighter testing if needed. Another way to solve this is to leave it as is, and have an additional option in the configuration which 'enables' the deletion of the box -- so it doesn't break existing users; but allows for people to enable this behavior (maybe like, idempotent: true?). |
Not sure about the name of the option, but having an option to ask for removing the box after the test would be fine for me. |
To idemptotently destroy a vagrant VM, you must run
vagrant box remove box/name
otherwise remenants of the VM will remain when re-running molecule create steps, leading hard to debug errors.Here's the vagrant documentation specifying as such: https://developer.hashicorp.com/vagrant/docs/cli/destroy
On molecule destroy, vagrant should also call
vagrant box remove box/name
to ensure idempotent testing conditions.The text was updated successfully, but these errors were encountered: