chore: update python tests target

This commit is contained in:
jo 2022-06-29 14:40:37 +02:00 committed by Kyle Robbertze
parent 34864b8623
commit 26a2c2dda0
2 changed files with 18 additions and 3 deletions

View File

@ -13,12 +13,21 @@ clean: .clean
test: $(VENV)
source $(VENV)/bin/activate
DJANGO_SETTINGS_MODULE=libretime_api.settings.testing pytest -n $(CPU_CORES) --color=yes -v libretime_api
export DJANGO_SETTINGS_MODULE=libretime_api.settings.testing
pytest -v \
--numprocesses=$(CPU_CORES) \
--color=yes \
--cov-config=pyproject.toml \
--cov-report=term \
--cov-report=xml:./coverage.xml \
--cov=libretime_api \
libretime_api
SCHEMA_FILE ?= schema.yml
schema: $(VENV)
source $(VENV)/bin/activate
DJANGO_SETTINGS_MODULE=libretime_api.settings.testing libretime-api spectacular --file $(SCHEMA_FILE)
export DJANGO_SETTINGS_MODULE=libretime_api.settings.testing
libretime-api spectacular --file $(SCHEMA_FILE)
if command -v npx > /dev/null; then npx prettier --write $(SCHEMA_FILE); fi
schema-foreach-commit:

View File

@ -63,7 +63,13 @@ install: $(VENV)
.PHONY: .pytest
.pytest: $(VENV)
source $(VENV)/bin/activate
pytest -n $(CPU_CORES) --color=yes -v --cov-report term --cov-report xml:./coverage.xml $(PYTEST_ARG)
pytest -v \
--numprocesses=$(CPU_CORES) \
--color=yes \
--cov-config=pyproject.toml \
--cov-report=term \
--cov-report=xml:./coverage.xml \
$(PYTEST_ARG)
.PHONY: .clean
.clean: