New CI jobs configuration

Change-Id: Ib6850184faf1bc0808502c098d610a5e2f41f47e
This commit is contained in:
Sagi Shnaidman 2020-06-19 10:41:51 +03:00
parent 5e3a91a7c6
commit 01c2499fb6
7 changed files with 139 additions and 87 deletions

@ -10,7 +10,7 @@
- openstack/ansible-collections-openstack - openstack/ansible-collections-openstack
vars: vars:
zuul_work_dir: src/opendev.org/openstack/ansible-collections-openstack zuul_work_dir: src/opendev.org/openstack/ansible-collections-openstack
tox_envlist: ansible tox_envlist: ansible-2.9
tox_install_siblings: true tox_install_siblings: true
fetch_subunit: false fetch_subunit: false
@ -21,56 +21,74 @@
Run openstack collections functional tests against a master devstack Run openstack collections functional tests against a master devstack
using releases of openstacksdk and latest ansible release using releases of openstacksdk and latest ansible release
vars: vars:
tox_envlist: ansible-2.9
tox_install_siblings: false tox_install_siblings: false
- job:
name: ansible-collections-openstack-functional-devstack-ansible-2.10
parent: ansible-collections-openstack-functional-devstack
description: |
Run openstack collections functional tests against a master devstack
using master of openstacksdk and stable 2.10 branch of ansible
required-projects:
- name: github.com/ansible/ansible
override-checkout: stable-2.10
vars:
tox_envlist: ansible
- job:
name: ansible-collections-openstack-functional-devstack-ansible-2.9
parent: ansible-collections-openstack-functional-devstack
description: |
Run openstack collections functional tests against a master devstack
using master of openstacksdk and stable 2.10 branch of ansible
required-projects:
- name: github.com/ansible/ansible
override-checkout: stable-2.9
vars:
tox_envlist: ansible-2.9
- job: - job:
name: ansible-collections-openstack-functional-devstack-ansible-devel name: ansible-collections-openstack-functional-devstack-ansible-devel
parent: ansible-collections-openstack-functional-devstack parent: ansible-collections-openstack-functional-devstack
description: | description: |
Run openstack collections functional tests against a master devstack Run openstack collections functional tests against a master devstack
using master of openstacksdk and devel branch of ansible using master of openstacksdk and devel branch of ansible
# non-voting because we can't prevent ansible devel from breaking us
voting: false voting: false
required-projects: required-projects:
- name: github.com/ansible/ansible - name: github.com/ansible/ansible
override-checkout: devel override-checkout: devel
vars:
tox_envlist: ansible
# Pip installation job
- job: - job:
name: ansible-collections-openstack-functional-devstack-ansible-2.9 name: ansible-collections-openstack-functional-devstack-ansible-pip
parent: ansible-collections-openstack-functional-devstack-ansible-devel parent: ansible-collections-openstack-functional-devstack
description: | description: |
Run openstack collections functional tests against a master devstack Run openstack collections functional tests against a master devstack
using master of openstacksdk and stable 2.9 branch of ansible using master of openstacksdk with latest ansible release.
Ansible collection is built using PIP.
vars:
tox_envlist: ansible-pip
# Stable branches
- job:
name: ansible-collections-openstack-functional-devstack-ussuri-ansible-2.9
parent: ansible-collections-openstack-functional-devstack-ansible-devel
description: |
Run openstack collections functional tests against a ussuri devstack
using ussuri brach of openstacksdk and stable 2.9 branch of ansible
voting: true voting: true
required-projects: required-projects:
- name: github.com/ansible/ansible - name: github.com/ansible/ansible
override-checkout: stable-2.9 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
description: |
Run openstack collections functional tests against a train devstack
using train brach of openstacksdk and devel branch of ansible
# non-voting because we can't prevent ansible devel from breaking us
voting: false
required-projects:
- name: github.com/ansible/ansible
override-checkout: devel
- name: openstack/openstacksdk - name: openstack/openstacksdk
override-branch: train override-branch: ussuri
- name: openstack/devstack - name: openstack/devstack
override-checkout: train override-checkout: ussuri
vars:
tox_envlist: ansible-2.9
- job: - job:
name: ansible-collections-openstack-functional-devstack-train-ansible-2.9 name: ansible-collections-openstack-functional-devstack-train-ansible-2.9
@ -86,22 +104,8 @@
override-branch: train override-branch: train
- name: openstack/devstack - name: openstack/devstack
override-checkout: train override-checkout: train
vars:
- job: tox_envlist: ansible-2.9
name: ansible-collections-openstack-functional-devstack-stein-ansible-devel
parent: ansible-collections-openstack-functional-devstack
description: |
Run openstack collections functional tests against a stein devstack
using stein brach of openstacksdk and devel branch of ansible
# non-voting because we can't prevent ansible devel from breaking us
voting: false
required-projects:
- name: github.com/ansible/ansible
override-checkout: devel
- name: openstack/openstacksdk
override-branch: stein
- name: openstack/devstack
override-checkout: stein
- job: - job:
name: ansible-collections-openstack-functional-devstack-stein-ansible-2.9 name: ansible-collections-openstack-functional-devstack-stein-ansible-2.9
@ -117,22 +121,8 @@
override-branch: stein override-branch: stein
- name: openstack/devstack - name: openstack/devstack
override-checkout: stein override-checkout: stein
vars:
- job: tox_envlist: ansible-2.9
name: ansible-collections-openstack-functional-devstack-rocky-ansible-devel
parent: ansible-collections-openstack-functional-devstack
description: |
Run openstack collections functional tests against a rocky devstack
using rocky brach of openstacksdk and devel branch of ansible
# non-voting because we can't prevent ansible devel from breaking us
voting: false
required-projects:
- name: github.com/ansible/ansible
override-checkout: devel
- name: openstack/openstacksdk
override-branch: rocky
- name: openstack/devstack
override-checkout: rocky
- job: - job:
name: ansible-collections-openstack-functional-devstack-rocky-ansible-2.9 name: ansible-collections-openstack-functional-devstack-rocky-ansible-2.9
@ -148,6 +138,8 @@
override-branch: rocky override-branch: rocky
- name: openstack/devstack - name: openstack/devstack
override-checkout: rocky override-checkout: rocky
vars:
tox_envlist: ansible-2.9
- job: - job:
name: ansible-collections-openstack-functional-devstack-queens-ansible-2.9 name: ansible-collections-openstack-functional-devstack-queens-ansible-2.9
@ -163,7 +155,10 @@
override-branch: master override-branch: master
- name: openstack/devstack - name: openstack/devstack
override-checkout: queens override-checkout: queens
vars:
tox_envlist: ansible-2.9
# Linters
- job: - job:
name: openstack-tox-linters-ansible-devel name: openstack-tox-linters-ansible-devel
parent: openstack-tox-linters parent: openstack-tox-linters
@ -175,6 +170,16 @@
- name: github.com/ansible/ansible - name: github.com/ansible/ansible
override-checkout: devel override-checkout: devel
- job:
name: openstack-tox-linters-ansible-2.10
parent: openstack-tox-linters
description: |
Run openstack collections linter tests using the 2.9 branch of ansible
voting: true
required-projects:
- name: github.com/ansible/ansible
override-checkout: stable-2.10
- job: - job:
name: openstack-tox-linters-ansible-2.9 name: openstack-tox-linters-ansible-2.9
parent: openstack-tox-linters parent: openstack-tox-linters
@ -184,12 +189,15 @@
required-projects: required-projects:
- name: github.com/ansible/ansible - name: github.com/ansible/ansible
override-checkout: stable-2.9 override-checkout: stable-2.9
vars:
tox_envlist: linters-2.9
- project: - project:
check: check:
jobs: jobs:
- tox-pep8 - tox-pep8
- openstack-tox-linters-ansible-devel - openstack-tox-linters-ansible-devel
- openstack-tox-linters-ansible-2.10
- openstack-tox-linters-ansible-2.9 - openstack-tox-linters-ansible-2.9
- ansible-collections-openstack-functional-devstack: - ansible-collections-openstack-functional-devstack:
dependencies: &deps_unit_lint dependencies: &deps_unit_lint
@ -205,50 +213,52 @@
- tests/sanity/.* - tests/sanity/.*
- contrib/.* - contrib/.*
- ansible-collections-openstack-functional-devstack-releases: - ansible-collections-openstack-functional-devstack:
dependencies: *deps_unit_lint dependencies: *deps_unit_lint
irrelevant-files: *ignore_files irrelevant-files: *ignore_files
- ansible-collections-openstack-functional-devstack-ansible-devel: - ansible-collections-openstack-functional-devstack-releases:
dependencies: *deps_unit_lint dependencies: *deps_unit_lint
irrelevant-files: *ignore_files irrelevant-files: *ignore_files
- ansible-collections-openstack-functional-devstack-ansible-2.9: - ansible-collections-openstack-functional-devstack-ansible-2.9:
dependencies: *deps_unit_lint dependencies: *deps_unit_lint
irrelevant-files: *ignore_files irrelevant-files: *ignore_files
- ansible-collections-openstack-functional-devstack-train-ansible-devel: - ansible-collections-openstack-functional-devstack-ansible-2.10:
dependencies: *deps_unit_lint
irrelevant-files: *ignore_files
- ansible-collections-openstack-functional-devstack-ansible-devel:
dependencies: *deps_unit_lint
irrelevant-files: *ignore_files
- ansible-collections-openstack-functional-devstack-ansible-pip:
dependencies: *deps_unit_lint
irrelevant-files: *ignore_files
- ansible-collections-openstack-functional-devstack-ussuri-ansible-2.9:
dependencies: *deps_unit_lint dependencies: *deps_unit_lint
irrelevant-files: *ignore_files irrelevant-files: *ignore_files
- ansible-collections-openstack-functional-devstack-train-ansible-2.9: - ansible-collections-openstack-functional-devstack-train-ansible-2.9:
dependencies: *deps_unit_lint dependencies: *deps_unit_lint
irrelevant-files: *ignore_files irrelevant-files: *ignore_files
- ansible-collections-openstack-functional-devstack-stein-ansible-devel:
dependencies: *deps_unit_lint
irrelevant-files: *ignore_files
- ansible-collections-openstack-functional-devstack-stein-ansible-2.9: - ansible-collections-openstack-functional-devstack-stein-ansible-2.9:
dependencies: *deps_unit_lint dependencies: *deps_unit_lint
irrelevant-files: *ignore_files irrelevant-files: *ignore_files
- ansible-collections-openstack-functional-devstack-rocky-ansible-devel:
dependencies: *deps_unit_lint
irrelevant-files: *ignore_files
- ansible-collections-openstack-functional-devstack-rocky-ansible-2.9: - ansible-collections-openstack-functional-devstack-rocky-ansible-2.9:
dependencies: *deps_unit_lint dependencies: *deps_unit_lint
irrelevant-files: *ignore_files irrelevant-files: *ignore_files
- ansible-collections-openstack-functional-devstack-queens-ansible-2.9: - ansible-collections-openstack-functional-devstack-queens-ansible-2.9:
dependencies: *deps_unit_lint dependencies: *deps_unit_lint
irrelevant-files: *ignore_files irrelevant-files: *ignore_files
- ansible-collections-openstack-functional-devstack-ansible-2.9-pip:
dependencies: *deps_unit_lint
irrelevant-files: *ignore_files
gate: gate:
jobs: jobs:
- tox-pep8 - tox-pep8
- openstack-tox-linters-ansible-2.10
- openstack-tox-linters-ansible-2.9 - openstack-tox-linters-ansible-2.9
- ansible-collections-openstack-functional-devstack - ansible-collections-openstack-functional-devstack
- ansible-collections-openstack-functional-devstack-releases - ansible-collections-openstack-functional-devstack-releases
- ansible-collections-openstack-functional-devstack-ansible-2.9 - ansible-collections-openstack-functional-devstack-ansible-2.9
- ansible-collections-openstack-functional-devstack-ansible-2.10
- ansible-collections-openstack-functional-devstack-ansible-pip
- ansible-collections-openstack-functional-devstack-ussuri-ansible-2.9
- ansible-collections-openstack-functional-devstack-train-ansible-2.9 - ansible-collections-openstack-functional-devstack-train-ansible-2.9
- ansible-collections-openstack-functional-devstack-stein-ansible-2.9 - ansible-collections-openstack-functional-devstack-stein-ansible-2.9
- ansible-collections-openstack-functional-devstack-rocky-ansible-2.9 - ansible-collections-openstack-functional-devstack-rocky-ansible-2.9
- ansible-collections-openstack-functional-devstack-queens-ansible-2.9 - ansible-collections-openstack-functional-devstack-queens-ansible-2.9

