From 093ce8945f265e0897501333051331492ecf42eb Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Wed, 28 Feb 2024 22:11:32 -0800 Subject: [PATCH] Stop running client tests in parallel with xdist These tests are pretty quick that they don't really benefit from xdist. Plus not all of our tests are threadsafe (e.g. the ones that call locale.setlocale()), so if there's no real need for parallelization, let's skip it. Refs #1880. --- client/Makefile | 6 +++--- client/poetry.lock | 38 ++------------------------------------ client/pyproject.toml | 1 - 3 files changed, 5 insertions(+), 40 deletions(-) diff --git a/client/Makefile b/client/Makefile index b8980fba7..346277f12 100644 --- a/client/Makefile +++ b/client/Makefile @@ -56,8 +56,8 @@ TESTOPTS ?= -v --cov-config .coveragerc --cov-report html --cov-report term-miss RANDOM_SEED ?= $(shell bash -c 'echo $$RANDOM') .PHONY: test -test: ## Run the application tests in parallel (for rapid development) - @TEST_CMD="poetry run pytest -v -n 4 --ignore=$(FTESTS) --ignore=$(ITESTS) $(TESTOPTS) $(TESTS)" ; \ +test: ## Run the application tests (for rapid development) + @TEST_CMD="poetry run pytest -v --ignore=$(FTESTS) --ignore=$(ITESTS) $(TESTOPTS) $(TESTS)" ; \ source scripts/setup-tmp-directories.sh; \ if command -v xvfb-run > /dev/null; then \ xvfb-run -a $$TEST_CMD ; else \ @@ -72,7 +72,7 @@ test-random: ## Run the application tests in random order .PHONY: test-integration test-integration: ## Run the integration tests - @TEST_CMD="poetry run pytest -v -n 4 $(ITESTS)" ; \ + @TEST_CMD="poetry run pytest -v $(ITESTS)" ; \ if command -v xvfb-run > /dev/null; then \ xvfb-run -a $$TEST_CMD ; else \ $$TEST_CMD ; fi diff --git a/client/poetry.lock b/client/poetry.lock index b7c299688..cb9995373 100644 --- a/client/poetry.lock +++ b/client/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.7.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.6.1 and should not be changed by hand. [[package]] name = "alembic" @@ -282,20 +282,6 @@ files = [ [package.extras] test = ["pytest (>=6)"] -[[package]] -name = "execnet" -version = "2.0.2" -description = "execnet: rapid multi-Python deployment" -optional = false -python-versions = ">=3.7" -files = [ - {file = "execnet-2.0.2-py3-none-any.whl", hash = "sha256:88256416ae766bc9e8895c76a87928c0012183da3cc4fc18016e6f050e025f41"}, - {file = "execnet-2.0.2.tar.gz", hash = "sha256:cc59bc4423742fd71ad227122eb0dd44db51efb3dc4095b45ac9a08c770096af"}, -] - -[package.extras] -testing = ["hatch", "pre-commit", "pytest", "tox"] - [[package]] name = "face" version = "22.0.0" @@ -1429,26 +1415,6 @@ files = [ pytest = ">=3.6.0" vcrpy = "*" -[[package]] -name = "pytest-xdist" -version = "3.3.1" -description = "pytest xdist plugin for distributed testing, most importantly across multiple CPUs" -optional = false -python-versions = ">=3.7" -files = [ - {file = "pytest-xdist-3.3.1.tar.gz", hash = "sha256:d5ee0520eb1b7bcca50a60a518ab7a7707992812c578198f8b44fdfac78e8c93"}, - {file = "pytest_xdist-3.3.1-py3-none-any.whl", hash = "sha256:ff9daa7793569e6a68544850fd3927cd257cc03a7ef76c95e86915355e82b5f2"}, -] - -[package.dependencies] -execnet = ">=1.1" -pytest = ">=6.2.0" - -[package.extras] -psutil = ["psutil (>=3.0)"] -setproctitle = ["setproctitle"] -testing = ["filelock"] - [[package]] name = "python-dateutil" version = "2.7.5" @@ -2218,4 +2184,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "362d5031e5815e0115adfebdd42ab888cce3e760241f27484634ab47a0c67f35" +content-hash = "3f1aa5fc1f7b2b0d72b56a6e5a505ab68294a1b4d82562ecb8e12fe67dabe2e5" diff --git a/client/pyproject.toml b/client/pyproject.toml index 8ff5884e6..75908eff0 100644 --- a/client/pyproject.toml +++ b/client/pyproject.toml @@ -41,7 +41,6 @@ pytest-mock = "*" pytest-qt = "^4.2.0" pytest-random-order = "*" pytest-vcr = "*" -pytest-xdist = "^3.0.2" semgrep = "*" translate-toolkit = "*" types-polib = "*"