diff --git a/.zuul.yaml b/.zuul.yaml index 063d2ff..44638a7 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -1,6 +1,6 @@ - job: name: ansible-role-logrotate - run: tests/test.yaml + run: tests/playbooks/run.yaml roles: - zuul: openstack/ansible-role-logrotate @@ -9,6 +9,11 @@ parent: ansible-role-logrotate nodeset: fedora-27 +- job: + name: ansible-role-logrotate-ubuntu-bionic + parent: ansible-role-logrotate + nodeset: ubuntu-bionic + - job: name: ansible-role-logrotate-ubuntu-xenial parent: ansible-role-logrotate @@ -17,14 +22,17 @@ - project: templates: - windmill-jobs-fedora-27 + - windmill-jobs-bionic - windmill-jobs-xenial check: jobs: - ansible-role-logrotate-fedora-27 + - ansible-role-logrotate-ubuntu-bionic - ansible-role-logrotate-ubuntu-xenial - tox-linters gate: jobs: - ansible-role-logrotate-fedora-27 + - ansible-role-logrotate-ubuntu-bionic - ansible-role-logrotate-ubuntu-xenial - tox-linters diff --git a/tests/inventory b/tests/inventory index 59f3595..2fbb50c 100644 --- a/tests/inventory +++ b/tests/inventory @@ -1,2 +1 @@ -[all] -localhost ansible_connection=ssh +localhost diff --git a/tests/test.yaml b/tests/playbooks/run.yaml similarity index 100% rename from tests/test.yaml rename to tests/playbooks/run.yaml diff --git a/tox.ini b/tox.ini index 60b7f91..dc90799 100644 --- a/tox.ini +++ b/tox.ini @@ -7,19 +7,14 @@ skipsdist = True deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt -[testenv:functional] -commands = - # NOTE(pabelanger): Because ansible default ansible_user to null now, we need to pass it via CLI. - ansible-playbook -i tests/inventory tests/test.yaml -e ansible_user={env:USER} -passenv = - HOME - USER -setenv = - ANSIBLE_CONFIG = {toxinidir}/tests/ansible.cfg - PYTHONUNBUFFERED = 1 - [testenv:docs] -commands = python setup.py build_sphinx +deps = -r{toxinidir}/doc/requirements.txt +whitelist_externals = + bash +commands= + bash -c "rm -rf doc/build" + doc8 doc + sphinx-build -b html doc/source doc/build/html [testenv:venv] commands = {posargs} @@ -34,14 +29,14 @@ exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build [testenv:linters] setenv = - ANSIBLE_CONFIG = tests/ansible.cfg + ANSIBLE_ROLES_PATH = .. whitelist_externals = bash commands = # PEP8 Lint Check flake8 # Ansible Lint Check - bash -c "find . -type f -regex '.*.y[a]?ml' -print0 | xargs -t -n1 -0 \ - ansible-lint" + bash -c "find . -not -path '*/\.*' -type f -regex '.*.y[a]?ml' -print0 | \ + xargs -t -n1 -0 ansible-lint" # Ansible Syntax Check bash -c "find tests -type f -regex '.*.y[a]?ml' -print | xargs -t -n1 \ ansible-playbook --syntax-check -i tests/inventory \