@ -54,6 +54,16 @@ fi
shift $((OPTIND-1)) shift $((OPTIND-1))
TAGS=$( echo "$*" | tr ' ' , ) TAGS=$( echo "$*" | tr ' ' , )
# Install collections before dealing with Ansible virtual environments
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
# We need to source the current tox environment so that Ansible will # We need to source the current tox environment so that Ansible will
# be setup for the correct python environment. # be setup for the correct python environment.
source $ENVDIR/bin/activate source $ENVDIR/bin/activate
@ -96,15 +106,6 @@ then
exit 1 exit 1
fi fi
# install collections
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 # Discover openstackSDK version
SDK_VER=$(python -c "import openstack; print(openstack.version.__version__)") SDK_VER=$(python -c "import openstack; print(openstack.version.__version__)")
pushd ci/ pushd ci/

11
test-requirements-2.9.txt Normal file

@ -0,0 +1,11 @@
openstacksdk
ansible
pycodestyle
flake8
pylint
voluptuous
yamllint
rstcheck
ruamel.yaml
galaxy-importer
tox

@ -1,6 +1,5 @@
ansible
ansible-base
openstacksdk openstacksdk
ansible-base
pycodestyle pycodestyle
flake8 flake8
pylint pylint

@ -0,0 +1,9 @@
plugins/modules/compute_flavor_info.py pylint:ansible-deprecated-no-collection-name
plugins/modules/identity_domain_info.py pylint:ansible-deprecated-no-collection-name
plugins/modules/identity_user_info.py pylint:ansible-deprecated-no-collection-name
plugins/modules/image_info.py pylint:ansible-deprecated-no-collection-name
plugins/modules/networks_info.py pylint:ansible-deprecated-no-collection-name
plugins/modules/port_info.py pylint:ansible-deprecated-no-collection-name
plugins/modules/project_info.py pylint:ansible-deprecated-no-collection-name
plugins/modules/subnets_info.py pylint:ansible-deprecated-no-collection-name
plugins/module_utils/openstack.py pylint:ansible-deprecated-no-collection-name

