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.
    * Used 'coverage' library for coverage.
    * Added 'python3' as basepython for pep8, venv, coverage.
    * Added 'doc/requirements.txt' file for pep8.

Change-Id: I5ca248f31d1b6f2afaf484ce19fcf0e96f35119f
This commit is contained in:
Shyam Singh 2020-07-15 11:24:09 +05:30
parent 7d04600361
commit 8ce07e7201
5 changed files with 79 additions and 26 deletions

View File

@ -14,34 +14,34 @@
- 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
- test-release-openstack: - test-release-openstack:
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
- test-release-openstack: - test-release-openstack:
required-projects: required-projects:
- name: openstack/requirements - name: openstack/requirements
override-checkout: stable/rocky override-checkout: stable/stein

14
doc/requirements.txt Normal file
View File

@ -0,0 +1,14 @@
# The order of packages is significant, because pip processes them in the order
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
# Order matters to the pip dependency resolver, so sorting this file
# changes how packages are installed. New dependencies should be
# added in alphabetical order, however, some dependencies may need to
# be installed in a specific order.
openstackdocstheme>=1.18.1 # Apache-2.0
reno>=2.5.0 # Apache-2.0
sphinx!=1.6.6,!=1.6.7,>=1.6.2,<2.0.0;python_version=='2.7' # BSD
sphinx!=1.6.6,!=1.6.7,>=1.6.2;python_version>='3.4' # BSD
# The below is rewquired to build testing module reference
mock>=2.0.0 # BSD

View File

@ -7,8 +7,8 @@
# be installed in a specific order. # be installed in a specific order.
# #
# Hacking should appear first in case something else depends on pep8 # Hacking should appear first in case something else depends on pep8
hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0 hacking>=1.1.0,<2 # Apache-2.0
# Replacing Horizon git URL reference as stable/rocky constraints are applied. # Replacing Horizon git URL reference as stable/stein constraints are applied.
horizon horizon
# #
bandit>=1.4.0 # Apache-2.0 bandit>=1.4.0 # Apache-2.0

View File

@ -67,5 +67,6 @@ def main(argv):
install.install_dependencies() install.install_dependencies()
print_help(venv, root) print_help(venv, root)
if __name__ == '__main__': if __name__ == '__main__':
main(sys.argv) main(sys.argv)

70
tox.ini
View File

@ -1,34 +1,47 @@
[tox] [tox]
envlist = py26,py27,py27dj14,py27dj15,pep8,py33,py35,py35dj111 envlist = py26,py27,pep8,py35,py3-dj111
minversion = 1.6 minversion = 2.3.2
skipsdist = True skipsdist = True
[testenv] [testenv]
usedevelop = True usedevelop = True
install_command = pip install -U {opts} {packages} install_command = pip install {opts} {packages}
setenv = VIRTUAL_ENV={envdir} setenv = VIRTUAL_ENV={envdir}
NOSE_WITH_OPENSTACK=1
NOSE_OPENSTACK_COLOR=1
NOSE_OPENSTACK_RED=0.05
NOSE_OPENSTACK_YELLOW=0.025
NOSE_OPENSTACK_SHOW_ELAPSED=1
# Note the hash seed is set to 0 until gbpui can be tested with a # Note the hash seed is set to 0 until gbpui can be tested with a
# random hash seed successfully. # random hash seed successfully.
PYTHONHASHSEED=0 PYTHONHASHSEED=0
deps = deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/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 = /bin/bash run_tests.sh -N --no-pep8 {posargs} commands = /bin/bash run_tests.sh -N --no-pep8 {posargs}
[testenv:pep8] [testenv:pep8]
commands = /bin/bash run_tests.sh -N --pep8 basepython = python3
# NOTE: Due to doc dependencies, we don't share envdir with "venv".
# sphinx (precisely Pygments) needs to be installed to make doc8 work properly
deps =
{[testenv]deps}
-r{toxinidir}/doc/requirements.txt
setenv =
{[testenv]setenv}
DJANGO_SETTINGS_MODULE=openstack_dashboard.test.settings
commands =
/bin/bash run_tests.sh -N --pep8
[testenv:venv] [testenv:venv]
basepython = python3
commands = {posargs} commands = {posargs}
[testenv:cover] [testenv:cover]
commands = /bin/bash run_tests.sh -N --no-pep8 --coverage {posargs} basepython = python3
envdir = {toxworkdir}/venv
commands =
coverage erase
coverage run {toxinidir}/manage.py test gbpui/horizon --settings=horizon.test.settings {posargs}
coverage run -a {toxinidir}/manage.py test gbpui/openstack_dashboard --settings=openstack_dashboard.test.settings --exclude-tag integration {posargs}
coverage xml
coverage html
[testenv:py27dj14] [testenv:py27dj14]
basepython = python2.7 basepython = python2.7
@ -54,27 +67,52 @@ commands = nodeenv -p
/bin/bash run_tests.sh -N --jshint /bin/bash run_tests.sh -N --jshint
[testenv:docs] [testenv:docs]
basepython = python3
# We need to install horizon dependecies to build module references
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/stein}
-r{toxinidir}/requirements.txt
-r{toxinidir}/doc/requirements.txt
setenv = DJANGO_SETTINGS_MODULE=openstack_dashboard.test.settings setenv = DJANGO_SETTINGS_MODULE=openstack_dashboard.test.settings
commands = python setup.py build_sphinx commands = python setup.py build_sphinx
[testenv:py35dj111] [testenv:py3-dj21]
basepython = python3 basepython = python3
commands = pip install django>=1.11 commands = pip install django>=2.1<2.2
/bin/bash run_tests.sh -N --no-pep8 {posargs} /bin/bash run_tests.sh -N --no-pep8 {posargs}
[testenv:py35integration] [testenv:py3-dj111]
basepython = python3 basepython = python3
commands = /bin/bash run_tests.sh -N --integration --selenium-headless {posargs} commands = pip install django>=1.11,<2
/bin/bash run_tests.sh -N --no-pep8 {posargs}
[testenv:py3integration]
basepython = python3
envdir = {toxworkdir}/venv
# Run integration tests only
setenv =
PYTHONHASHSEED=0
INTEGRATION_TESTS=1
SELENIUM_HEADLESS=1
commands =
{envpython} {toxinidir}/manage.py test gbpui/openstack_dashboard --settings=openstack_dashboard.test.settings --verbosity 2 --tag integration {posargs}
{envpython} {toxinidir}/manage.py test gbpui/horizon --settings=openstack_dashboard.test.settings --verbosity 2 --tag integration {posargs}
[flake8] [flake8]
exclude = .venv,.git,.tox,dist,*openstack/common*,*lib/python*,*egg,build,panel_template,dash_template,local_settings.py,*/local/*,*/test/test_plugins/*,.ropeproject exclude = .venv,.git,.tox,dist,*openstack/common*,*lib/python*,*egg,build,panel_template,dash_template,local_settings.py,*/local/*,*/test/test_plugins/*,.ropeproject
# E731 do not assign a lambda expression, use a def
# E127 continuation line over-indented for visual indent # E127 continuation line over-indented for visual indent
# E128 continuation line under-indented for visual indent # E128 continuation line under-indented for visual indent
# F405 TEMPLATES may be undefined, or defined from star imports
# (because it is not easy to avoid this in openstack_dashboard.test.settings)
# H307 like imports should be grouped together # H307 like imports should be grouped together
# H405 multi line docstring summary not separated with an empty line # H405 multi line docstring summary not separated with an empty line
# H803 git commit title should not end with period (disabled on purpose, see bug #1236621) # H803 git commit title should not end with period (disabled on purpose, see bug #1236621)
# H904 Wrap long lines in parentheses instead of a backslash # H904 Wrap long lines in parentheses instead of a backslash
ignore = E127,E128,H307,H405,H803,H904 # W504 line break after binary operator
# (W503 and W504 are incompatible and we need to choose one of them.
# Existing codes follows W503, so we disable W504.)
ignore = E127,E128,E731,F405,H307,H405,H803,H904,W504
[hacking] [hacking]
import_exceptions = collections.defaultdict, import_exceptions = collections.defaultdict,