Skip to content

Commit

Permalink
Introduce coverage make commands
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelofern committed Aug 26, 2024
1 parent 6551ce0 commit 6c25713
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ SHELL=/bin/bash
help:
@echo "Available targets:"
@echo " clean: Remove all build artifacts at the build/ directory."
@echo " coverage: Run code coverage and print results."
@echo " coverage_report: Only report on already computed coverage results."
@echo " coverage_run: Only run code coverage and store results."
@echo " dev: Install dev dependencies."
@echo " docs: Build the docs at the build/ directory"
@echo " help: Show this help message."
Expand All @@ -23,6 +26,20 @@ dev: install_python_packages .git/hooks/pre-commit
test:
python -m pytest $(PYTEST_FLAGS)

.PHONY:coverage_run
coverage_run:
coverage run --branch \
--include=src/django_pg_migration_tools/* \
--data-file=build/coverage \
-m pytest

.PHONY:coverage_report
coverage_report:
coverage report --format=$(COVERAGE_FORMAT) --data-file=build/coverage

.PHONY:coverage
coverage: coverage_run coverage_report

.PHONY:matrix_test
matrix_test:
nox
Expand Down

0 comments on commit 6c25713

Please sign in to comment.