Files
deb-python-fuelclient/tox.ini
Roman Prykhodchenko 769df968e1 Use testrepository as the test runner
There are several benefits moving to testr brings
  - It reduces the diversity of tools in OpenStack
  - testrepository and related components are used in OpenStack Infra
    environment for data analisys and deeper integration
  - Reduces chances of a new dependency hell because py.test won’t be
    added to global-requirements
  - Sticking to global requirements is an idea which is in the scope
    of discussions around Fuel.

In order to facilitate both running specific tests and debugging
this patch introduces dbgunit and dbgfunc tox environments that
utilize oslotest to run unit and functional tests correspondingly
and respect pdb.

Examples:

  - tox -e dbgunit v1.test_parser
  - tox -e dbgfunc v1.test_client.TestHandlers.test_env_action

Partial-bug: #1499659
Change-Id: Ia3e9c16bb21a875ceea3ea3a30c12ac8dfabc277
2015-10-08 21:58:32 +02:00

86 lines
2.6 KiB
INI

[tox]
minversion = 2.1
skipsdist = True
envlist = py26,py27,pep8,functional,cleanup
[testenv]
usedevelop = True
install_command = pip install --allow-external -U {opts} {packages}
whitelist_externals = bash
oslo_debug_helper
setenv = VIRTUAL_ENV={envdir}
ARTIFACTS={toxinidir}/{env:ARTIFACTS:test_run}
FUELCLIENT_JUNIT={env:FUELCLIENT_JUNIT:fuelclient}-{envname}.xml
FUELCLIENT_CUSTOM_SETTINGS={toxinidir}/{env:ARTIFACTS:test_run}/fuel_client_config.yaml
# Functional env settings
FUEL_WEB_CLONE={env:FUEL_WEB_CLONE:yes}
FUEL_WEB_REPO={env:FUEL_WEB_REPO:https://github.com/stackforge/fuel-web.git}
FUEL_WEB_ROOT={env:FUEL_WEB_ROOT:/tmp/fuel_web}
FETCH_REPO={env:FETCH_REPO:}
FETCH_REFSPEC={env:FETCH_REFSPEC:}
FUEL_COMMIT={env:FUEL_COMMIT:master}
NAILGUN_ROOT={env:FUEL_WEB_ROOT:/tmp/fuel_web}/nailgun
# Nailgun server parameters
NAILGUN_PORT={env:NAILGUN_PORT:8003}
NAILGUN_CHECK_PATH={env:NAILGUN_CHECK_PATH:/api/version}
NAILGUN_START_MAX_WAIT_TIME={env:NAILGUN_START_MAX_WAIT_TIME:20}
TEST_NAILGUN_DB={env:TEST_NAILGUN_DB:nailgun}
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands =
bash -c "TESTS_DIR={posargs:./fuelclient/tests/unit} python setup.py test --slowest"
[testenv:functional]
commands =
bash {toxinidir}/tools/cleanup.sh
bash {toxinidir}/tools/prepare_nailgun.sh
bash -c "TESTS_DIR={posargs:./fuelclient/tests/functional} python setup.py test --slowest"
[testenv:dbgunit]
commands = oslo_debug_helper -t {toxinidir}/fuelclient/tests/unit {posargs}
[testenv:dbgfunc]
commands =
bash {toxinidir}/tools/cleanup.sh
bash {toxinidir}/tools/prepare_nailgun.sh
oslo_debug_helper -t {toxinidir}/fuelclient/tests/functional {posargs}
[testenv:cleanup]
commands =
bash {toxinidir}/tools/cleanup.sh
bash -c "find {toxinidir} -name \"*.pyc\" -delete"
[tox:jenkins]
downloadcache = ~/cache/pip
[testenv:pep8]
deps = hacking==0.10
usedevelop = False
commands =
flake8 {posargs:fuelclient}
[testenv:cover]
commands =
bash -c "TESTS_DIR={posargs:./fuelclient/tests/unit} python setup.py testr --coverage"
[testenv:venv]
commands = {posargs:}
[testenv:devenv]
envdir = devenv
usedevelop = True
[flake8]
# TODO(romcheg): Most of there exceptions must be removed when
# old CLI is removed.
ignore = H234,H302,H802,H405
exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build,tools,__init__.py,docs
show-pep8 = True
show-source = True
count = True
[hacking]
import_exceptions = testtools.matchers