From a85a2d7ea8bb39518163733c7b53e2ff6746c709 Mon Sep 17 00:00:00 2001 From: Matthieu Darbois Date: Mon, 20 Sep 2021 12:32:05 +0200 Subject: [PATCH] feat(CI): run linux tests with pytest-xdist (#831) --- bin/run_tests.py | 15 ++++++++++++++- setup.py | 1 + 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/bin/run_tests.py b/bin/run_tests.py index 50550a88..4b56acf0 100755 --- a/bin/run_tests.py +++ b/bin/run_tests.py @@ -17,7 +17,20 @@ if __name__ == "__main__": subprocess.run(unit_test_args, check=True) # run the integration tests + xdist_test_args = [] + if sys.platform.startswith("linux"): + xdist_test_args = ["-n", "2"] subprocess.run( - [sys.executable, "-m", "pytest", "-x", "--durations", "0", "--timeout=2400", "test"], + [ + sys.executable, + "-m", + "pytest", + *xdist_test_args, + "-x", + "--durations", + "0", + "--timeout=2400", + "test", + ], check=True, ) diff --git a/setup.py b/setup.py index bcd7324b..292489bf 100644 --- a/setup.py +++ b/setup.py @@ -11,6 +11,7 @@ extras = { "jinja2", "pytest>=6", "pytest-timeout", + "pytest-xdist; sys_platform == 'linux'", ], "bin": [ "click",