-
Notifications
You must be signed in to change notification settings - Fork 103
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
Add Molecule Tests #44
base: master
Are you sure you want to change the base?
Conversation
* test against centos:7 * test against centos:6 * test against ubuntu:18.04 * test against ubuntu:16.04 * test against ubuntu:14.04 * fix linting issues
* remove Vagrant tests * update docs
also turn python back on
The incorrect logrotate options triggered a failed travis-ci build as expected. I also updated the versions of Ubuntu and CentOS in the meta file to match what the tests run against.
One of the things this disables is the long line check. This means the `->` used in `.travis.yml` could be made into a single line. I'm leaving it as multiline because I think it is more readable.
Following a pattern I learned from geelingguy I am attempting to create a more accurate test of this role on different distributions.
I also reduced the MATRIX to make it fail cheaper
After taking a look @geerlingguy ansible-role-ansible I realized my original test was testing running the same docker image on different operating systems. What I wanted to test is the role on docker containers running different operating systems (duh). This PR now does that. I also realize my learning curve with TravisCI is showing in the number of commits in this PR. If you are need me to squash them please let me know. |
This change adds molecule tests and removed the Vagrant based tests. It also updates
.travis.ym
to run the new tests.To run the tests, install molecule (in a virtualenv works fine with python 2.7) and then run
molecule test
from the root of the repo.The tests were written with the Docker driver to improve compatibility with CI.
To see the results of the tests, you can go to https://travis-ci.org/rcuza/ansible-logrotate. Test number 6 was an intentional failed build so you can see how it catches errors.
Thank you for making your original code available.