From 447d994fe28ea100fed54d319fd1da1d6d19354a Mon Sep 17 00:00:00 2001 From: Erik Sundell Date: Tue, 15 Feb 2022 15:33:11 +0100 Subject: [PATCH] Add inline comments about pytest-xdist --- Makefile | 4 ++-- requirements-dev.txt | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 4d6688ccac..1367315098 100644 --- a/Makefile +++ b/Makefile @@ -207,7 +207,7 @@ run-sudo-shell/%: ## run a bash in interactive mode as root in a stack test/%: ## run tests against a stack (only common tests or common tests + specific tests) @echo "::group::test/$(OWNER)/$(notdir $@)" - @if [ ! -d "$(notdir $@)/test" ]; then TEST_IMAGE="$(OWNER)/$(notdir $@)" pytest -n auto -m "not info" test; \ - else TEST_IMAGE="$(OWNER)/$(notdir $@)" pytest -n auto -m "not info" test $(notdir $@)/test; fi + @if [ ! -d "$(notdir $@)/test" ]; then TEST_IMAGE="$(OWNER)/$(notdir $@)" pytest --numprocesses=auto -m "not info" test; \ + else TEST_IMAGE="$(OWNER)/$(notdir $@)" pytest --numprocesses=auto -m "not info" test $(notdir $@)/test; fi @echo "::endgroup::" test-all: $(foreach I, $(ALL_IMAGES), test/$(I)) ## test all stacks diff --git a/requirements-dev.txt b/requirements-dev.txt index 193cad0c69..7c59c0fc83 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,6 +3,8 @@ packaging plumbum pre-commit pytest +# pytest-xdist is a plugin that provides the --numprocesses flag, allowing us to +# run pytest tests in parallel. pytest-xdist requests tabulate