Tweak the role-addition tox job

The role-addition tox job used to make the assumption it would install
docker and run a molecule test, however, due to the fact we're
transitioning away from tox jobs that can modify the underlying
system, the tox environment has been tweaked so that it no longers
makes the assumption docker will be installed via tox.

The tox job will now check for a valid connection to docker or podman
before attempting to run a molecule test against the pseudo role. In
the Zuul environment docker will be present when the resource is
provisioned via the tox-molecule job parent. In a local test
environments, a valid container runtime will need to be deployed,
which documented in the contributing guide. If the role-addition
tox environment is not able to connect to docker or podman a notice
will be displayed linking to the contributing documentation.

The job definition has been updated to ensure it runs anytime the
tox.ini file is changed. This was done because the tox.ini file
is the only mode of execution for this job.

Change-Id: I277edc265e7cd885af55bbf64bbc5e4fda058950
Signed-off-by: Kevin Carter <kecarter@redhat.com>
This commit is contained in:
Kevin Carter 2019-07-02 14:27:03 -05:00 committed by Kevin Carter (cloudnull)
parent 09b1805e5f
commit c4dd049270
2 changed files with 8 additions and 2 deletions

View File

@ -113,5 +113,10 @@ deps=
{[testenv:linters]deps}
commands =
bash -c "ansible-playbook -i localhost, role-addition.yml -e role_name=skeleton_test"
bash -c "pushd {toxinidir}/tripleo_ansible/roles/skeleton_test; molecule test --all; popd"
bash -c "if (podman ps 2> /dev/null || docker ps 2> /dev/null); then \
cd {toxinidir}/tripleo_ansible/roles/skeleton_test; \
molecule test --all; \
else \
echo -e '\n\nNo molecule tests have been executed\nSee https://docs.openstack.org/tripleo-ansible/latest/contributing.html#local-testing-of-new-roles\n\n'; \
fi"
{[testenv:linters]commands}

View File

@ -80,9 +80,10 @@
files:
- ^_skeleton_role_/.*
- ^role-addition.yml
- ^tox.ini
name: tripleo-ansible-centos-7-role-addition
nodeset: centos-7
parent: openstack-tox
parent: tox-molecule
timeout: 1800
vars:
tox_envlist: role-addition