Upgrade for stable/stein branch

* Updated 'test-requirements.txt', 'tox.ini'  with relevant
        'stable/stein' branch libraries.
    * Added zuul jobs w.r.t. 'stable/stein' release.
    * Updated pbr in 'setup.py'.
    * Added 'flake8-import-order' & 'stestr' library.
    * Removed 'testr' dependency from tox test envrironment.
    * Used 'coverage' library for coverage.
    * Added python3 as basepython.

Change-Id: I4f9da2fb661cfe2abb9002fcb47e1637a5a69a51
This commit is contained in:
Shyam Singh 2020-06-18 21:02:45 +05:30
parent 93232e3f6f
commit 41d002a352
9 changed files with 59 additions and 26 deletions

3
.stestr.conf Normal file
View File

@ -0,0 +1,3 @@
[DEFAULT]
test_path=${OS_TEST_PATH:-./gbpautomation/heat/tests}
top_dir=./

View File

@ -14,26 +14,26 @@
- openstack-tox-pep8: - openstack-tox-pep8:
required-projects: required-projects:
- name: openstack/requirements - name: openstack/requirements
override-checkout: stable/rocky override-checkout: stable/stein
- openstack-tox-py27: - openstack-tox-py27:
required-projects: required-projects:
- name: openstack/requirements - name: openstack/requirements
override-checkout: stable/rocky override-checkout: stable/stein
- openstack-tox-py35: - openstack-tox-py35:
required-projects: required-projects:
- name: openstack/requirements - name: openstack/requirements
override-checkout: stable/rocky override-checkout: stable/stein
gate: gate:
jobs: jobs:
- openstack-tox-pep8: - openstack-tox-pep8:
required-projects: required-projects:
- name: openstack/requirements - name: openstack/requirements
override-checkout: stable/rocky override-checkout: stable/stein
- openstack-tox-py27: - openstack-tox-py27:
required-projects: required-projects:
- name: openstack/requirements - name: openstack/requirements
override-checkout: stable/rocky override-checkout: stable/stein
- openstack-tox-py35: - openstack-tox-py35:
required-projects: required-projects:
- name: openstack/requirements - name: openstack/requirements
override-checkout: stable/rocky override-checkout: stable/stein

View File

@ -4,7 +4,7 @@
contain the root `toctree` directive. contain the root `toctree` directive.
Welcome to group-based-policy-automation's documentation! Welcome to group-based-policy-automation's documentation!
======================================================== =========================================================
Contents: Contents:

View File

@ -11,6 +11,7 @@
# under the License. # under the License.
import copy import copy
import mock import mock
import six import six

View File

@ -11,6 +11,7 @@
# under the License. # under the License.
import copy import copy
import mock import mock
import six import six

View File

@ -48,3 +48,6 @@ output_file = gbpautomation/locale/group-based-policy-automation.pot
[entry_points] [entry_points]
heat.clients = heat.clients =
grouppolicy = gbpautomation.heat.engine.clients.os.grouppolicy:GBPClientPlugin grouppolicy = gbpautomation.heat.engine.clients.os.grouppolicy:GBPClientPlugin
[flake8]
import-order-style = pep8

View File

@ -25,5 +25,5 @@ except ImportError:
pass pass
setuptools.setup( setuptools.setup(
setup_requires=['pbr>=1.8'], setup_requires=['pbr>=2.0.0'],
pbr=True) pbr=True)

View File

@ -2,26 +2,21 @@
# of appearance. Changing the order has an impact on the overall integration # of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later. # process, which may cause wedges in the gate later.
-e git+https://opendev.org/openstack/heat.git@stable/rocky#egg=heat -e git+https://opendev.org/openstack/heat.git@stable/stein#egg=heat
-e git+https://opendev.org/x/python-group-based-policy-client.git@master#egg=gbpclient -e git+https://opendev.org/x/python-group-based-policy-client.git@master#egg=gbpclient
# Hacking already pins down pep8, pyflakes and flake8 # Hacking already pins down pep8, pyflakes and flake8
hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0 hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0
bandit<1.6.0,>=1.1.0 # Apache-2.0 bandit<1.6.0,>=1.1.0 # Apache-2.0
coverage!=4.4,>=4.0 # Apache-2.0 coverage!=4.4,>=4.0 # Apache-2.0
fixtures>=3.0.0 # Apache-2.0/BSD flake8-import-order==0.12 # LGPLv3
kombu!=4.0.2,>=4.0.0 # BSD kombu!=4.0.2,>=4.0.0 # BSD
mock>=2.0 # BSD
PyMySQL>=0.7.6 # MIT License PyMySQL>=0.7.6 # MIT License
openstackdocstheme>=1.18.1 # Apache-2.0
os-api-ref>=1.4.0 # Apache-2.0
os-testr>=1.0.0 # Apache-2.0 os-testr>=1.0.0 # Apache-2.0
oslotest>=3.2.0 # Apache-2.0 oslotest>=3.2.0 # Apache-2.0
qpid-python>=0.26;python_version=='2.7' # Apache-2.0 qpid-python>=0.26;python_version=='2.7' # Apache-2.0
psycopg2>=2.6.2 # LGPL/ZPL psycopg2>=2.6.2 # LGPL/ZPL
sphinx!=1.6.6,>=1.6.2;python_version>='3.4' # BSD stestr>=2.0.0 # Apache-2.0
sphinx!=1.6.6,>=1.6.2,<2.0.0;python_version=='2.7' # BSD
testrepository>=0.0.18 # Apache-2.0/BSD testrepository>=0.0.18 # Apache-2.0/BSD
testscenarios>=0.4 # Apache-2.0/BSD testscenarios>=0.4 # Apache-2.0/BSD
testtools>=2.2.0 # MIT testtools>=2.2.0 # MIT
testresources>=2.0.0 # Apache-2.0/BSD testresources>=2.0.0 # Apache-2.0/BSD
reno>=2.5.0 # Apache-2.0