@ -23,6 +23,8 @@ rm -rf "${ANSIBLE_COLLECTIONS_PATH}"
mkdir -p ${ANSIBLE_COLLECTIONS_PATH}/ansible_collections/openstack/cloud mkdir -p ${ANSIBLE_COLLECTIONS_PATH}/ansible_collections/openstack/cloud
cp -a ${TOXDIR}/{plugins,meta,scripts,tests,docs} ${ANSIBLE_COLLECTIONS_PATH}/ansible_collections/openstack/cloud cp -a ${TOXDIR}/{plugins,meta,scripts,tests,docs} ${ANSIBLE_COLLECTIONS_PATH}/ansible_collections/openstack/cloud
cd ${ANSIBLE_COLLECTIONS_PATH}/ansible_collections/openstack/cloud/ cd ${ANSIBLE_COLLECTIONS_PATH}/ansible_collections/openstack/cloud/
echo "Running ansible-test with version:"
ansible --version
ansible-test sanity -v \ ansible-test sanity -v \
--venv \ --venv \
--python 3.6 \ --python 3.6 \

22
tox.ini

@ -39,20 +39,30 @@ deps =
pbr pbr
ruamel.yaml ruamel.yaml
galaxy-importer galaxy-importer
git+https://github.com/ansible/ansible ansible-base
commands = commands =
python {toxinidir}/tools/build.py python {toxinidir}/tools/build.py
ansible --version
ansible-galaxy collection build --force {toxinidir} --output-path {toxinidir}/build_artifact ansible-galaxy collection build --force {toxinidir} --output-path {toxinidir}/build_artifact
/bin/bash {toxinidir}/tools/check-import.sh {toxinidir} /bin/bash {toxinidir}/tools/check-import.sh {toxinidir}
[testenv:linters] [testenv:linters]
passenv = * passenv = *
deps =
{[testenv]deps}
commands = commands =
{[testenv:build]commands} {[testenv:build]commands}
{[testenv:pep8]commands} {[testenv:pep8]commands}
ansible --version
/bin/bash {toxinidir}/tools/run-ansible-sanity.sh {toxinidir} /bin/bash {toxinidir}/tools/run-ansible-sanity.sh {toxinidir}
[testenv:linters-2.9]
passenv = {[testenv:linters]passenv}
commands = {[testenv:linters]commands}
deps =
-r{toxinidir}/test-requirements-2.9.txt
[testenv:venv] [testenv:venv]
deps = deps =
-r{toxinidir}/test-requirements.txt -r{toxinidir}/test-requirements.txt
@ -80,6 +90,16 @@ deps =
commands = commands =
/bin/bash {toxinidir}/ci/run-ansible-tests-collection.sh -e {envdir} {posargs} /bin/bash {toxinidir}/ci/run-ansible-tests-collection.sh -e {envdir} {posargs}
# PIP job runs with Ansible-2.9
[testenv:ansible-pip] [testenv:ansible-pip]
deps =
-r{toxinidir}/test-requirements-2.9.txt
{toxinidir}
passenv = {[testenv:ansible]passenv}
commands = {[testenv:ansible]commands}
[testenv:ansible-2.9]
deps =
-r{toxinidir}/test-requirements-2.9.txt
passenv = {[testenv:ansible]passenv} passenv = {[testenv:ansible]passenv}
commands = {[testenv:ansible]commands} commands = {[testenv:ansible]commands}