diff --git a/.zuul.yaml b/.zuul.yaml index 727ddf25..a0032966 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -46,6 +46,16 @@ - name: github.com/ansible/ansible override-checkout: stable-2.9 +- job: + name: ansible-collections-openstack-functional-devstack-ansible-2.9-pip + parent: ansible-collections-openstack-functional-devstack-ansible-2.9 + description: | + Run openstack collections functional tests against a master devstack + using master of openstacksdk and stable 2.9 branch of ansible. + Ansible collection is built using PIP + vars: + tox_envlist: ansible-pip + - job: name: ansible-collections-openstack-functional-devstack-train-ansible-devel parent: ansible-collections-openstack-functional-devstack @@ -225,6 +235,9 @@ - ansible-collections-openstack-functional-devstack-queens-ansible-2.9: dependencies: *deps_unit_lint irrelevant-files: *ignore_files + - ansible-collections-openstack-functional-devstack-ansible-2.9-pip: + dependencies: *deps_unit_lint + irrelevant-files: *ignore_files gate: diff --git a/ci/run-ansible-tests-collection.sh b/ci/run-ansible-tests-collection.sh index 21faacba..207aa947 100644 --- a/ci/run-ansible-tests-collection.sh +++ b/ci/run-ansible-tests-collection.sh @@ -97,14 +97,19 @@ then fi # install collections -tox -ebuild -ansible-galaxy collection build --force . --output-path ./build_artifact -ansible-galaxy collection install $(ls build_artifact/openstack-cloud-*) --force +if [[ -z "$PIP_INSTALL" ]]; then + tox -ebuild + ansible-galaxy collection install $(ls build_artifact/openstack-cloud-*) --force + TEST_COLLECTIONS_PATHS=${HOME}/.ansible/collections:$ANSIBLE_COLLECTIONS_PATHS +else + pip freeze | grep ansible-collections-openstack + TEST_COLLECTIONS_PATHS=$VIRTUAL_ENV/share/ansible/collections:$ANSIBLE_COLLECTIONS_PATHS +fi # Discover openstackSDK version SDK_VER=$(python -c "import openstack; print(openstack.version.__version__)") pushd ci/ # run tests -ANSIBLE_COLLECTIONS_PATHS=${HOME}/.ansible/collections ansible-playbook \ +ANSIBLE_COLLECTIONS_PATHS=$TEST_COLLECTIONS_PATHS ansible-playbook \ -vvv ./run-collection.yml \ -e "sdk_version=${SDK_VER} cloud=${CLOUD} image=${IMAGE} ${ANSIBLE_VARS}" \ ${tag_opt} diff --git a/setup.cfg b/setup.cfg index ba4d6305..4d5cca26 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,3 +1,38 @@ [metadata] -# This is a stub file to enable tox-siblings to work -name = ansible-collections-openstack +name = ansible-collections-openstack.cloud +summary = Ansible collections for Openstack cloud +description-file = + README.md + +author = OpenStack +author-email = openstack-discuss@lists.openstack.org +home-page = https://opendev.org/openstack/ansible-collections-openstack/ +classifier = + License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+) + Development Status :: 5 - Production/Stable + Intended Audience :: Developers + Intended Audience :: System Administrators + Intended Audience :: Information Technology + Topic :: System :: Systems Administration + Topic :: Utilities + +[global] +setup-hooks = + pbr.hooks.setup_hook + +[files] +data_files = + share/ansible/collections/ansible_collections/openstack/cloud/ = README.md + share/ansible/collections/ansible_collections/openstack/cloud/roles/ = roles/* + share/ansible/collections/ansible_collections/openstack/cloud/plugins/ = plugins/* + share/ansible/collections/ansible_collections/openstack/cloud/playbooks/ = playbooks/* + share/ansible/collections/ansible_collections/openstack/cloud/scripts/ = scripts/* + share/ansible/collections/ansible_collections/openstack/cloud/docs/ = docs/* + share/ansible/collections/ansible_collections/openstack/cloud/meta/ = meta/* + +[wheel] +universal = 1 + +[pbr] +skip_authors = True +skip_changelog = True diff --git a/setup.py b/setup.py new file mode 100644 index 00000000..d6d2ea1b --- /dev/null +++ b/setup.py @@ -0,0 +1,8 @@ +# Copyright Red Hat, Inc. All Rights Reserved. +# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) + +import setuptools + +setuptools.setup( + setup_requires=['pbr'], + pbr=True) diff --git a/tox.ini b/tox.ini index af3c94ae..311b24fe 100644 --- a/tox.ini +++ b/tox.ini @@ -8,7 +8,9 @@ ignore_basepython_conflict = True skip_install = True install_command = python -m pip install {opts} {packages} basepython = python3 -passenv = OS_* +passenv = + OS_* + pip: PIP_INSTALL setenv = VIRTUAL_ENV={envdir} LANG=en_US.UTF-8 @@ -17,8 +19,10 @@ setenv = OS_LOG_CAPTURE={env:OS_LOG_CAPTURE:true} OS_STDOUT_CAPTURE={env:OS_STDOUT_CAPTURE:true} OS_STDERR_CAPTURE={env:OS_STDERR_CAPTURE:true} + pip: PIP_INSTALL={env:PIP_INSTALL:true} deps = -r{toxinidir}/test-requirements.txt + pip: {toxinidir} commands = stestr run {posargs} stestr slowest @@ -36,6 +40,7 @@ deps = ruamel.yaml galaxy-importer git+https://github.com/ansible/ansible + commands = python {toxinidir}/tools/build.py ansible-galaxy collection build --force {toxinidir} --output-path {toxinidir}/build_artifact @@ -66,8 +71,15 @@ exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build,ansible_collections [testenv:ansible] # Need to pass some env vars for the Ansible playbooks -passenv = HOME USER ANSIBLE_VAR_* +passenv = + HOME + USER + ANSIBLE_* deps = {[testenv]deps} commands = /bin/bash {toxinidir}/ci/run-ansible-tests-collection.sh -e {envdir} {posargs} + +[testenv:ansible-pip] +passenv = {[testenv:ansible]passenv} +commands = {[testenv:ansible]commands}