
For most of the tests for storyboard sqlite is around 10 times faster than MySQL (more for non-SSD systems). An sqlite database does not support some operations, like modifying constraints or dropping columns, so we cannot avoid testing with MySQL. We can however use sqlite for local development to reduce the pain involved with running tests as part of the development process. This patch adds a tox environment for running the tests against sqlite3. The new tox environment is intended to be used by developers as well as the new check and gate job defined in .zuul.yaml. The new job ensures that changes to alembic migration scripts continue to work with sqlite. This patch also modifies the existing alter scripts to skip steps not supported under sqlite. Those steps aren't strictly needed, and they are still tested when the CI system runs the tests with MySQL. Change-Id: Icb979cb03e10c56519a90ea3976a4da2d9bddb05 Signed-off-by: Doug Hellmann <doug@doughellmann.com>
72 lines
2.0 KiB
INI
72 lines
2.0 KiB
INI
[tox]
|
|
minversion = 2.9.1
|
|
skipsdist = True
|
|
envlist = py34,py27,pep8
|
|
|
|
[testenv]
|
|
usedevelop = True
|
|
install_command = pip install -U {opts} {packages}
|
|
setenv =
|
|
VIRTUAL_ENV={envdir}
|
|
OS_STDERR_CAPTURE=1
|
|
OS_STDOUT_CAPTURE=1
|
|
passenv =
|
|
OS_TEST_TIMEOUT
|
|
STORYBOARD_TEST_DB
|
|
deps = -r{toxinidir}/requirements.txt
|
|
-r{toxinidir}/test-requirements.txt
|
|
commands = ostestr '{posargs}'
|
|
whitelist_externals = bash
|
|
|
|
[testenv:sqlite]
|
|
basepython = python3
|
|
setenv =
|
|
STORYBOARD_TEST_DB=sqlite:///{envtmpdir}
|
|
OS_STDERR_CAPTURE=1
|
|
OS_STDOUT_CAPTURE=1
|
|
|
|
[testenv:pep8]
|
|
commands = flake8
|
|
|
|
[testenv:venv]
|
|
basepython = python2
|
|
commands = {posargs}
|
|
|
|
[testenv:docs]
|
|
deps = -r{toxinidir}/doc/requirements.txt
|
|
commands =
|
|
rm -rf doc/html doc/build
|
|
rm -rf doc/source/apidoc doc/source/api
|
|
# NOTE(dhellmann): We cannot use -W with sphinx-build because the
|
|
# wsme.sphinxext registers a directive that is already registered
|
|
# and that warning causes the build to exit.
|
|
sphinx-build -b html doc/source doc/build/html
|
|
|
|
[testenv:cover]
|
|
commands = python setup.py testr --coverage --testr-args='{posargs}'
|
|
|
|
[flake8]
|
|
# E125 and E128 are ignored on purpose, they are invalid pep8
|
|
# The following rules should either be addressed or determined to be
|
|
# skippable long term.
|
|
# H405 is ignored to make switch to newer hacking easier
|
|
# H234 is ignored to make switch to newer hacking easier
|
|
# H233 is ignored to make switch to newer hacking easier
|
|
# E265 is ignored to make switch to newer hacking easier
|
|
# H236 is ignored to make switch to newer hacking easier
|
|
ignore = E125,E128,H405,H234,H233,E265,H236
|
|
builtins = _
|
|
show-source = True
|
|
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build
|
|
|
|
[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.
|
|
deps = bindep
|
|
commands = bindep test
|
|
|
|
[hacking]
|
|
import_exceptions = storyboard._i18n
|