From 3f4b58bd4133b83c8556c2275875188147d2a58b Mon Sep 17 00:00:00 2001 From: Sorin Sbarnea Date: Tue, 23 Jul 2019 18:18:40 +0100 Subject: [PATCH] Enable placeholder openstack-tox-molecule job This sets the molecule framework files and job, so later we can write tests for the role using it. Change-Id: I16a67ff8acbadc7dce3746ca2ffc67aed660ed65 --- molecule/default/converge.yml | 10 +++++++++ molecule/default/molecule.yml | 11 ++++++++++ tox.ini | 39 ++++++++++++++++++++++++++++++----- zuul.d/project.yaml | 5 +++++ 4 files changed, 60 insertions(+), 5 deletions(-) create mode 100644 molecule/default/converge.yml create mode 100644 molecule/default/molecule.yml diff --git a/molecule/default/converge.yml b/molecule/default/converge.yml new file mode 100644 index 00000000..995cd808 --- /dev/null +++ b/molecule/default/converge.yml @@ -0,0 +1,10 @@ +--- + +- name: Converge + hosts: all + gather_facts: false + tasks: + + - name: this does nothing + debug: + msg: foo diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml new file mode 100644 index 00000000..a270f284 --- /dev/null +++ b/molecule/default/molecule.yml @@ -0,0 +1,11 @@ +--- +driver: + name: delegated +log: true +platforms: + - name: localhost +provisioner: + name: ansible +scenario: + test_sequence: + - converge diff --git a/tox.ini b/tox.ini index c0e1e12b..3035f6ff 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] minversion = 3.1 skipsdist = True -envlist = docs,linters,functional +envlist = docs,linters,functional,molecule ignore_basepython_conflict = True [testenv] @@ -12,21 +12,34 @@ install_command = commands = /usr/bin/find . -type f -name "*.pyc" -delete passenv = + ANSIBLE_* COMMON_TESTS_PATH + DOCKER_* HOME - http_proxy - HTTP_PROXY - https_proxy HTTPS_PROXY - no_proxy + HTTP_PROXY + MOLECULE_* NO_PROXY + SSH_AUTH_SOCK + TERM TESTING_BRANCH TESTING_HOME USER + http_proxy + https_proxy + no_proxy whitelist_externals = bash setenv = + ANSIBLE_FORCE_COLOR=1 + ANSIBLE_NOCOWS=1 + ANSIBLE_RETRY_FILES_ENABLED=0 + ANSIBLE_STDOUT_CALLBACK=debug + ANSIBLE_INVENTORY= + ANSIBLE_CONFIG= + MOLECULE_NO_LOG={env:MOLECULE_NO_LOG:0} PYTHONUNBUFFERED=1 + PY_COLORS=1 ROLE_NAME=os_tempest TEST_IDEMPOTENCE=false VIRTUAL_ENV={envdir} @@ -101,3 +114,19 @@ commands = {[testenv:bashate]commands} {[testenv:ansible-lint]commands} {[testenv:ansible-syntax]commands} + +[testenv:molecule] +setenv = + UPPER_CONSTRAINTS_FILE=/dev/null +deps = + ansi2html # GPL (soft-dependency of pytest-html) + docker>=3.7 # Apache + molecule>=3.0.2 # MIT + paramiko>=2.5.0 # LGPL (soft-dependency of docker that enables ssh protocol) + pytest # MIT + pytest-html # MPL 2.0 + pytest-molecule # MIT + pytest-plus # MIT + selinux # MIT +commands = + python -m pytest -ra --html={envlogdir}/reports.html --self-contained-html {tty:-s} {posargs:-k molecule} diff --git a/zuul.d/project.yaml b/zuul.d/project.yaml index 3a7db031..7d781f45 100644 --- a/zuul.d/project.yaml +++ b/zuul.d/project.yaml @@ -24,6 +24,11 @@ check: jobs: - openstack-ansible-deploy-aio_distro_metal_tempestconf-centos-7 + - openstack-tox-molecule: + voting: false + vars: + tox_environment: + PYTEST_REQPASS: 1 - tripleo-ci-centos-8-standalone gate: jobs: