Browse Source

Run unit tests by py38 as well

Let's use openstack-python3-wallaby-jobs template.
Also update setup.cfg to be compatible with supported pythons.
flake8==2.6.2 and pyflakes==2.0.0 seems not to be compatible
with python3.8 on Ubuntu so the patch addresses this as well.

Change-Id: Ic09b2d836315d9a223bb8592d0e48ef475c56aa5
changes/41/754041/4
Martin Kopec 1 year ago
parent
commit
c3ea997627
  1. 4
      .zuul.yaml
  2. 6
      config_tempest/services/identity.py
  3. 2
      config_tempest/services/image.py
  4. 2
      roles/generate-tempestconf-file-cloud/tasks/main.yaml
  5. 2
      setup.cfg
  6. 6
      test-requirements.txt
  7. 4
      tox.ini

4
.zuul.yaml

@ -1,13 +1,12 @@
- project:
templates:
- openstack-cover-jobs
- openstack-python36-jobs
- openstack-python3-wallaby-jobs
- openstack-python37-jobs
- publish-openstack-docs-pti
- release-notes-jobs-python3
check:
jobs:
- openstack-tox-pep8
- python-tempestconf-tempest-devstack-admin
- python-tempestconf-tempest-devstack-admin-train
- python-tempestconf-tempest-devstack-admin-stein
@ -30,7 +29,6 @@
irrelevant-files: *irrelevant-files
gate:
jobs:
- openstack-tox-pep8
- python-tempestconf-tempest-devstack-admin
- python-tempestconf-tempest-devstack-admin-train
- python-tempestconf-tempest-devstack-admin-stein

6
config_tempest/services/identity.py

@ -105,9 +105,9 @@ class IdentityService(VersionedService):
try:
versions = []
for v in body['versions']['values']:
# TripleO is in transition to v3 only, so the environment
# still returns v2 versions even though they're deprecated.
# Therefor pick only versions with stable status.
# TripleO is in transition to v3 only, so the environment
# still returns v2 versions even though they're deprecated.
# Therefor pick only versions with stable status.
if v['status'] == 'stable':
versions.append(v['id'])
return versions

2
config_tempest/services/image.py

@ -143,7 +143,7 @@ class ImageService(VersionedService):
C.LOG.info("Creating image '%s'", image_name)
if image_source.startswith("http:") or \
image_source.startswith("https:"):
self._download_file(image_source, image_dest)
self._download_file(image_source, image_dest)
else:
try:
shutil.copyfile(image_source, image_dest)

2
roles/generate-tempestconf-file-cloud/tasks/main.yaml

@ -105,7 +105,7 @@
- name: Compare tempest.conf and tempest_profile.conf
shell: |
python ./roles/generate-tempestconf-file-cloud/tasks/compare-ini.py ./etc/cloud_tempest.conf ./etc/tempest_profile.conf
python3 ./roles/generate-tempestconf-file-cloud/tasks/compare-ini.py ./etc/cloud_tempest.conf ./etc/tempest_profile.conf
args:
chdir: "{{ tempestconf_src_relative_path }}"

2
setup.cfg

@ -18,6 +18,8 @@ classifier =
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
[files]
packages =

6
test-requirements.txt

@ -2,9 +2,9 @@
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
hacking>=1.1.0,<1.2.0 # Apache-2.0
pyflakes>=0.8,<=2.0.0 # MIT
flake8<3.0.0 # MIT
hacking>=1.1.0,!=1.2.0 # Apache-2.0
pyflakes>=0.8,!=2.0.0 # MIT
flake8!=3.0.0,!=2.6.2 # MIT
coverage>=4.0 # Apache-2.0
python-subunit>=0.0.18 # Apache-2.0/BSD
oslotest>=1.10.0 # Apache-2.0

4
tox.ini

@ -1,6 +1,6 @@
[tox]
minversion = 3.1.1
envlist = py37,py36,pypy,pep8
envlist = py38,py37,py36,pypy,pep8
skipsdist = True
# this allows tox to infer the base python from the environment name
# and override any basepython configured in this file
@ -22,7 +22,7 @@ commands =
stestr --test-path ./config_tempest/tests run {posargs}
[testenv:pep8]
commands = flake8 {posargs}
commands = flake8 --ignore=W504 {posargs}
[testenv:venv]
commands = {posargs}

Loading…
Cancel
Save