From 85b776bc8617b21b521d1f7d11b132e7ee747c44 Mon Sep 17 00:00:00 2001 From: Grzegorz Grasza Date: Mon, 26 Nov 2018 21:06:55 +0100 Subject: [PATCH] Run functional tests on Python 3 The functional job roles are extended with an option to specify python version to run with and a new CI job is created. python-memcached is added to requirements.txt, since it is used in the default keystonemiddleware configuration. Change-Id: I0b77b150785a90b411cba4ffc4b89cc67646e2ac --- .zuul.yaml | 13 +++++++++++++ bindep.txt | 3 +++ requirements.txt | 1 + roles/configure-freeipa/tasks/main.yaml | 2 ++ roles/configure-novajoin/tasks/main.yaml | 10 ++++++++-- tox.ini | 10 ++++++++++ 6 files changed, 37 insertions(+), 2 deletions(-) diff --git a/.zuul.yaml b/.zuul.yaml index d064d49..069e926 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -3,6 +3,8 @@ jobs: - novajoin-functional: voting: false + - novajoin-functional-py3: + voting: false - job: name: novajoin-functional @@ -39,3 +41,14 @@ # Disable Cinder services c-bak: false c-vol: false + +- job: + name: novajoin-functional-py3 + description: | + Run functional tests under Python 3. + parent: novajoin-functional + nodeset: devstack-single-node-fedora-latest + vars: + tox_envlist: functional-py3 + bindep_profile: test py3 + python_version: 3 diff --git a/bindep.txt b/bindep.txt index 41fa95d..c31656d 100644 --- a/bindep.txt +++ b/bindep.txt @@ -3,3 +3,6 @@ python-ipalib python-ipaclient + +python3-ipalib [py3] +python3-ipaclient [py3] diff --git a/requirements.txt b/requirements.txt index 685c9d0..7a5dc37 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,6 +7,7 @@ Paste>=2.0.2 # MIT Routes>=2.3.1 # MIT six>=1.10.0 # MIT python-keystoneclient>=3.8.0 # Apache-2.0 +python-memcached>=1.59 # PSF keystoneauth1>=3.3.0 # Apache-2.0 oslo.concurrency>=3.25.0 # Apache-2.0 oslo.config>=6.1.0 # Apache-2.0 diff --git a/roles/configure-freeipa/tasks/main.yaml b/roles/configure-freeipa/tasks/main.yaml index d1a33c5..06a044f 100644 --- a/roles/configure-freeipa/tasks/main.yaml +++ b/roles/configure-freeipa/tasks/main.yaml @@ -21,6 +21,7 @@ name: urllib3 state: absent become: true + when: python_version is not defined - name: Install FreeIPA package: @@ -35,6 +36,7 @@ check_mode: true ignore_errors: yes register: mod_nss_check + become: true - name: Remove mod_ssl config which conflicts with FreeIPA file: diff --git a/roles/configure-novajoin/tasks/main.yaml b/roles/configure-novajoin/tasks/main.yaml index de699d4..c8e2965 100644 --- a/roles/configure-novajoin/tasks/main.yaml +++ b/roles/configure-novajoin/tasks/main.yaml @@ -1,10 +1,16 @@ - name: Build novajoin - command: python setup.py build + command: python{{ python_version|default('') }} setup.py build args: chdir: '{{ zuul.project.src_dir }}' +- name: Install novajoin requirements + command: python{{ python_version|default('') }} -m pip install -r requirements.txt + args: + chdir: '{{ zuul.project.src_dir }}' + become: true + - name: Install novajoin - command: python setup.py install + command: python{{ python_version|default('') }} setup.py install args: chdir: '{{ zuul.project.src_dir }}' become: true diff --git a/tox.ini b/tox.ini index 94bb66a..22c6952 100644 --- a/tox.ini +++ b/tox.ini @@ -76,3 +76,13 @@ setenv = commands = /usr/bin/find . -type f -name "*.py[c|o]" -delete stestr run --slowest {posargs} + +[testenv:functional-py3] +basepython = python3 +sitepackages = true +deps = -r{toxinidir}/test-requirements.txt +setenv = + OS_TEST_PATH={toxinidir}/novajoin/tests/functional +commands = + /usr/bin/find . -type f -name "*.py[c|o]" -delete + stestr run --slowest {posargs}