From cb92d6e685e94664d4e8ca88ef92b09b5212910c Mon Sep 17 00:00:00 2001 From: lilac-supernova-2 <143229315+lilac-supernova-2@users.noreply.github.com> Date: Sat, 26 Aug 2023 02:59:40 -0400 Subject: [PATCH] Add new tests-repeat command to Makefile to be able to run unit tests multiple times + in parallel in one shot --- Makefile | 4 ++++ setup.py | 2 ++ 2 files changed, 6 insertions(+) diff --git a/Makefile b/Makefile index 31e5c93..79b20d1 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,10 @@ dev-setup: tests: PYTHONPATH=. pytest graphene_django --cov=graphene_django -vv +.PHONY: tests-repeat ## Run unit tests 100 times to possibly identify flaky unit tests (and run them in parallel) +tests-repeat: + PYTHONPATH=. pytest graphene_django --cov=graphene_django -vv --count 100 -n logical + .PHONY: format ## Format code format: black graphene_django examples setup.py diff --git a/setup.py b/setup.py index 51ed637..21d6fc2 100644 --- a/setup.py +++ b/setup.py @@ -22,6 +22,8 @@ tests_require = [ "pytz", "django-filter>=22.1", "pytest-django>=4.5.2", + "pytest-repeat>=0.9.1", + "pytest-xdist>=3.3.1", ] + rest_framework_require