chore: split test and coverage tasks
This commit is contained in:
parent
33e13e877e
commit
5738edb49c
|
@ -73,7 +73,7 @@ jobs:
|
|||
${{ matrix.release }}-pip-${{ inputs.context }}
|
||||
|
||||
- name: Test
|
||||
run: make test
|
||||
run: make test-coverage
|
||||
working-directory: ${{ inputs.context }}
|
||||
|
||||
- name: Report coverage
|
||||
|
|
|
@ -66,7 +66,7 @@ jobs:
|
|||
${{ matrix.release }}-pip-api
|
||||
|
||||
- name: Test
|
||||
run: make test
|
||||
run: make test-coverage
|
||||
working-directory: api
|
||||
|
||||
- name: Report coverage
|
||||
|
|
|
@ -8,7 +8,6 @@ PIP_INSTALL := \
|
|||
PYLINT_ARG := libretime_analyzer tests || true
|
||||
MYPY_ARG := libretime_analyzer tests || true
|
||||
BANDIT_ARG := libretime_analyzer || true
|
||||
PYTEST_ARG := --cov=libretime_analyzer tests
|
||||
|
||||
format: .format
|
||||
lint: .format-check .pylint .mypy .bandit
|
||||
|
@ -17,4 +16,5 @@ fixtures:
|
|||
bash tests/fixtures/generate.sh
|
||||
|
||||
test: fixtures .pytest
|
||||
test-coverage: fixtures .coverage
|
||||
clean: .clean
|
||||
|
|
|
@ -13,6 +13,9 @@ disable = "logging-fstring-interpolation"
|
|||
log_cli = true
|
||||
log_cli_level = "DEBUG"
|
||||
|
||||
[tool.coverage.run]
|
||||
source = ["libretime_analyzer"]
|
||||
|
||||
[build-system]
|
||||
requires = ["setuptools", "wheel"]
|
||||
build-backend = "setuptools.build_meta"
|
||||
|
|
|
@ -8,9 +8,9 @@ PIP_INSTALL := \
|
|||
PYLINT_ARG := libretime_api_client tests || true
|
||||
MYPY_ARG := libretime_api_client tests || true
|
||||
BANDIT_ARG := libretime_api_client || true
|
||||
PYTEST_ARG := --cov=libretime_api_client tests
|
||||
|
||||
format: .format
|
||||
lint: .format-check .pylint .mypy .bandit
|
||||
test: .pytest
|
||||
test-coverage: .coverage
|
||||
clean: .clean
|
||||
|
|
|
@ -13,6 +13,9 @@ disable = "logging-fstring-interpolation"
|
|||
log_cli = true
|
||||
log_cli_level = "DEBUG"
|
||||
|
||||
[tool.coverage.run]
|
||||
source = ["libretime_api_client"]
|
||||
|
||||
[build-system]
|
||||
requires = ["setuptools", "wheel"]
|
||||
build-backend = "setuptools.build_meta"
|
||||
|
|
12
api/Makefile
12
api/Makefile
|
@ -13,18 +13,10 @@ export DJANGO_SETTINGS_MODULE=libretime_api.settings.testing
|
|||
|
||||
format: .format
|
||||
lint: .format-check .pylint .mypy .bandit
|
||||
test: .pytest
|
||||
test-coverage: .coverage
|
||||
clean: .clean
|
||||
|
||||
test: $(VENV)
|
||||
$(VENV)/bin/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)
|
||||
$(VENV)/bin/libretime-api spectacular --file $(SCHEMA_FILE)
|
||||
|
|
|
@ -36,7 +36,10 @@ log_cli_level = "DEBUG"
|
|||
DJANGO_SETTINGS_MODULE = "libretime_api.settings.testing"
|
||||
|
||||
[tool.coverage.run]
|
||||
plugins = ["django_coverage_plugin"]
|
||||
source = ["libretime_api"]
|
||||
omit = [
|
||||
"*/migrations/*",
|
||||
"*/tests/*",
|
||||
]
|
||||
|
||||
|
|
|
@ -35,6 +35,7 @@ setup(
|
|||
"psycopg2>=2.8.6,<2.10",
|
||||
],
|
||||
"dev": [
|
||||
"django-coverage-plugin",
|
||||
"django-stubs",
|
||||
"djangorestframework-stubs",
|
||||
"model_bakery",
|
||||
|
|
|
@ -10,11 +10,11 @@ PIP_INSTALL := \
|
|||
PYLINT_ARG := libretime_playout tests || true
|
||||
MYPY_ARG := libretime_playout tests || true
|
||||
BANDIT_ARG := libretime_playout || true
|
||||
PYTEST_ARG := --cov=libretime_playout tests
|
||||
|
||||
format: .format
|
||||
lint: .format-check .pylint .mypy .bandit
|
||||
test: .pytest
|
||||
test-coverage: .coverage
|
||||
clean: .clean
|
||||
|
||||
.PHONY: snapshot
|
||||
|
|
|
@ -16,6 +16,9 @@ disable = "logging-fstring-interpolation"
|
|||
log_cli = true
|
||||
log_cli_level = "DEBUG"
|
||||
|
||||
[tool.coverage.run]
|
||||
source = ["libretime_playout"]
|
||||
|
||||
[build-system]
|
||||
requires = ["setuptools", "wheel"]
|
||||
build-backend = "setuptools.build_meta"
|
||||
|
|
|
@ -6,9 +6,9 @@ PIP_INSTALL = --editable .[dev]
|
|||
PYLINT_ARG = libretime_shared tests
|
||||
MYPY_ARG = libretime_shared
|
||||
BANDIT_ARG := libretime_shared
|
||||
PYTEST_ARG = --cov=libretime_shared tests
|
||||
|
||||
format: .format
|
||||
lint: .format-check .pylint .mypy .bandit
|
||||
test: .pytest
|
||||
test-coverage: .coverage
|
||||
clean: .clean
|
||||
|
|
|
@ -19,6 +19,9 @@ disallow_untyped_defs= true
|
|||
log_cli = true
|
||||
log_cli_level = "DEBUG"
|
||||
|
||||
[tool.coverage.run]
|
||||
source = ["libretime_shared"]
|
||||
|
||||
[build-system]
|
||||
requires = ["setuptools", "wheel"]
|
||||
build-backend = "setuptools.build_meta"
|
||||
|
|
|
@ -55,13 +55,18 @@ install: $(VENV)
|
|||
|
||||
.PHONY: .pytest
|
||||
.pytest: $(VENV)
|
||||
$(VENV)/bin/pytest -v \
|
||||
$(VENV)/bin/pytest \
|
||||
--numprocesses=$(CPU_CORES) \
|
||||
--color=yes \
|
||||
--color=yes
|
||||
|
||||
.PHONY: .coverage
|
||||
.coverage: $(VENV)
|
||||
$(VENV)/bin/pytest \
|
||||
--numprocesses=$(CPU_CORES) \
|
||||
--cov \
|
||||
--cov-config=pyproject.toml \
|
||||
--cov-report=term \
|
||||
--cov-report=xml:./coverage.xml \
|
||||
$(PYTEST_ARG)
|
||||
--cov-report=xml
|
||||
|
||||
.PHONY: .clean
|
||||
.clean:
|
||||
|
|
|
@ -8,9 +8,9 @@ PIP_INSTALL := \
|
|||
PYLINT_ARG := libretime_worker
|
||||
MYPY_ARG := libretime_worker || true
|
||||
BANDIT_ARG := libretime_worker
|
||||
PYTEST_ARG = --cov=libretime_worker tests
|
||||
|
||||
format: .format
|
||||
lint: .format-check .pylint .mypy .bandit
|
||||
test: .pytest
|
||||
test-coverage: .coverage
|
||||
clean: .clean
|
||||
|
|
|
@ -13,6 +13,9 @@ disable = "logging-fstring-interpolation"
|
|||
log_cli = true
|
||||
log_cli_level = "DEBUG"
|
||||
|
||||
[tool.coverage.run]
|
||||
source = ["libretime_worker"]
|
||||
|
||||
[build-system]
|
||||
requires = ["setuptools", "wheel"]
|
||||
build-backend = "setuptools.build_meta"
|
||||
|
|
Loading…
Reference in New Issue