subunit2sql/tox.ini
Masayuki Igawa 99f770ca13
Fix gate error "mysqladmin: command not found" and etc
mysqladmin package is required in tools/test-setup.sh
so adding bindep.txt file for this binary dependencies. And postgresql
packages are also required as well.

- http://lists.openstack.org/pipermail/openstack-discuss/2019-June/007272.html

This commit also updated sphinx versions in test-requirements.txt to
avoid this error.

  ERROR: Sphinx requires Python '>=3.5' but the running Python is 2.7.15

And also, this commit fixes a sqlalchemy error. This probably caused by
sqlalchemy version updates. It might be better to fix the code rather
than the sqlalchemy version cap.

  sqlalchemy.exc.ArgumentError: Textual SQL expression
    "tests.id='fake_null_test_..." should be explicitly declared as
    text("tests.id='fake_null_test_...")

Change-Id: Iff79081403fbc26442165ff5feb300bc317b0dfc
2019-07-18 12:11:53 +09:00

77 lines
2.3 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
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
ignore = E125,E123,E129,H305,E711
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
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