3e9aa8b310
* Before this change method acquire_lock() would override all changes made for an entity by a concurrent transaction when calling entity.update() although one line before it should have read this entity from DB and update only a timestamp to acquire the lock. The solution is just to append "FOR UPDATE" to an SQL statement when fetching an entity from DB. In this case we don't need to artificially update a timestamp at all. * Unit test for MySQL or Postgres is currently impossible, all unit tests are run against sqlite * Adding "PYTHONHASHSEED = 0" into "venv" environment in tox.ini to prevent sphinx from failing. It should be added to "venv" because docs building run with command "tox -evenv -- python setup.py build_sphinx". * Fixed minor style issues Change-Id: Ia749f397e18e927820ff7ae6bac7d28dc2aa2ba4
68 lines
1.9 KiB
INI
68 lines
1.9 KiB
INI
[tox]
|
|
envlist = py34,py27,pep8
|
|
minversion = 1.6
|
|
skipsdist = True
|
|
|
|
[testenv]
|
|
sitepackages = True
|
|
usedevelop = True
|
|
install_command = pip install -U --force-reinstall {opts} {packages}
|
|
setenv = VIRTUAL_ENV={envdir}
|
|
PYTHONDONTWRITEBYTECODE = 1
|
|
passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
|
|
deps = -r{toxinidir}/test-requirements.txt
|
|
commands =
|
|
find . -type f -name "*.pyc" -delete
|
|
python setup.py testr --slowest --testr-args='{posargs}'
|
|
whitelist_externals =
|
|
rm
|
|
find
|
|
|
|
[testenv:unit-postgresql]
|
|
setenv = VIRTUAL_ENV={envdir}
|
|
passenv = ZUUL_PROJECT
|
|
commands = ./run_tests.sh -V --db-type postgresql
|
|
|
|
[testenv:pep8]
|
|
commands = flake8 {posargs} . {toxinidir}/tools/get_action_list.py {toxinidir}/tools/sync_db.py
|
|
|
|
[testenv:cover]
|
|
# Also do not run test_coverage_ext tests while gathering coverage as those
|
|
# tests conflict with coverage.
|
|
setenv = VIRTUAL_ENV={envdir}
|
|
commands =
|
|
python setup.py testr --coverage \
|
|
--testr-args='^(?!.*test.*coverage).*$'
|
|
|
|
[testenv:genconfig]
|
|
commands =
|
|
oslo-config-generator --config-file tools/config/config-generator.mistral.conf \
|
|
--output-file etc/mistral.conf.sample
|
|
|
|
#set PYTHONHASHSEED=0 to prevent wsmeext.sphinxext from randomly failing.
|
|
[testenv:venv]
|
|
setenv = PYTHONHASHSEED=0
|
|
commands = {posargs}
|
|
|
|
#set PYTHONHASHSEED=0 to prevent wsmeext.sphinxext from randomly failing.
|
|
[testenv:docs]
|
|
setenv = PYTHONHASHSEED=0
|
|
commands = python setup.py build_sphinx
|
|
|
|
[testenv:pylint]
|
|
setenv = VIRTUAL_ENV={envdir}
|
|
commands = bash tools/lintstack.sh
|
|
|
|
[testenv:releasenotes]
|
|
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
|
|
|
|
#Skip PEP257 violation.
|
|
[flake8]
|
|
ignore = D100,D101,D102,D103,D104,D105,D200,D203,D202,D204,D205,D208,D400,D401
|
|
show-source = true
|
|
builtins = _
|
|
exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,tools,scripts
|
|
|
|
[hacking]
|
|
local-check-factory = mistral.hacking.checks.factory
|