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

adding molecule tests #138

Closed
singuliere opened this issue Jan 10, 2019 · 13 comments
Closed

adding molecule tests #138

singuliere opened this issue Jan 10, 2019 · 13 comments
Assignees
Labels

Comments

@singuliere
Copy link
Contributor

It would be convenient to have molecule scenarios to verify the roles works as expected. Such scenarios could run on every pull request via Travis CI and reduce the works required from reviewers.

@singuliere
Copy link
Contributor Author

Unless someone is already doing this I'm willing to give it a try.

@paulcalabro
Copy link
Contributor

I was thinking the same. I'm actually using Test-Kitchen (https://kitchen.ci) atm.
This creates VMs in AWS for me for different platforms we're using here, configures them, runs InSpec tests, reports, and then tears them down. Is Molecule similar in that regard?

@singuliere
Copy link
Contributor Author

singuliere commented Jan 10, 2019

@paulcalabro yes. With the upside that molecule is now widely adopted as a test method for roles since it became part of the ansible project.

@paulcalabro
Copy link
Contributor

Happy to learn something new. If folks are onboard, let's give it a whirl!

@paulcalabro
Copy link
Contributor

paulcalabro commented Jan 10, 2019

One thought I just had is testing across Wazuh projects, like Wazuh Puppet. It might make sense to use something that supports multiple configuration mgmt languages. Might not matter. Either way works for me.

@JJediny
Copy link
Contributor

JJediny commented Feb 10, 2019

FWIW we use both test-kitchen and molecule for testing our ansible work https://github.com/gsa/datagov-deploy.

While test-kitchen is great for testing puppet/chef and that yes it does support ansible; molecule is much better at running with a docker based setup and is purpose-built for ansible as we've learned through using both. If you decide to go with test-kitchen here are some great examples of using test-kitchen to support multiple configuration management solutions: https://github.com/dev-sec

If that PR is useful happy to work more on it

@paulcalabro
Copy link
Contributor

Thanks for the insight as well as sharing those repos @JJediny. I'll make sure to check them out. Also, I had no idea about data.gov. That's pretty awesome. I think I might have some fun with that!

@manuasir
Copy link
Contributor

manuasir commented Apr 1, 2019

Hello @paulcalabro, @JJediny and @singuliere ,

We're planning to add tests on each repository (wazuh-chef, wazuh-puppet and wazuh-ansible) very soon, so we will try your molecule PR for ansible.
I'd like to thank you guys for your amazing work on this repository, your collaboration is very valuable for us.

Cheers

@manuasir manuasir added the test label Apr 1, 2019
@dj-wasabi
Copy link
Contributor

Hi @manuasir

Is there a way/need that I can help/assist with adding molecule? If so, let me know.

I know my Ossec roles needs some love as well, but maybe https://github.com/dj-wasabi/ansible-ossec-agent/tree/master/molecule/default and https://github.com/dj-wasabi/ansible-ossec-server/tree/master/molecule/default helps?

@manuasir
Copy link
Contributor

manuasir commented Apr 15, 2019

Hello @dj-wasabi ,

You're always welcome to open a new PR adding new improvements, features, and tests. We're currently testing this PR #151 , if you wanted to add more tests to it, it would be really awesome. Thanks!

@dj-wasabi
Copy link
Contributor

Hi @singuliere / @manuasir

Do you want to use a single scenario (With several containers started, where all of the roles are applied on) or multiple ones (A scenario for each role for example) with Molecule.

But I will create a PR, it might be a "big" one to make sure you can run Molecule without any errors (Seems some linting issues, some packages are not installed while they are required, etc).

@manuasir
Copy link
Contributor

Thanks @dj-wasabi ! It could be interesting to explore the idea of having multiple scenarios, but any contribution of your choice will be much appreciated.

@manuasir manuasir added this to To do in Wazuh 3.9.x via automation Apr 30, 2019
@manuasir manuasir moved this from To do to In progress in Wazuh 3.9.x Apr 30, 2019
@manuasir manuasir removed this from In progress in Wazuh 3.9.x May 3, 2019
@manuasir
Copy link
Contributor

manuasir commented May 7, 2019

I think we can already close this issue.
Thanks a lot to @JJediny , who kindly contributed to add the first molecule structure (#151), and of course thanks a lot to @dj-wasabi for the awesome work adding the different testing scenarios (#169, #174 and #179). Your efforts and great work for making these Ansible components better and more reliable are really much appreciated.

Don't hesitate to open a new issue whenever you may consider it.

Regards

@manuasir manuasir closed this as completed May 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants