From d6805491ed27e908c436f3a7345fcb9e094f8cd1 Mon Sep 17 00:00:00 2001 From: Graham Hayes Date: Wed, 13 Jun 2018 15:00:17 +0100 Subject: [PATCH] General overhaul of testing setup - Moved to py3 by default - Moved to testr - Updated docs venv to match PTI - Fixed a slight py3 compat issue - Added py35 and py36 jobs Change-Id: Id3a8c1c30ecfe9b6538bff6357aecca7ecd0ed81 Signed-off-by: Graham Hayes --- .gitignore | 1 + .stestr.conf | 3 +++ .zuul.yaml | 4 ++++ doc/requirements.txt | 5 +++++ os_api_ref/__init__.py | 3 ++- test-requirements.txt | 1 + tox.ini | 15 +++++++++++---- 7 files changed, 27 insertions(+), 5 deletions(-) create mode 100644 .stestr.conf create mode 100644 doc/requirements.txt diff --git a/.gitignore b/.gitignore index e52bb44..db20394 100644 --- a/.gitignore +++ b/.gitignore @@ -29,6 +29,7 @@ cover/ nosetests.xml .testrepository .venv +.stestr/ # Translations *.mo diff --git a/.stestr.conf b/.stestr.conf new file mode 100644 index 0000000..bad44ae --- /dev/null +++ b/.stestr.conf @@ -0,0 +1,3 @@ +[DEFAULT] +test_path=${OS_TEST_PATH:-./os_api_ref/tests} +top_dir=./ \ No newline at end of file diff --git a/.zuul.yaml b/.zuul.yaml index cb9d08d..ff000d0 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -10,6 +10,10 @@ - openstack/os-api-ref - project: + templates: + - openstack-python-jobs + - openstack-python35-jobs + - openstack-python36-jobs check: jobs: - os-api-ref-nova-src diff --git a/doc/requirements.txt b/doc/requirements.txt new file mode 100644 index 0000000..a3c53b4 --- /dev/null +++ b/doc/requirements.txt @@ -0,0 +1,5 @@ +# 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. +sphinx!=1.6.6,!=1.6.7,>=1.6.2 # BSD +openstackdocstheme>=1.18.1 # Apache-2.0 \ No newline at end of file diff --git a/os_api_ref/__init__.py b/os_api_ref/__init__.py index 59864e7..4ab881e 100644 --- a/os_api_ref/__init__.py +++ b/os_api_ref/__init__.py @@ -19,6 +19,7 @@ from docutils.parsers import rst from docutils.parsers.rst.directives.tables import Table from docutils.statemachine import ViewList import pbr.version +import six from sphinx.util.osutil import copyfile import yaml @@ -406,7 +407,7 @@ class RestParametersDirective(Table): groups = [] trow = nodes.row() entry = nodes.entry() - para = nodes.paragraph(text=unicode(table_data)) + para = nodes.paragraph(text=six.u(table_data)) entry += para trow += entry rows.append(trow) diff --git a/test-requirements.txt b/test-requirements.txt index db6e793..38f028b 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -10,3 +10,4 @@ testrepository>=0.0.18 # Apache-2.0/BSD testtools>=2.2.0 # MIT sphinx-testing>=0.7.2 # BSD License beautifulsoup4>=4.6.0 # MIT +stestr>=2.0.0 # Apache-2.0 diff --git a/tox.ini b/tox.ini index b99a9d3..72c5bee 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] minversion = 2.0 -envlist = py27,pep8,docs +envlist = py27,py35,pep8,docs skipsdist = True [testenv] @@ -11,26 +11,33 @@ deps = -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt -commands = python setup.py test --slowest --no-parallel --testr-args='{posargs}' +commands = stestr run {posargs} [testenv:pep8] +basepython = python3 commands = flake8 {posargs} [testenv:venv] commands = {posargs} [testenv:cover] +basepython = python3 commands = python setup.py test --coverage --testr-args='{posargs}' [testenv:docs] -commands = python setup.py build_sphinx +basepython = python3 +deps = + -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} + -r{toxinidir}/requirements.txt + -r{toxinidir}/doc/requirements.txt +commands = sphinx-build -W -b html doc/source doc/build [testenv:debug] +basepython = python3 commands = oslo_debug_helper {posargs} [flake8] # E123, E125 skipped as they are invalid PEP-8. - show-source = True ignore = E123,E125,E129 builtins = _