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 <gr@ham.ie>
This commit is contained in:
Graham Hayes 2018-06-13 15:00:17 +01:00 committed by Stephen Finucane
parent 982382a549
commit d6805491ed
7 changed files with 27 additions and 5 deletions

1
.gitignore vendored
View File

@ -29,6 +29,7 @@ cover/
nosetests.xml
.testrepository
.venv
.stestr/
# Translations
*.mo

3
.stestr.conf Normal file
View File

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

View File

@ -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

5
doc/requirements.txt Normal file
View File

@ -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

View File

@ -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)

View File

@ -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

15
tox.ini
View File

@ -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 = _