You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by to...@apache.org on 2021/11/07 18:42:41 UTC

[libcloud] 01/14: Run unit tests in parallel to speed up the test run.

This is an automated email from the ASF dual-hosted git repository.

tomaz pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git

commit 2d1ad6adaf9c0f2d0b6402b3f4c276dca484e3c3
Author: Tomaz Muraus <to...@tomaz.me>
AuthorDate: Sat Nov 6 23:22:43 2021 +0100

    Run unit tests in parallel to speed up the test run.
---
 requirements-tests.txt | 2 ++
 tox.ini                | 6 +++++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/requirements-tests.txt b/requirements-tests.txt
index 118c425..5547fc9 100644
--- a/requirements-tests.txt
+++ b/requirements-tests.txt
@@ -15,6 +15,8 @@ requests_mock
 # 5.3.2 is latest version which still supports Python 3.5, >= 6.2.5 is needed for Python 3.10
 pytest==5.3.2; python_version <= '3.5'
 pytest==6.2.5; python_version >= '3.6'
+pytest-xdist==2.2.1; python_version <= '3.5'
+pytest-xdist==2.4.0; python_version >= '3.6'
 cryptography==3.2.1; python_version <= '3.5'
 cryptography==35.0.0; python_version >= '3.6'
 # NOTE: Only needed by nttcis loadbalancer driver
diff --git a/tox.ini b/tox.ini
index f5c3886..82c90d9 100644
--- a/tox.ini
+++ b/tox.ini
@@ -21,8 +21,12 @@ basepython =
     {py3.10,py3.10-dist,py3.10-dist-wheel}: python3.10
 setenv =
   CRYPTOGRAPHY_ALLOW_OPENSSL_102=1
+# NOTE: By default we run tests on CI in parallel to speed up the build
+# To avoid per-test function process safety issues we run all tests in a single
+# file in the same worker process.
+# python setup.py test
 commands = cp libcloud/test/secrets.py-dist libcloud/test/secrets.py
-           python setup.py test
+           pytest -rsx -vvv --capture=tee-sys -o log_cli=True --durations=10 -n auto --dist loadfile
 
 whitelist_externals = cp
                       bash