subunit2sql/tox.ini
Matthew Treinish fca99f945c Fix compatibility with latest oslo.config
With recent versions of oslo.config the tests have started to fail
because the multistring opt used for specifying input subunit file paths
was getting an implicit required. However it's not a required field just
positional. This commit fixes this issue by explicitly setting it to not
be requried and setting a default value of None for it. I'm not sure when
an implicit required was added in oslo.config, but this should fix it
regardless of which oslo.config version is used.

Fixing other gate failure also for pythin 2.7 & 3.8 compatibility.

- with mysql 8.0 there is no implicit user creation with GRANT. we
need to create user first.

- hacking version used is too old which pull old pyflakes (< 2.1.0) not
compatible with py3.8. Bumping hacking version to 2.0.0 which solve the
pyflakes version conflict with new pip resolver but skipping all the
new checks of 2.0.0. We can fix those later once gate is green.

- for openstack-tox-py27 we need to cap stestr with <3.0.0 so that it can pull
stestr py2 compatible version.

- move dec requirements seprate from test-requirements otherwise it conflist with
other deps.

Story: 2008348
Task: 41250

Change-Id: I219755d98d9f8b5a284c0e858b60f852b948c8d4
2021-01-21 19:43:39 -06:00

84 lines
2.6 KiB
INI

[tox]
minversion = 2.0
envlist = py27,py35,py36,pep8
skipsdist = True
[testenv]
usedevelop = True
install_command = pip install -U --force-reinstall {opts} {packages}
setenv =
VIRTUAL_ENV={envdir}
OS_STDOUT_CAPTURE=1
OS_STDERR_CAPTURE=1
OS_TEST_TIMEOUT=500
whitelist_externals = find
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands =
find . -type f -name "*.pyc" -delete
stestr run {posargs}
stestr slowest
[testenv:pep8]
basepython = python3
sitepackages = False
commands =
flake8 {posargs}
[testenv:cover]
basepython = python3
setenv =
VIRTUAL_ENV={envdir}
PYTHON=coverage run --source subunit2sql --parallel-mode
commands =
stestr run {posargs}
coverage combine
coverage html -d cover
[testenv:venv]
basepython = python3
commands = {posargs}
[testenv:docs]
basepython = python3
deps =
-r{toxinidir}/doc/requirements.txt
commands = python setup.py build_sphinx
[flake8]
# E125 is deliberately excluded. See https://github.com/jcrocholl/pep8/issues/126
# E123 skipped because it is ignored by default in the default pep8
# E129 skipped because it is too limiting when combined with other rules
# H305 skipped because it is inconsistent between python versions
# E711 skipped because sqlalchemy filter() requires using == instead of is
# TODO (gmann): we have to bump the hacking version to 2.0.0 to fix the gate which is
# failing for new pip resolver. That is why F601,E402,W605,W504,E305,E117 are
# skipped temporary.
ignore = E125,E123,E129,H305,E711,F601,E402,W605,W504,E305,E117
exclude = .venv,.git,.tox,dist,doc,*egg,build,releasenotes
[testenv:generate_samples]
basepython = python3
commands =
oslo-config-generator --config-file config-generator/subunit2sql.conf
oslo-config-generator --config-file config-generator/sql2subunit.conf
oslo-config-generator --config-file config-generator/subunit2sql-db-manage.conf
[testenv:releasenotes]
basepython = python3
deps =
-r{toxinidir}/doc/requirements.txt
commands = sphinx-build -a -E -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[testenv:bindep]
# 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).
usedevelop = False
deps = bindep
commands = bindep test