Tests: allow running integration tests in parallel

This is done in order to speed up test execution.

Signed-off-by: Hunor Csomortáni <csomh@redhat.com>
This commit is contained in:
Hunor Csomortáni
2019-11-20 16:47:12 +01:00
parent b41b6b9cc1
commit 0f0e809467
2 changed files with 8 additions and 2 deletions

View File

@@ -35,4 +35,9 @@ have self-signed certificates. Example usage::
REQUESTS_CA_BUNDLE=/etc/pki/tls/certs/ca-bundle.crt tox -e integration
``MBS_TEST_WORKERS`` can be used to run the tests in parallel. For example to
have 4 tests running in parallel one could call::
MBS_TEST_WORKERS=4 tox -e integration
.. _tests/integration/example.test.env.yaml: example.test.env.yaml

View File

@@ -73,11 +73,12 @@ deps =
kobo
koji
pytest
pytest-xdist
PyYAML
requests
sh
# 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
passenv = REQUESTS_CA_BUNDLE MBS_TEST_CONFIG MBS_TEST_WORKERS
commands =
pytest -vv --confcutdir=tests/integration {posargs:tests/integration}
pytest -vv --confcutdir=tests/integration -n {env:MBS_TEST_WORKERS:0} {posargs:tests/integration}