From 2eb80678450817f3118c8b16534d65ae5b1037d6 Mon Sep 17 00:00:00 2001 From: Martin Kopec Date: Mon, 14 Dec 2020 20:48:48 +0000 Subject: [PATCH] Fix CI, Drop python2 and 3.5, update jobs to python3 * Starting in mysql8, we can't expect a db user to be created with the GRANT command, we'll need to create one explicitly. * OpenStack has dropped the py2.7 and py3.5 support in ussuri cycle. From now on, refstack will test only with py3 jobs. Complete discussion & schedule can be found in - http://lists.openstack.org/pipermail/openstack-discuss/2019-October/010142.html - https://etherpad.openstack.org/p/drop-python2-support Ussuri Communtiy-wide goal: https://governance.openstack.org/tc/goals/selected/ussuri/drop-py27.html * Replace the "refstack-tox-py36-func-mysql" with "refstack-tox-functional" to simplify naming and use the system default python3 version for this functional job. Story: 2003257 Task: 24062 Change-Id: I90ab2eca6366f0b6256f097712efac2ffe08b2c0 --- .zuul.yaml | 35 +++++++---------------------------- requirements.txt | 2 +- setup.cfg | 4 +--- tools/test-setup.sh | 4 ++-- tox.ini | 27 +++++---------------------- 5 files changed, 16 insertions(+), 56 deletions(-) diff --git a/.zuul.yaml b/.zuul.yaml index 6afae0f8..76c339a8 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -3,44 +3,23 @@ - nodejs6-jobs - publish-openstack-docs-pti - openstack-cover-jobs - # Disable since it fails - # - openstack-python-jobs - # - openstack-python35-jobs - - openstack-python36-jobs + - openstack-python3-wallaby-jobs check: jobs: - - refstack-tox-py27-func-mysql: - voting: false - - refstack-tox-py36-func-mysql + - refstack-tox-functional gate: jobs: - # - refstack-tox-py27-func-mysql - - refstack-tox-py36-func-mysql + - refstack-tox-functional - job: - name: refstack-tox-py27-func-mysql + name: refstack-tox-functional parent: openstack-tox description: | - Run unit tests for an OpenStack Python project under cPython version 2.7. - - Uses tox with the ``py27-func-mysql`` environment. + Run functional tests for an OpenStack Python project under cPython 3. + Uses tox with the ``functional`` environment. irrelevant-files: - ^.*\.rst$ - ^doc/.*$ - ^releasenotes/.*$ vars: - tox_envlist: py27-func-mysql - -- job: - name: refstack-tox-py36-func-mysql - parent: openstack-tox - description: | - Run unit tests for an OpenStack Python project under cPython version 3.6. - - Uses tox with the ``py36-func-mysql`` environment. - irrelevant-files: - - ^.*\.rst$ - - ^doc/.*$ - - ^releasenotes/.*$ - vars: - tox_envlist: py36-func-mysql + tox_envlist: functional diff --git a/requirements.txt b/requirements.txt index 3d949eb3..c9de66e4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -12,7 +12,7 @@ six>=1.9.0 # MIT pecan>=0.8.2 requests>=2.2.0,!=2.4.0 requests-cache>=0.4.9 -jsonschema>=2.0.0,<3.0.0 +jsonschema>=3.2.0 PyJWT>=1.0.1 # MIT WebOb>=1.7.1 # MIT PyMySQL>=0.6.2,!=0.6.4 diff --git a/setup.cfg b/setup.cfg index 26a80663..95c9951a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -13,10 +13,8 @@ classifier = License :: OSI Approved :: Apache Software License Operating System :: POSIX :: Linux Programming Language :: Python - Programming Language :: Python :: 2 - Programming Language :: Python :: 2.7 Programming Language :: Python :: 3 - Programming Language :: Python :: 3.5 + Programming Language :: Python :: 3.6 [files] packages = diff --git a/tools/test-setup.sh b/tools/test-setup.sh index 07a07854..505a58cb 100755 --- a/tools/test-setup.sh +++ b/tools/test-setup.sh @@ -23,8 +23,8 @@ sudo -H mysqladmin -u root password $DB_ROOT_PW sudo -H mysql -u root -p$DB_ROOT_PW -h localhost -e " DELETE FROM mysql.user WHERE User=''; FLUSH PRIVILEGES; - GRANT ALL PRIVILEGES ON *.* - TO '$DB_USER'@'%' identified by '$DB_PW' WITH GRANT OPTION;" + CREATE USER '$DB_USER'@'%' IDENTIFIED BY '$DB_PW'; + GRANT ALL PRIVILEGES ON *.* TO '$DB_USER'@'%' WITH GRANT OPTION;" # Now create our database. mysql -u $DB_USER -p$DB_PW -h 127.0.0.1 -e " diff --git a/tox.ini b/tox.ini index cc1143c3..bb97b7c1 100644 --- a/tox.ini +++ b/tox.ini @@ -1,12 +1,10 @@ [tox] -# py3* tests should be run before py27 -# it is a workaround for testr bug -# https://bugs.launchpad.net/testrepository/+bug/1229445 -envlist = py35,py36,py27,pep8,pip-check-reqs -minversion = 1.6 +envlist = py36,pep8,pip-check-reqs +minversion = 2.0 skipsdist = True [testenv] +basepython = python3 usedevelop = True install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} -U {opts} {packages} setenv = VIRTUAL_ENV={envdir} @@ -19,8 +17,8 @@ commands = /bin/rm -f .testrepository/times.dbm python setup.py testr --slowest --testr-args='{posargs}' distribute = false -[testenv:py27-func-mysql] -basepython = python2.7 +[testenv:functional] +basepython = python3 setenv = SUBUNIT_TEST_PATH=./refstack/tests/api # Integration/functional tests # must not be run in parallel (--concurrency=1), @@ -28,16 +26,6 @@ setenv = SUBUNIT_TEST_PATH=./refstack/tests/api # require cleanup of database commands = {toxinidir}/setup-mysql-tests.sh python setup.py testr --slowest --testr-args='{posargs:--concurrency=1}' -[testenv:py36-func-mysql] -basepython = python3.6 -setenv = SUBUNIT_TEST_PATH=./refstack/tests/api -# Integration/functional tests -# must not be run in parallel (--concurrency=1), -# because each of these tests -# require cleanup of database -commands = {toxinidir}/setup-mysql-tests.sh python setup.py testr --slowest --testr-args='{posargs:--concurrency=1}' - - [testenv:pep8] commands = flake8 {posargs} @@ -90,12 +78,7 @@ commands= [testenv:debug] commands = oslo_debug_helper -t refstack/tests/unit {posargs} -[testenv:debug35] -basepython = python3.5 -commands = oslo_debug_helper -t refstack/tests/unit {posargs} - [testenv:bindep] -basepython = python3 # Do not install any requirements. We want this to be fast and work even if # system dependencies are missing, since it's used to tell you what system # dependencies are missing! This also means that bindep must be installed