deb-barbican/tox.ini
Victor Stinner c5012af5f2 Port last test (test_secrets) to Python 3
* normalize_before_encryption(): on Python 3, unencrypted is already a Unicode
  string (no need to decode).
* test_secrets: don't pass bytes string but native string (py2: bytes,
  py3: Unicode) as payload
* test_secrets: Decode HTTP bytes from UTF-8 for comparison
* test_get_secret_is_decoded_for_binary(): expect a binary string,
  not a Unicode string
* test_secrets: replace map() with a reglar loop (for) to execute
  child.delete() on Python 3. On Python 3, map() is now lazy and only
  execute the expression when the map is consumed.
* Remove tests-py3-blacklist.txt and the testenv:py34 section from
  tox.ini since all unit tests now pass on Python 3.4

Partially implements: blueprint barbican-py3
Change-Id: Ief8531c3b7201f884d5d4ca7a47a381d0bb9cb2c
2016-06-21 12:07:58 +02:00

79 lines
2.2 KiB
INI

[tox]
envlist = pep8,py34,py27,docs
[testenv]
install_command = pip install -U {opts} {packages}
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands =
/usr/bin/find . -type f -name "*.pyc" -delete
python setup.py testr --coverage --testr-args='{posargs}'
coverage combine
coverage report -m
[testenv:cover]
deps =
{[testenv]deps}
diff_cover
commands =
python setup.py testr --coverage --testr-args='{posargs}'
coverage combine
coverage xml
diff-cover --fail-under 100 coverage.xml
[testenv:releasenotes]
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[testenv:pep8]
sitepackages = False
commands =
flake8 {posargs}
# Run security linter
bandit -r barbican -x tests -n5
[testenv:venv]
commands = {posargs}
[testenv:debug]
commands = oslo_debug_helper {posargs}
[testenv:py3pep8]
# This hack is in place to allow us to run py3 based flake8
# without installing barbican.
basepython = python3
install_command = /bin/echo {packages}
commands =
pip install "hacking>=0.10.0,<0.11"
flake8 barbican setup.py
[testenv:docs]
commands=
rm -rf api-guide/build
python setup.py build_sphinx
sphinx-build -W -b html api-guide/source api-guide/build/html
[testenv:api-guide]
# This environment is called from CI scripts to test and publish
# the API Guide to developer.openstack.org.
commands =
sphinx-build -W -b html -d api-guide/build/doctrees api-guide/source api-guide/build/html
[testenv:functional]
# This tox env is purely to make local test development easier
# Note: This requires local running instances of Barbican and Keystone
deps = -r{toxinidir}/test-requirements.txt
setenv = OS_TEST_PATH={toxinidir}/functionaltests
commands =
/usr/bin/find . -type f -name "*.pyc" -delete
/bin/bash {toxinidir}/functionaltests/pretty_tox.sh '{posargs}'
passenv = KMIP_PLUGIN_ENABLED
[flake8]
exclude = .git,.idea,.tox,bin,dist,debian,rpmbuild,tools,*.egg-info,*.eggs,*openstack/common,contrib,
functionaltests,*alembic_migrations/versions,*docs/target,*.egg
[testenv:bandit]
deps = -r{toxinidir}/test-requirements.txt
commands = bandit -r barbican -x tests -n5