Files
fm-orchestrator/tox.ini
Hunor Csomortáni 0066c79dae Bootstrap integration tests
This is the first step to have some tests, that we could run against an
MBS instance, to check that it's functionally correct. Ultimately, these
will replace the test scripts (`contrib/test-*`).

This doesn't really do anything yet, but I would like to make sure that
everyone is on the same page regarding how this will be set up.

Signed-off-by: Hunor Csomortáni <csomh@redhat.com>
2019-10-24 10:16:16 +02:00

77 lines
2.0 KiB
INI

# Tox (http://tox.testrun.org/) is a tool for running tests
# in multiple virtualenvs. This configuration file will run the
# test suite on all supported python versions. To use it, "pip install tox"
# and then run "tox" from this directory.
[tox]
envlist = flake8, py27, py3
[flake8]
ignore = E731,W503
max-line-length = 100
exclude =
./.tox
./.git
./module_build_service/migrations
./build
./.env
[testenv]
usedevelop = true
sitepackages = true
# Allow to switch database backend for running tests.
passenv = DATABASE_URI
whitelist_externals =
flake8
py.test-3
deps = -r{toxinidir}/test-requirements.txt
commands =
py.test -v \
--ignore tests/integration \
--cov module_build_service \
--cov-report html \
--cov-report term \
-W "ignore:Use .persist_selectable:DeprecationWarning" \
-W "ignore:The ConnectionEvents.dbapi_error() event is deprecated and will be removed in a future release. Please refer to the ConnectionEvents.handle_error() event.:DeprecationWarning" \
{posargs}
[testenv:coverage]
basepython = python2
deps =
{[testenv]deps}
coverage
commands =
coverage run --parallel-mode -m pytest
coverage combine
coverage report --omit=tests/*,.tox/*,/usr/* -m --skip-covered
[testenv:flake8]
basepython = python2
skip_install = true
deps = flake8
commands = flake8
[testenv:bandit]
basepython = python2
skip_install = true
deps = bandit
commands =
/bin/bash -c "bandit -r -ll $(find . -mindepth 1 -maxdepth 1 ! -name tests ! -name \.\* -type d -o -name \*.py)"
ignore_outcome = True
[testenv:integration]
basepython = python3
skipsdist = true
skip_install = true
sitepackages = false
# let's handle integration test deps separately
deps =
pytest
requests
PyYAML
# Set this to /etc/pki/tls/certs/ca-bundle.crt, for example,
# if the instance tested has a self-signed certificate.
passenv = REQUESTS_CA_BUNDLE MBS_TEST_CONFIG
commands =
pytest -vv --confcutdir=tests/integration {posargs:tests/integration}