50
tox.ini
View File

@ -1,46 +1,64 @@
[tox] [tox]
envlist = py27,py35, pep8 envlist = py27,py35,py36,pep8
minversion = 2.3.2 minversion = 1.6
skipsdist = True skipsdist = True
[testenv] [testenv]
# Note the hash seed is set to 0 until heat can be tested with a # Note the hash seed is set to 0 until heat can be tested with a
# random hash seed successfully. # random hash seed successfully.
setenv = VIRTUAL_ENV={envdir} setenv = VIRTUAL_ENV={envdir}
PYTHONWARNINGS=default::DeprecationWarning
OS_TEST_PATH=gbpautomation/heat/tests
PYTHONHASHSEED=0 PYTHONHASHSEED=0
usedevelop = True usedevelop = True
install_command = pip install {opts} {packages} install_command = pip install {opts} {packages}
deps = deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/rocky} -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/stein}
-r{toxinidir}/requirements.txt -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt -r{toxinidir}/test-requirements.txt
commands = commands =
python setup.py testr --slowest --testr-args='^(?!functionaltests) {posargs}' stestr run '^(?!functionaltests){posargs}'
stestr slowest
whitelist_externals = bash whitelist_externals =
bash
# to avoid deprecation warning due to 'find' in cover env.
find
[testenv:functional] [testenv:functional]
commands = commands =
python -c "print('TODO: functional tests')" python -c "print('TODO: functional tests')"
[testenv:pep8] [testenv:pep8]
basepython = python3
commands = commands =
flake8 flake8
# Check that .po and .pot files are valid: # Check that .po and .pot files are valid:
# bash -c "find gbpautomation -type f -regex '.*\.pot?' -print0|xargs -0 -n 1 msgfmt --check-format -o /dev/null" # bash -c "find gbpautomation -type f -regex '.*\.pot?' -print0|xargs -0 -n 1 msgfmt --check-format -o /dev/null"
[testenv:venv] [testenv:venv]
basepython = python3
commands = {posargs} commands = {posargs}
[testenv:cover] [testenv:cover]
basepython = python3
setenv =
PYTHON=coverage run --source gbpautomation --parallel-mode
commands = commands =
python setup.py testr --coverage --testr-args='{posargs}' coverage erase
find {toxinidir} -not -path '{toxinidir}/.tox/*' -not -path '*/__pycache__/*' -name '*.py[c|o]' -delete
stestr run {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
coverage report
[testenv:docs] [testenv:docs]
deps = -r{toxinidir}/requirements.txt basepython = python3
-r{toxinidir}/test-requirements.txt deps = -r{toxinidir}/doc/requirements.txt
sphinxcontrib-httpdomain commands =
commands = python setup.py build_sphinx rm -rf doc/build
sphinx-build -W -b html doc/source doc/build/html
[flake8] [flake8]
# H302 import only modules.'bla..' does not import a module # H302 import only modules.'bla..' does not import a module
@ -50,3 +68,15 @@ ignore = H302,H404,H803
show-source = true show-source = true
builtins = _ builtins = _
exclude=.venv,.git,.tox,dist,*openstack/common*,*lib/python*,*egg,tools,build exclude=.venv,.git,.tox,dist,*openstack/common*,*lib/python*,*egg,tools,build
[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
# separately, outside of the requirements files, and develop mode disabled
# explicitly to avoid unnecessarily installing the checked-out repo too (this
# further relies on "tox.skipsdist = True" above).
deps = bindep
commands = bindep test
usedevelop = False