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

Add Molecule Tests #44

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open

Add Molecule Tests #44

wants to merge 21 commits into from

Conversation

rcuza
Copy link

@rcuza rcuza commented Oct 18, 2018

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.

* 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
@rcuza
Copy link
Author

rcuza commented Oct 23, 2018

@nickhammond,

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant