From 78e104d18b467dff5c97516c9dbe541eb8f7f276 Mon Sep 17 00:00:00 2001 From: Harry Date: Wed, 8 May 2024 11:43:39 +0800 Subject: [PATCH] [KYUUBI #6281][PY] Speed up testing with xdist plugin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # :mag: Description ## Issue References ๐Ÿ”— This pull request fixes #6281 Following up to #6343 , this PR adds `pytest-xdist` plugin to speed up python client unit testing ## Types of changes :bookmark: - [ ] Bugfix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) ## Test Plan ๐Ÿงช #### Behavior Without This Pull Request :coffin: Running tests usually takes ~10 mins #### Behavior With This Pull Request :tada: Running tests can take up to 5 mins #### Related Unit Tests --- # Checklist ๐Ÿ“ - [ ] This patch was not authored or co-authored using [Generative Tooling](https://www.apache.org/legal/generative-tooling.html) **Be nice. Be informative.** Closes #6369 from sudohainguyen/ci/speed-up-test. Closes #6281 f0ce55719 [Harry] [KYUUBI #6281][PY] Speed up testing with xdist plugin Authored-by: Harry Signed-off-by: Cheng Pan --- python/dev_requirements.txt | 1 + python/setup.cfg | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/python/dev_requirements.txt b/python/dev_requirements.txt index 333b76eb451..0360ab6d17f 100644 --- a/python/dev_requirements.txt +++ b/python/dev_requirements.txt @@ -4,6 +4,7 @@ mock==2.0.0 pycodestyle==2.3.1 pytest==7.4.4 pytest-cov==5.0.0 +pytest-xdist==3.5.0 # actual dependencies: let things break if a package changes sqlalchemy>=1.3.0 diff --git a/python/setup.cfg b/python/setup.cfg index a26237aac10..c1a9299b988 100644 --- a/python/setup.cfg +++ b/python/setup.cfg @@ -2,7 +2,7 @@ tag_build = [tool:pytest] -addopts = --tb=short --cov pyhive --cov-report html --cov-report term +addopts = -n 4 --tb=short --cov pyhive --cov-report html --cov-report term norecursedirs = env python_files = test_*.py filterwarnings =