-
Notifications
You must be signed in to change notification settings - Fork 739
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
Enhancement: Test with TestInfra and Molecule #128
Comments
If the dev-sec team is open to this idea I'm willing to create a PR with suggested changes. This assumes #127 is an accepted idea because all of the technologies discussed in this issue are installed via Python pip. |
We're using inspec for all our tests (see https://github.com/dev-sec/linux-baseline/) and since we use these for the chef, puppet and ansible roles, its unlikely that we will replace them with TestInfra. However some (long) time ago I took a look at molecule and found it quite good. However there's no support for inspec so it's out of the question right now. However @chris-rock thought about writing a driver for molecule to support inspec. So if that happens, we'll see gladly take a PR that implements molecule testing. |
@samrocketman Thank you very much for your open feedback. I'd like to understand your concerns a little bit more about. Could you elaborate on:
|
It's not really a concern. It just simplifies setting up a development and test environment with fewer dependencies. For example, really the only dependencies you need installed is Python, pip, and virtualenv. The rest of the dependencies would get installed via
I have only a light familiarity with test kitchen. However, conceptually they're similar. The workflow should be somewhat the same.
Because Ansible, molecule, and TestInfra are all tracked by python, it's easy to track them all for repeatability within I would say that's the primary advantage but it's not a big one. You can achieve the same level of repeatability with Keep in mind I'm not suggesting test kitchen and inspec are inferior. They both can achieve the same thing with success. I'm only suggesting simplifying your workflow with fewer dependencie and a tool specifically designed with ansible in mind. |
Here's an example with the dependency chain I'm recommending. https://github.com/Comcast/ansible-sdkman/blob/master/.travis.yml |
Building on @samrocketman's point, a nice alternative testing framework (similar to testinfra or serverspec) is GOSS. It's super lightweight, tests are easy to develop (just a YAML file), and it's REALLY fast (much faster in my experience than both serverspec and testinfra). |
Closing this for now. If anyone wants to support other testing-methods, feel free to reopen and provide a PR. |
I recommend taking away the dependency of Ruby and testing this role using Molecule and TestInfra. Molecule has a docker driver which works with with Travis CI (just like Vagrant has a docker driver). Molecule uses TestInfra and the VirtualBox/Vagrant driver by default.
I maintain the GIMP project CI infrastructure and have documented how I get started with Molecule when creating new roles.
The text was updated successfully, but these errors were encountered: