Skip to content

Commit

Permalink
Really run the tests in parallel (#5058)
Browse files Browse the repository at this point in the history
For those who will use the makefile, added a sensinble default.
  • Loading branch information
oz123 authored Apr 19, 2022
1 parent f3166e6 commit 853aaf8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ venv_dir := $(get_venv_dir)/pipenv_venv
venv_file := $(CURDIR)/.test_venv
get_venv_path =$(file < $(venv_file))
# This is how we will build tag-specific wheels, e.g. py36 or py37
PY_VERSIONS:= 2.7 3.5 3.6 3.7 3.8
PY_VERSIONS:= 3.7 3.8 3.9 3.10
BACKSLASH = '\\'
# This is how we will build generic wheels, e.g. py2 or py3
INSTALL_TARGETS := $(addprefix install-py,$(PY_VERSIONS))
Expand Down Expand Up @@ -66,17 +66,19 @@ submodules:
git submodule update --init --recursive

.PHONY: tests
tests: parallel ?= -n auto
tests: virtualenv submodules test-install
. $(get_venv_path)/bin/activate && \
pipenv run pytest -ra -vvv --full-trace --tb=long
pipenv run pytest -ra $(parallel) -vvv --full-trace --tb=long

.PHONY: test-specific
test-specific: submodules virtualenv test-install
. $(get_venv_path)/bin/activate && pipenv run pytest -ra -k '$(tests)'

.PHONY: retest
retest: parallel ?= -n auto
retest: virtualenv submodules test-install
. $(get_venv_path)/bin/activate && pipenv run pytest -ra -k 'test_check_unused or test_install_editable_git_tag or test_get_vcs_refs or test_skip_requirements_when_pipfile or test_editable_vcs_install or test_basic_vcs_install or test_git_vcs_install or test_ssh_vcs_install or test_vcs_can_use_markers' -vvv --full-trace --tb=long
. $(get_venv_path)/bin/activate && pipenv run pytest $(parallel) -ra -k 'test_check_unused or test_install_editable_git_tag or test_get_vcs_refs or test_skip_requirements_when_pipfile or test_editable_vcs_install or test_basic_vcs_install or test_git_vcs_install or test_ssh_vcs_install or test_vcs_can_use_markers' -vvv --full-trace --tb=long

.PHONY: build
build: install-virtualenvs.stamp install.stamp
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ mypy_path=typeshed/pyi:typeshed/imports

[tool:pytest]
addopts = -ra
plugins = xdist
testpaths = tests
; Add vendor and patched in addition to the default list of ignored dirs
; Additionally, ignore tasks, news, test subdirectories and peeps directory
Expand Down

0 comments on commit 853aaf8

Please sign in to comment.