From 4bc8d1cf827868a2fcc3df7117c7996227307da3 Mon Sep 17 00:00:00 2001 From: Charles Short Date: Tue, 10 Aug 2021 13:58:16 -0400 Subject: [PATCH] Adding py39 gate and removing py36 gates from zuul Adding py39 gate. Removing redundant py36 Zuul jobs since we now have py39 Zuul jobs in place with the debian nodeset Story: 2006796 Task: 42980 Signed-off-by: Bernardo Decco Change-Id: I9a3d047b81c599b96b4ace040be237d16b655c99 --- .zuul.yaml | 18 +++++++++------- distributedcloud/test-requirements.txt | 1 + distributedcloud/tox.ini | 21 ++++++++++++++++++- tools/gate/playbooks/install-postgresql.yaml | 5 +++++ tools/gate/playbooks/roles | 1 + .../roles/install-postgresql/tasks/main.yaml | 8 +++++++ 6 files changed, 46 insertions(+), 8 deletions(-) create mode 100644 tools/gate/playbooks/install-postgresql.yaml create mode 120000 tools/gate/playbooks/roles create mode 100644 tools/gate/roles/install-postgresql/tasks/main.yaml diff --git a/.zuul.yaml b/.zuul.yaml index 171524ab6..a4d3da87f 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -10,14 +10,14 @@ - openstack-tox-linters - stx-distcloud-tox-pep8 - stx-distcloud-tox-py27 - - stx-distcloud-tox-py36 + - stx-distcloud-tox-py39 - stx-distcloud-tox-pylint gate: jobs: - openstack-tox-linters - stx-distcloud-tox-pep8 - stx-distcloud-tox-py27 - - stx-distcloud-tox-py36 + - stx-distcloud-tox-py39 - stx-distcloud-tox-pylint post: jobs: @@ -38,17 +38,21 @@ tox_extra_args: -c distributedcloud/tox.ini - job: - name: stx-distcloud-tox-py36 - parent: tox - description: Run py36 for distcloud - nodeset: ubuntu-bionic + name: stx-distcloud-tox-py39 + parent: tox-py39 + description: Run py39 for distcloud + nodeset: ubuntu-focal + pre-run: + - tools/gate/playbooks/install-postgresql.yaml required-projects: - starlingx/fault - starlingx/nfv - starlingx/update - starlingx/config + - starlingx/root vars: - tox_envlist: py36 + python_version: 3.9 + tox_envlist: py39 tox_extra_args: -c distributedcloud/tox.ini - job: diff --git a/distributedcloud/test-requirements.txt b/distributedcloud/test-requirements.txt index bc99c232f..385c96c10 100644 --- a/distributedcloud/test-requirements.txt +++ b/distributedcloud/test-requirements.txt @@ -21,3 +21,4 @@ pylint==1.9.2;python_version<"3.0" # GPLv2 pylint==2.3.1;python_version>="3.0" # GPLv2 PyYAML>=3.1.0 yamllint<1.26.1;python_version>="3.0" # GPLv2 +python-dev-tools;python_version>="3.0" diff --git a/distributedcloud/tox.ini b/distributedcloud/tox.ini index 6180cdf94..49f39b0fc 100644 --- a/distributedcloud/tox.ini +++ b/distributedcloud/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = pep8,py27,pylint +envlist = pep8,py27,py39,pylint minversion = 2.3 skipsdist = True @@ -16,6 +16,7 @@ fm_api_src_dir = {[dc]stx_fault_dir}/fm-api/source tsconfig_src_dir = ../../config/tsconfig/tsconfig cgtsclient_src_dir = ../../config/sysinv/cgts-client/cgts-client cgcs_patch_src_dir = ../../update/cgcs-patch/cgcs-patch +stx_root_dir = ../../root [testenv] sitepackages = False @@ -65,6 +66,24 @@ commands = find {toxinidir} -not -path '{toxinidir}/.tox/*' -name '*.py[c|o]' -delete python setup.py testr --slowest --testr-args='{posargs}' +[testenv:py39] +basepython = python3.9 +install_command = pip install -v -v -v \ + -c {[dc]stx_root_dir}/build-tools/requirements/debian/upper-constraints.txt \ + {opts} {packages} +deps = -r{toxinidir}/test-requirements.txt + -r{toxinidir}/requirements.txt + keyring + -e{[dc]nfv_client_src_dir} + -e{[dc]tsconfig_src_dir} + -e{[dc]fmclient_src_dir} + -e{[dc]fm_api_src_dir} + -e{[dc]cgtsclient_src_dir} +commands = + find {toxinidir} -not -path '{toxinidir}/.tox/*' -name '*.py[c|o]' -delete + python setup.py testr --slowest --testr-args='{posargs}' + + [testenv:debug-py27] basepython = python2.7 commands = oslo_debug_helper {posargs} diff --git a/tools/gate/playbooks/install-postgresql.yaml b/tools/gate/playbooks/install-postgresql.yaml new file mode 100644 index 000000000..194dffe10 --- /dev/null +++ b/tools/gate/playbooks/install-postgresql.yaml @@ -0,0 +1,5 @@ +--- +- hosts: all + gather_facts: false + roles: + - install-postgresql diff --git a/tools/gate/playbooks/roles b/tools/gate/playbooks/roles new file mode 120000 index 000000000..7b9ade87e --- /dev/null +++ b/tools/gate/playbooks/roles @@ -0,0 +1 @@ +../roles/ \ No newline at end of file diff --git a/tools/gate/roles/install-postgresql/tasks/main.yaml b/tools/gate/roles/install-postgresql/tasks/main.yaml new file mode 100644 index 000000000..5bbe62a41 --- /dev/null +++ b/tools/gate/roles/install-postgresql/tasks/main.yaml @@ -0,0 +1,8 @@ +--- +- name: Install postgresql + shell: | + set -xe + apt-get update -y + apt-get install -y libffi-dev libxml2-dev libxslt1-dev libldap2-dev \ + libsasl2-dev libpq-dev libyaml-dev + become: true