From 2b7541b3b2e69fa31e96445e9bd3b789a8c466ff Mon Sep 17 00:00:00 2001 From: Tiexin Guo Date: Fri, 16 Aug 2024 16:34:29 +0800 Subject: [PATCH 1/3] test: run pytest in parallel with pytest xdist --- tox.ini | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 803b2a579..3643690e9 100644 --- a/tox.ini +++ b/tox.ini @@ -73,10 +73,11 @@ deps = websocket-client==1.* coverage[toml]~=7.0 pytest~=7.2 + pytest-xdist~=3.6 typing_extensions~=4.2 commands = coverage run --source={[vars]src_path} \ - -m pytest --ignore={[vars]tst_path}smoke -v --tb native {posargs} + -m pytest -n auto --ignore={[vars]tst_path}smoke -v --tb native {posargs} coverage report [testenv:pebble] From 84de8b5dab696d87116e8253665712b1c9b10150 Mon Sep 17 00:00:00 2001 From: Tiexin Guo Date: Mon, 19 Aug 2024 13:49:15 +0800 Subject: [PATCH 2/3] chore: remove coverage --- tox.ini | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tox.ini b/tox.ini index 3643690e9..6a52559f5 100644 --- a/tox.ini +++ b/tox.ini @@ -71,14 +71,11 @@ passenv = deps = PyYAML==6.* websocket-client==1.* - coverage[toml]~=7.0 pytest~=7.2 pytest-xdist~=3.6 typing_extensions~=4.2 commands = - coverage run --source={[vars]src_path} \ - -m pytest -n auto --ignore={[vars]tst_path}smoke -v --tb native {posargs} - coverage report + pytest -n auto --ignore={[vars]tst_path}smoke -v --tb native {posargs} [testenv:pebble] description = Run real pebble tests From 5861e893f61b8cca791a52e630633b6f705f1bfb Mon Sep 17 00:00:00 2001 From: Tiexin Guo Date: Tue, 20 Aug 2024 10:24:43 +0800 Subject: [PATCH 3/3] feat: add tox -e coverage --- tox.ini | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 6a52559f5..4efd6f859 100644 --- a/tox.ini +++ b/tox.ini @@ -64,7 +64,7 @@ commands = pyright {posargs} [testenv:unit] -description = Run unit tests +description = Run unit tests in parallel without coverage passenv = RUN_REAL_PEBBLE_TESTS PEBBLE @@ -77,6 +77,22 @@ deps = commands = pytest -n auto --ignore={[vars]tst_path}smoke -v --tb native {posargs} +[testenv:coverage] +description = Run unit tests with coverage +passenv = + RUN_REAL_PEBBLE_TESTS + PEBBLE +deps = + PyYAML==6.* + websocket-client==1.* + coverage[toml]~=7.0 + pytest~=7.2 + typing_extensions~=4.2 +commands = + coverage run --source={[vars]src_path} \ + -m pytest --ignore={[vars]tst_path}smoke -v --tb native {posargs} + coverage report + [testenv:pebble] description = Run real pebble tests allowlist_externals = pebble